Skip to content

Search is only available in production builds. Try building and previewing the site to test it out locally.

Authentication

Every Pay-In request uses HTTP Basic authentication:

  • Username: your api_key
  • Password: your api_secret

You create both in the Developer Portal. All requests go over HTTPS and send and receive JSON.

Terminal window
curl https://sandbox-api.cashela.com/api/v1/pay-in/deposit-creation/countries \
-u "$CASHELA_API_KEY:$CASHELA_API_SECRET" \
-H "Accept: application/json"

If your HTTP client does not build the header for you, send Authorization: Basic <base64(api_key:api_secret)>; the examples above do it for you.

Keep the secret on your server

Your api_secret also signs the notifications Cashela sends to your notification_url (see Webhooks). Anyone who has it can call the API as you and forge notifications. Never put it in a browser, a mobile app, a public repository or a log.

Use the right credentials for each environment

EnvironmentBase URLCredentials
Sandboxhttps://sandbox-api.cashela.comA key from the Sandbox card
Productionhttps://production-api.cashela.comA key from the Production card

When authentication fails

ResponseTypical causes
401 {"success": false, "message": "Unauthorized."}Missing credentials; wrong key or secret; credentials of the other environment; the key is Disabled or revoked; an old key used after its rotation grace period ended.
403 {"success": false, "message": "IP address is not allowed."}The key has an IP whitelist and the request came from another address.
403 {"success": false, "message": "Insufficient permissions."}The key is not allowed to use that endpoint. Contact Cashela support.
429Too many requests. Wait the number of seconds in the Retry-After header before retrying.

Trace IDs

Send your own correlation id in the optional X-Trace-Id header on every request (a UUID works well) and log it. Cashela generates one when you do not send it. Quote it, together with the deposit reference, when you contact support.

Terminal window
curl https://sandbox-api.cashela.com/api/v1/pay-in/transactions/210000000000 \
-u "$CASHELA_API_KEY:$CASHELA_API_SECRET" \
-H "X-Trace-Id: 6f1c2b7e-3a4d-4e5f-9a8b-1c2d3e4f5a6b"

Rate limits

The API limits how many requests a key can make. When you exceed a limit you get 429 Too Many Requests with a Retry-After header (seconds). Retry after that time, with exponential backoff and jitter for repeated 429s. Some endpoints have their own tighter limits; they are listed on each endpoint’s page.