Skip to main content

Using the SoleasPay API

API Environments

The base URL for the SoleasPay API is different between our sandbox and production environments:
EnvironmentBase URL
Sandboxhttps://sandbox.soleaspay.com
Productionhttps://soleaspay.com
The specific operation can be called by appending the endpoint to the base URL. Example: https://sandbox.soleaspay.com

Authentication

SoleasPay’s API support two Authentication flow :
  • header token flow For this authentication, you need to provide your apikey in the request payload on headers
The authed parameter is : x-api-key : <your api key>This authentication flow is need for all endpoint prefixed like /api/agent/
  • Bearer token flow Here you need to request a bearer token and provide it for all requests on Authorization headers
Request example
    curl -i -X POST \
      --url https://soleaspay.com/api/action/auth \
      -H 'Content-Type: application/json' \
      --header 'Content-Type: application/json' \
      -data '{
        "public_apikey": "YOUR_SOLEASPAY_APIKEY",
        "private_secretkey": "YOUR_SOLEASPAY_PRIVATE_KEY"
      }'
Response
    {
        "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpYXQiOjE2MzcyMjkyMjAsImV4cCI6MTYzNzIzMjgyMCwicm9sZXMiOlsiUk9MRV9BR0VOVCIsIlJPTEVfQVBJIl0sImVtYWlsIjoibXlzb2xlYXNAZ21haWwuY29tIn0.aQBVdzQ-hQbrMh2EP_s3iGjjREF7GiOTt6WMu6yKEUgZe3kQUSnNhvVeUu37SKE3zJNPevV-2ADdqpppfCnSx49_JD574PYqccVjxcV9KiCyngLH9QlpZcPSSZneq5uKFOaFGSDnbRhrAGjN6F8bmllFDKN78bqwUDwqhcJWZCmpFj10IG23k8gNIZ1lXE318i5NoVIiPLJul4vEFsFUqe4Y8QQ0hMyLuhQ-r8n7tyUNht92RgtJDoWPGydgjauAvlgcO2rXXKhVomJwTurRhp1klOYp4FUXwljUSqpUayywU8nsBMfKj0BZME7k2hMGvSEZHZzR1hjxOQCZHvXTWFwawbadd0PpAdccjkl_fwAZteL2bJL_MS2XY5outZ8cJbHeS1yJnDTPEU4bm7DGAOEIRVm1rralmIWg1AnCkksGrt4dMNFUY4VHNDbICl0wg0ZQbtszPM3LwYLXy1F0Qh6xsuy-cBAE6VrRefIv6_qsFLQv3cfOFrDXbKnDdk3XAYyDbqpcfLkF9yieHtVEChOQZXpypqmxAb0_cinLoqoci6H2Ii598QcpIrlYYbx6Vj72tiKWh_ToDSTmCaAhitDt9S5559PSBjK7cqcLQXP8jPgC02EEBUnC2nodo-Xi0F-_s0iMJ2KT3Au4EZ847uJWAdcHg3_KuNRDALYP7m0",
        "data": {
            "expireAt": "2021-11-18 10:08"
        }
    }
The authed parameters are :
  • Authorization : Bearer <received token>
  • X-SP-AUTH-TOKEN : Bearer <received token>
This authentication flow is need for all endpoint prefixed like /api/action/The Bearer token is valid for 3600 s