Errors
The API's response codes and the reasons a payment fails.
Format
An API error returns an HTTP status and a JSON body:
{
"error": "invalid_request",
"message": "amount: must be strictly positive"
}Always test error, which is stable. message is meant for a human and may change.
Statuses
| Status | error | Meaning |
|---|---|---|
| 400 | invalid_request | A field is invalid: the message names it. |
| 400 | idempotency_key_required | The Idempotency-Key header is missing. |
| 401 | unauthenticated, invalid_api_key | Key missing, unknown or revoked. |
| 403 | forbidden | Call refused, for example an IP address outside the allowlist. |
| 403 | application_not_active | The application is deactivated. |
| 403 | read_only_key | Read-only key: it neither creates nor cancels a payment. |
| 403 | kyc_required | The merchant's identity verification is not complete. |
| 404 | intent_not_found | Unknown payment, or one that belongs to another application. |
| 409 | idempotency_key_reuse | Same idempotency key with a different request. |
| 409 | duplicate_merchant_reference | This order reference already exists. |
| 409 | not_cancelable | The payment can no longer be canceled. |
| 409 | intent_not_payable | The payment no longer accepts an attempt (direct payment). |
| 409 | attempt_in_progress | An attempt is already in progress on this payment. |
| 409 | max_attempts_reached | The payment has already received three attempts. |
| 410 | intent_expired | The payment has expired (direct payment). |
| 413 | Request body too large. | |
| 422 | invalid_amount | Unknown currency, or amount more precise than the currency. |
| 422 | currency_not_supported | Currency not supported. |
| 422 | no_route_available | No network can process this payment. |
| 422 | limit_exceeded | A limit on your account is reached. |
| 422 | network_not_allowed | Network not offered for this payment (direct payment). |
| 422 | invalid_msisdn | Invalid phone number (direct payment). |
| 422 | msisdn_not_allowed | This payment cannot be settled from this number (direct payment). |
| 422 | otp_required | The chosen network requires a code (direct payment). |
| 422 | return_url_required | The chosen network redirects the customer: return_url is required (direct payment). |
| 422 | invalid_otp | Invalid code: 4 to 8 digits (direct payment). |
| 429 | too_many_requests | Too many requests: see below. |
| 500 | internal_error | Internal error: contact support with the payment identifier. |
| 503 | unavailable | Service temporarily unavailable: retry with the same idempotency key. |
Too many requests
Beyond the limit (60 requests per minute per application, see Authentication), the API answers 429 too_many_requests with a Retry-After header, in seconds. Wait that long before retrying.
Retry safely
For a 503, a network drop or a lost response, replay the same request with the same Idempotency-Key: you get the same payment, never a duplicate. See Idempotency.
Do not replay a 4xx as is: it will not change until you fix the request. For a direct payment refused with 422, the payment already exists, except for otp_required and return_url_required: fix it, then replay with the same key. See Direct payment.
Why a payment fails
When a payment fails, the payment.failed webhook and the payment read give a reason (failure_class):
| Reason | Meaning |
|---|---|
CUSTOMER_DECLINED | The customer refused or did not approve. |
INSUFFICIENT_FUNDS | Insufficient balance. |
INVALID_MSISDN | Number invalid for this network. |
PROVIDER_UNAVAILABLE | The network or its provider was unavailable. |
PROVIDER_TIMEOUT | The provider did not answer in time. |
ROUTE_REJECTED | The network refused this payment. |
INTERNAL | Internal error: contact support with the payment identifier. |