Errors
Every error carries a machine-readable code and a message written for a human reading it at 2am.
{
"error": {
"code": "insufficient_funds",
"message": "The customer's mobile money wallet does not have enough balance.",
"retryable_by_customer": true
}
}Payment failures
These reach you in the webhook when a charge resolves. (On rails that initiate at create, they can also arrive as a 402 on create — the live Yebeck rail defers initiation, so there they only ever arrive through the webhook.)
| Code | Cause | What to tell the customer |
|---|---|---|
insufficient_funds | Wallet empty. | Top up and try again. |
customer_declined | They rejected the prompt. | Retry if it was a mistake. |
customer_timeout | No response to the prompt. | Resend. |
invalid_number | Not a valid or registered MSISDN. | Check the number. |
wrong_network | The number is not on that network. | Pick the right network. |
limit_exceeded | MNO wallet or transaction cap. | Try a smaller amount. |
provider_unavailable | Gateway or MNO down. | Try again shortly. |
validation_rejected | The gateway rejected the request as invalid. | Check the number and amount, then retry. |
payment_failed | The gateway failed without a more specific reason. | Try again shortly. |
Mobile number portability
wrong_network. Ask the customer which network their MoMo is on rather than guessing from the prefix.Request errors
| Status | Code | Meaning |
|---|---|---|
| 400 | invalid_amount | Not a positive integer. Remember: pesewas. GH₵ 50.00 is 5000. |
| 400 | amount_above_maximum | A single deposit cannot exceed 5,000.00 in the charge currency. |
| 400 | idempotency_key_required | Every mutating request needs one. |
| 400 | invalid_json | The request body is not valid JSON. |
| 400 | phone_required | The account check or the prompt needs a phone number — send one, or create the intent with one. |
| 400 | invalid_network | Network must be MTN, TELECEL or AIRTELTIGO. |
| 401 | missing | No Authorization header. |
| 401 | malformed | The key is not in the sk_/pk_ + test/live + 40-character form. |
| 401 | unknown_key | No such key. |
| 401 | revoked | The key was revoked. |
| 401 | wrong_key_type | You sent a publishable key to an endpoint that moves money. |
| 401 | mode_not_available | Live keys are issued once verification is approved. (The dashboard keys endpoint answers the same situation with 403 live_not_available.) |
| 401 | client_secret_required | Pass ?cs=cs_... in the URL. |
| 402 | otp_invalid | Wrong OTP code. |
| 403 | merchant_suspended | Contact support. |
| 409 | idempotency_key_reuse | Same key, different body. We refuse rather than guess. |
| 409 | request_in_flight | A request with this Idempotency-Key is still being processed. Retry shortly. |
| 409 | duplicate_reference | You already created an intent with this reference. |
| 409 | already_submitted | A prompt is already waiting on the customer's phone. Poll instead — never a second prompt. |
| 410 | checkout_expired | The checkout has expired. Create a new payment and try again. |
| 429 | number_blocked | This number is blockaded after 5 failed payment initiations in a row — 1 hour the first time, 24 hours after that. Wait it out. |
| 429 | payment_in_progress | A payment for this number is already in flight. Wait for it to resolve. |
| 500 | internal_error | Something went wrong on our side. The response carries a request_id — quote it to support; it matches the same id on the server log line. |
| 502 | verification_unavailable | Number verification could not run. Try again later — do not send the prompt until verification approves it. |
| 503 | yebeck_unavailable | Yebeck is not configured, or is not the active gateway. |
| 503 | gateway_unavailable | No payment gateway available. |
More request errors
| Status | Code | Meaning |
|---|---|---|
| 400 | unsupported_currency | Only GHS and NGN are supported. |
| 400 | reference_required | reference is missing. |
| 400 | invalid_method | method is not one of mobile_money, card, bank_transfer, ussd. |
| 400 | invalid_method_for_currency | e.g. mobile_money with NGN, or bank_transfer with GHS. |
| 400 | customer_phone_required | mobile_money needs customer.phone. |
| 400 | bank_code_required | ussd needs bank_code. |
| 400 | invalid_phone | Not a valid MoMo number. |
| 400 | invalid_country | GET /v1/banks needs country=GH or NG. |
| 400 | invalid_input | Refund request missing provider reference or phone. |
| 404 | not_found | No such intent, link, refund or endpoint — or it belongs to another merchant. |
| 404 | refund_not_matched | No succeeded payment matches that reference and number. |
| 405 | method_not_allowed | That method is not supported on this route. |
| 409 | migration_required | A dashboard feature needs a database migration. Contact support. |
| 413 | payload_too_large | Body over the limit. |
| 429 | rate_limited | A payment-link public route over its per-IP limit (120/min read, 12/min pay). |
| 501 | not_configured | The feature is not configured on this deployment. |
| 501 | not_supported | The active gateway does not support that call. |
| 502 | gateway_error | The gateway answered with an error. |
| 400 | amount_too_small | Payout move too small to cover the fee. |
| 400 | insufficient_balance | More than the main balance. |
| 400 | insufficient_payout_balance | More than the payout account holds. |
| 400 | insufficient_float | The Yebeck float cannot cover the net this admin withdrawal would send. Nothing was sent. |
| 503 | float_unavailable | The Yebeck float balance could not be read. Nothing was sent. |
| 503 | balance_unavailable | The live Yebeck balance could not be read. Try again — no figure is shown. |
| 400 | amount_too_large | One withdrawal above GH₵10,000. |
| 400 | destination_required | A destination number (and name, on rails that do not verify) is required. |
| 400 | no_previous_destination | use_last_destination with no previous disbursement. |
| 400 | move_failed | The payout move could not be completed. No money moved. |
| 403 | withdrawals_disabled | Movements are paused platform-wide. |
| 403 | not_active | Verification not approved yet. |
| 410 | withdrawals_replaced | POST /v1/me/payouts is retired — use the payout-account flow. |
There is no per-key rate limit. A 429 from this API is the phone guard above or a payment-link per-IP limit — never a request-count limit on your key.
The unknown status
Not an error. Do not treat it as one.
unknown means a gateway went quiet mid-charge. The customer may or may not have been debited. We poll until we know, and if it is still unclear after a day a person investigates it.Show the customer “we are confirming your payment” and wait for the webhook. If you re-charge on
unknown, you will debit real people twice.Retrying safely
Retry on 5xx with exponential backoff and jitter. Do not retry on 4xx other than the two 429s above: the request is wrong and sending it again will not fix it. A 429 number_blocked means wait out the blockade (1 hour first time, 24 hours after); a 429 payment_in_progress means wait for the in-flight payment to resolve.
const wait = Math.min(1000 * 2 ** attempt, 30000);
await sleep(Math.random() * wait); // jitter, or every
// client retries in unison