Skip to Content
FlowPayDocs

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

StatuserrorMeaning
400invalid_requestA field is invalid: the message names it.
400idempotency_key_requiredThe Idempotency-Key header is missing.
401unauthenticated, invalid_api_keyKey missing, unknown or revoked.
403forbiddenCall refused, for example an IP address outside the allowlist.
403application_not_activeThe application is deactivated.
403read_only_keyRead-only key: it neither creates nor cancels a payment.
403kyc_requiredThe merchant's identity verification is not complete.
404intent_not_foundUnknown payment, or one that belongs to another application.
409idempotency_key_reuseSame idempotency key with a different request.
409duplicate_merchant_referenceThis order reference already exists.
409not_cancelableThe payment can no longer be canceled.
409intent_not_payableThe payment no longer accepts an attempt (direct payment).
409attempt_in_progressAn attempt is already in progress on this payment.
409max_attempts_reachedThe payment has already received three attempts.
410intent_expiredThe payment has expired (direct payment).
413Request body too large.
422invalid_amountUnknown currency, or amount more precise than the currency.
422currency_not_supportedCurrency not supported.
422no_route_availableNo network can process this payment.
422limit_exceededA limit on your account is reached.
422network_not_allowedNetwork not offered for this payment (direct payment).
422invalid_msisdnInvalid phone number (direct payment).
422msisdn_not_allowedThis payment cannot be settled from this number (direct payment).
422otp_requiredThe chosen network requires a code (direct payment).
422return_url_requiredThe chosen network redirects the customer: return_url is required (direct payment).
422invalid_otpInvalid code: 4 to 8 digits (direct payment).
429too_many_requestsToo many requests: see below.
500internal_errorInternal error: contact support with the payment identifier.
503unavailableService 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):

ReasonMeaning
CUSTOMER_DECLINEDThe customer refused or did not approve.
INSUFFICIENT_FUNDSInsufficient balance.
INVALID_MSISDNNumber invalid for this network.
PROVIDER_UNAVAILABLEThe network or its provider was unavailable.
PROVIDER_TIMEOUTThe provider did not answer in time.
ROUTE_REJECTEDThe network refused this payment.
INTERNALInternal error: contact support with the payment identifier.

On this page