Skip to content

Errors ​

Every route answers with one envelope, on success and on failure. Branch on the HTTP status first, then on code. Never branch on description: it is written for people and can change.

json
{ "ok": true, "description": "Checkout created", "data": { "id": "cs_ke_4f1c2a9b7e0d3c5a8b6f2e1d" } }
json
{ "ok": false, "description": "Missing, unknown or revoked API key", "data": {}, "code": 2781 }
FieldTypeMeaning
okbooleantrue on success, false on an error
descriptionstringA sentence for logs and people. On some 1701 errors it names the problem, such as line_items must sum to amount or limit is 1 to 100
dataobjectThe payload on success. {} on an error, except on the refusals listed below that carry details
codeintegerErrors only. The number to branch on

Log code and description together for every error. Support will ask for both.

data.error: the code's name ​

Errors from the pocket routes also carry the code's name in data.error, beside any other data the refusal has:

json
{
  "ok": false,
  "description": "Your platform's MOOKHPay balance is too low for this pay-in. Top it up and try again",
  "data": { "error": "PLATFORM_BALANCE_INSUFFICIENT", "available": 250000 },
  "code": 3060
}

data.error is on the errors the pay-in routes (/accounts/:id/transfers…) and the payout destination routes answer themselves, on 3061 from any account route, and on the pocket refusals of the payout, balance and movements routes (3037, 3063 and the errors after them). The checks every route shares never add it, even on those routes: the key, scope and platform checks (2781, 2941, 2942, 3013), the signature (3021, 3022), an unknown account (2943), a schema error (1701) and the per-minute rate limit (1804).

Branch on code. data.error names the same thing, so you can log it, or match on it if you prefer names. Do not branch on description.

Refusals that carry data ​

Most errors have data: {}. These carry more.

CodeHTTPdata
1804, 3005, 3026429{ "retryAfter": <seconds> }, the same number as the Retry-After header. A login link refused by authn-service's hourly count (3026) has no data and no header
3002409{ "charge": "ch_ke_…" }, the charge still pending for that reference
2947, 2948, 3062422{ "cap", "used", "remaining" }, minor units. A field the service could not read is left out
3060422{ "error", "available" }: your main balance in minor units. available is left out if it could not be read
3065422{ "error", "tries_left" }: wrong codes left before the code stops working
1804429On POST /accounts/:id/payout-destination only, for one code a minute per account: { "error", "retry_after" } in seconds. There is no Retry-After header on this one
1701400On the pay-in routes, { "error", "reason" }: amount must be whole currency units (a multiple of 100) or limit is 1 to 100
3040422{ "source": "payout_account" } or { "source": "phone" }, which of the seller's numbers the rail cannot pay
2723, 2779402, 502{ "charge": "ch_ke_…", "failure": { "code", "message" } }, from the card element's charge route
3031409What the request is missing, as authn-service sends it
3032409{ "reason", "username"? }: reason is not_allowed, required, too_many, self or duplicate
3034400 or 413Why the document was refused, as authn-service sends it
2861409{ "reason" }, why the payment cannot be refunded: not_paid, nothing_left, other_refund, platform_payment, test_payment or not_inbound
2863422{ "refundable" }, how much of the payment is left to refund, in minor units

Validation errors do not name the field ​

A request that breaks the route's schema (an unknown field, a missing field, a string that is too long, a missing Idempotency-Key header) answers 400 and code 1701 with the generic description The request contains invalid data. It does not say which field. Check the request against the parameter table on the route's page.

The checks run in this order, which matters when you debug:

  1. A request carrying an identity header is refused first: 400, 3014.
  2. A body that is not valid JSON is refused next: 400, 1701.
  3. Then the key is checked (401, 2781) and the scope (403, 2941).
  4. Only then is the request checked against the schema: 400, 1701.

So a 400 1701 about a field means the key and scope passed. A 401 does not tell you the body was valid.

HTTP status ​

HTTPMeaningWhat to do
200Success, or an idempotent replay of a createUse data
201Created: a checkout, charge, refund, account, link, request or documentUse data
202Accepted: a payout requested, or a card or mobile-money attempt startedWait for the webhook, or read the object
400The request is invalidFix it. The same request fails again
401The key is missing, unknown or revoked; a signed request's signature was refused; or a card element client_secret was refusedFix the key, signature or secret
402A card was declined in the card elementLet the payer try another card
403A scope, a platform switch, an address or an origin is missingSee the code
404Nothing by that id that your key may see, or a route switched off on this deploymentCheck the id and the deployment
409A conflict with the current state, including an account whose holder disconnected your platform (3061)See the code
413A body over the route's size limitSend less
415A body with a content type the route does not take, such as form-encoded instead of JSON. Code 1701. Other 4xx statuses the web framework raises come back the same way, with their own status and 1701Send JSON, or no body
422The amount, rail, balance, a cap, or an Idempotency-Key reused with another bodySee the code
423The seller's wallet is lockedWait for the lock to end
429Over a rate limitWait Retry-After seconds, then retry
500An unexpected error (1802)Retry with the same Idempotency-Key. Report it if it repeats
502The card processor did not give a usable answerSee the code
503A service MOOKHPay depends on did not answerRetry with backoff and the same Idempotency-Key

A route that a deployment has switched off is not registered at all. It answers 404 with the web framework's own body ({ "message", "error", "statusCode" }), not the envelope. Seller accounts and payouts on a platform, pockets (pay-ins and payout destinations), login links, account links, direct charges and the card element routes are each switched on per deployment. GET /balance and GET /balance/transactions are always there.

Keys, scopes and headers ​

These can come from any merchant route.

HTTPCodeNameWhenWhat to do
4003014IDENTITY_HEADER_REFUSEDThe request carries a session or identity header, such as X-User-ID, X-Acting-As, X-Actor-ID, X-Staff-ID, X-Session-Scope, X-Limits-Tier or X-Internal-Secret. See the full listRemove the header. Proxies and SDKs sometimes add them
4001701INVALID_REQUEST_DATAThe body is not JSON, or breaks the route's schemaFix the request
4012781API_KEY_INVALIDNo Authorization: Bearer header, a value that is not mkp_test_ or mkp_live_ and 52 characters from A-Z and 2-7, or an unknown or revoked key, or one replaced more than 24 hours agoCheck the key. A revoked key keeps working for up to 60 seconds on most routes, then stops
4032941API_KEY_SCOPE_REQUIREDThe key does not carry the scope the route needs, or on_behalf_of was sent without payments:writeIssue a key with the scope. See API keys and scopes
4033042API_KEY_IP_NOT_ALLOWEDThe account has allowed addresses and the call came from another addressCall from a listed address, or have an Owner add this one in the hub. A change takes up to 60 seconds
4291804RATE_LIMIT_EXCEEDEDOver a rate limit. See LimitsWait Retry-After seconds
5001802INTERNAL_SERVER_ERRORSomething unexpected failedRetry with the same Idempotency-Key. Report the time and route if it repeats
5032782AUTHN_UNAVAILABLEThe key could not be checkedRetry with backoff

Hosted checkouts ​

POST /checkouts and GET /checkouts/:id.

HTTPCodeNameWhenWhat to do
4001701INVALID_REQUEST_DATAA schema error; line_items must sum to amount; or a return_url that breaks the address rules (the description names the problem)Fix the request
4042783CHECKOUT_NOT_FOUNDNo checkout by that id, or one your key may not readCheck the id. Another merchant's checkout answers the same
4092709WALLET_NOT_PROVISIONEDThe payee's main wallet does not exist yet. A new seller account's wallet is made just after the accountRetry after a few seconds
4222702INVALID_AMOUNTamount is outside the country's mobile-money limits, or not whole units in UgandaSee Limits
4222721COLLECTION_DISABLEDThis deployment takes no mobile-money paymentsContact MOOKHPay
4223015IDEMPOTENCY_KEY_REUSEDThe Idempotency-Key already made a checkout from a different body. Also answered when the stored checkout for this key was made the other way (as a platform for a seller, or for yourself), which does not happen in normal useUse a new key for the new body
5032752LEDGER_UNAVAILABLEThe payee's wallet could not be checkedRetry with the same Idempotency-Key

A checkout's Idempotency-Key compares bodies: the same key and body answer the first checkout with 200, and a different body answers 3015. A checkout made before this changed in November 2026 has no stored body, and its key answers the first checkout whatever the body. See Idempotency.

Payments for a seller ​

POST /checkouts and POST /charges with on_behalf_of or platform_fee.

HTTPCodeNameWhenWhat to do
4001701INVALID_REQUEST_DATAplatform_fee sent without on_behalf_ofSend both, or neither
4003017PLATFORM_FEE_INVALIDamount is not a multiple of 100; platform_fee is not a multiple of 100, over your platform's maximum share, or leaves the seller less than 100. The description says whichFix the amount or fee
4032941API_KEY_SCOPE_REQUIREDThe key lacks payments:writeIssue a key with it
4032942PLATFORM_NOT_ENABLEDYour organisation is not switched on as a platform, or its platform is suspendedContact MOOKHPay
4033013PLATFORM_IP_NOT_ALLOWEDYour platform has an IP allow-list and the request came from another addressCall from a listed address, or ask MOOKHPay to change the list
4042943PLATFORM_ACCOUNT_NOT_FOUNDon_behalf_of is malformed, unknown, another platform's or revokedCheck the id. Each miss is counted
4093018PLATFORM_FEE_WALLET_MISSINGA fee above 0 and your own organisation's main wallet does not existFinish your organisation's setup
4291804RATE_LIMIT_EXCEEDEDYour key sent too many unknown account ids in the hourStop sending unknown ids. See Limits
5032752LEDGER_UNAVAILABLEYour own wallet could not be checkedRetry
5033016PLATFORM_ACCOUNTS_UNAVAILABLEThe account could not be readRetry

Direct charges ​

POST /charges, GET /charges/:id, GET /charges, POST /charges/:id/cancel. A payment that the payer declines is not an error: the charge is created and ends failed with a failure code.

HTTPCodeNameWhenWhat to do
4001701INVALID_REQUEST_DATAA schema error; phone is not a number this rail can prompt; a bad payer_email; payer_email on a paybill charge; bad metadata; cancel takes no body; limit is 1 to 100Fix the request
4003004CHARGE_METHOD_UNAVAILABLEcard on an mkp_test_ key or where cards are off; paybill on a test key or where Pay Bill is offUse another method. Card charges cannot be tested on a test key
4043001CHARGE_NOT_FOUNDNo charge by that id that your key may see. Cancel also answers this for a charge your key did not makeCheck the id
4092709WALLET_NOT_PROVISIONEDThe payee's wallet does not exist yetRetry after a few seconds
4092836CHECKOUT_TEST_MODEA test key, and a phone that is not a test numberUse a test number
4093002CHARGE_REFERENCE_PENDINGA charge for this reference is still pending. data.charge names itWait for it to end, or cancel it, then create a new one
4093003CHARGE_NOT_CANCELLABLEThe charge is not pendingRead the charge. It has already ended
4222701RAIL_NOT_AVAILABLEThis host has no mobile-money rail, or payment_method.rail names another railLeave rail out, or send this host's rail
4222702INVALID_AMOUNTamount is outside the rail's limitsSee Limits
4222721COLLECTION_DISABLEDCollection is off for this railContact MOOKHPay
4222838TEST_NUMBER_LIVEA live key, and a test numberUse a real number
4223015IDEMPOTENCY_KEY_REUSEDThe Idempotency-Key was used with a different bodyUse a new key for a new charge
4293005CHARGE_PROMPT_LIMITToo many prompts to this phone across MOOKHPay, too many to this phone from you, or too many charges from your accountWait Retry-After seconds
5032752LEDGER_UNAVAILABLEThe payee's wallet could not be checkedRetry with the same Idempotency-Key

The seller-payment errors also apply to a charge with on_behalf_of.

Refunds ​

POST /refunds, GET /refunds, GET /refunds/:id. See Refunds.

HTTPCodeNameWhenWhat to do
4001701INVALID_REQUEST_DATAA schema error; both or neither of checkout_id and charge_id; reason over 200 characters; a missing Idempotency-Key; limit is 1 to 100Fix the request
4032941API_KEY_SCOPE_REQUIREDThe key lacks refunds:writeReplace the key with one that has it. Only an Owner can issue it
4042783CHECKOUT_NOT_FOUNDNo checkout by that checkout_id that your key may seeCheck the id
4043001CHARGE_NOT_FOUNDNo charge by that charge_id that your key may seeCheck the id
4042864REFUND_REQUEST_NOT_FOUNDNo refund by that id on your accountCheck the id
4092861REFUND_NOT_ALLOWEDThe payment cannot be refunded. data.reason says why: not_paid, nothing_left, other_refund, platform_payment, test_payment or not_inboundDo not retry. See Refunds
4092862REFUND_ALREADY_OPENA refund of this payment is already waiting for MOOKHPayRead it with GET /refunds?checkout_id=. Ask again once it is decided
4222702INVALID_AMOUNTA part refund that is not whole currency units (a multiple of 100)Send a multiple of 100, or leave amount out to refund all that is left
4222863REFUND_AMOUNT_TOO_HIGHamount is more than is left to refund. data.refundable is what is leftSend data.refundable or less
4223015IDEMPOTENCY_KEY_REUSEDThe Idempotency-Key was used with a different bodyUse a new key for a new refund

Card element routes ​

The routes under /v1/payments/public/charges/:id/card that the card element (mookhpay.js) calls from the payer's browser. Your server never calls them, but the element passes their codes to your page. See Card payments.

HTTPCodeNameWhenWhat to do
4013006CHARGE_CLIENT_SECRET_INVALIDUnknown charge, wrong or missing client_secret, or past the charge's expires_at, all alikeCreate a new charge and pass its client_secret
4022723COLLECTION_DECLINEDThe card was declined. data.failure.code is insufficient_funds, limit_exceeded, rail_unavailable or declined, and data.failure.message is safe to show the payer. The charge stays pendingLet the payer try another card
4032776CARD_ORIGIN_NOT_ALLOWEDThe Origin header is missing, null or not on your Card Payment Pages listAdd the page's origin in the hub. See Card payments
4032772CARD_TOKEN_INVALIDThe card token came from another formReload the element
4032775CARD_SANDBOX_CURRENCY_BLOCKEDCard payments in this currency are not live on this deploymentUse mobile money
4093007CHARGE_NOT_PENDINGThe charge has succeeded, failed, expired or been cancelledStop. Read the charge on your server
4092772CARD_TOKEN_INVALIDNo card attempt is open for this chargeOpen the attempt again (the element does this)
4092778CARD_CONTEXT_EXPIREDThe card form's capture context ran outRefresh the element and have the payer enter the card again
4092777CARD_PAYMENT_IN_VERIFICATIONAnother charge call for this attempt is already runningWait for it. Do not charge again
4092786CHECKOUT_IN_PROGRESSA card payment for this charge is already in flightWait for it to finish
4092707INTENT_FINALIZEDThe attempt has already endedRead the charge
4092773CARD_VERIFICATION_FAILEDCyberSource's answer could not be verified. The payer was not charged twiceRead the charge on your server before letting the payer retry
4092709WALLET_NOT_PROVISIONEDThe payee's wallet does not existRetry later
4092784, 2785CHECKOUT_EXPIRED, CHECKOUT_PAIDThe payment behind the charge has expired or been paidRead the charge
4222771CARD_CURRENCY_NOT_SUPPORTEDCards are not taken in this currencyUse mobile money
4221701INVALID_REQUEST_DATAA charge call the card processor will not takeReload the element
5022774CARD_CAPTURE_CONTEXT_FAILEDThe card form could not be startedRetry once
5022779CARD_CHARGE_FAILEDCyberSource refused the call. data.failure.code is rail_unavailable. Nothing was takenLet the payer try again
5032752LEDGER_UNAVAILABLEThe payee's wallet could not be checkedRetry
4291804RATE_LIMIT_EXCEEDEDToo many calls from this address or for this chargeWait Retry-After seconds

Seller accounts and reads (platforms) ​

POST /accounts, GET /accounts, GET /accounts/:id, GET /accounts/:id/balance, GET /accounts/:id/transactions, GET /transactions. The platform rows in Payments for a seller (2942, 3013, 2943, 1804, 3016) apply to every platform route.

HTTPCodeNameWhenWhat to do
4001701INVALID_REQUEST_DATAA schema error; phone must be a number in this cluster's country; terms.accepted_at must be a real time, not in the future (more than 5 minutes ahead); to must be later than from; limit is 1 to 100Fix the request
4003012PLATFORM_CURSOR_INVALIDA cursor that was edited, came from another platform or account, or does not match the filters sent with itStart the list again without a cursor. See Pagination
4043019PLATFORM_WALLET_NOT_FOUNDThe account holds no wallet by that wallet slug. In pocket mode, any wallet other than your pocket's slugRead the balance for the account's wallets
4093061PLATFORM_ACCOUNT_DISCONNECTEDPocket mode. The account holder disconnected your platform in MOOKHPay. Answered on every route that names the account, instead of 404 2943, and not counted toward the unknown-id limitStop calling for the account. Mark it disconnected. See account.disconnected
4093063PLATFORM_POCKET_NOT_READYPocket mode. The pocket is still being opened, just after the account was made or linkedRetry in a few seconds
4092944PLATFORM_ACCOUNT_EXISTSThe phone already has a MOOKHPay account. Nothing was createdLink the account instead
4092945PLATFORM_REFERENCE_TAKENexternal_reference already names another of your accounts, with a different phone or nameUse the existing account, or a new reference
4093011PLATFORM_USERNAME_TAKENThe username is takenLeave username out, or choose another
4223015IDEMPOTENCY_KEY_REUSEDThe Idempotency-Key was used with a different bodyUse a new key
4292950PLATFORM_DAILY_ACCOUNTS_REACHEDYour platform has created as many accounts as it may today (East Africa Time)Retry tomorrow, or ask MOOKHPay to raise the cap
5032752LEDGER_UNAVAILABLEBalances or wallet movements could not be readRetry
5033020PLATFORM_FEED_UNAVAILABLEThe all-accounts feed is switched off on the ledgerRetry later. If it persists, contact MOOKHPay
5033016PLATFORM_ACCOUNTS_UNAVAILABLEThe account, or in pocket mode its pocket, could not be readRetry

Payouts ​

POST /accounts/:id/payouts, GET /accounts/:id/payouts, GET /accounts/:id/payouts/:payout_id. A payout refused after it was recorded (2732, 2726, 2751, 2948, a failed approval filing) replays its refusal: the same Idempotency-Key and body answer the same code again. Other refusals are worked out again on each attempt.

HTTPCodeNameWhenWhat to do
4001701INVALID_REQUEST_DATAA schema error; amount must be whole currency units (a multiple of 100); the body is not JSONFix the body
4003012PLATFORM_CURSOR_INVALIDstarting_after is not one of this account's payouts, or on GET /refunds not one of its refundsUse an id from the previous page
4013021PAYOUT_SIGNATURE_INVALIDX-Mookh-Timestamp or X-Mookh-Signature missing or malformed, the signature does not match, the signature was already used once, or the timestamp is more than 300 seconds from MOOKHPay's clock. The same on every signed routeSign the timestamp, method, path, Idempotency-Key and the exact body bytes, with a fresh timestamp on every attempt. See How to sign a request
4033022PAYOUT_SIGNING_SECRET_MISSINGYour platform has no payout signing secret. The same on every signed routeAn Owner makes one in the hub
4033025PLATFORM_GRANT_SCOPE_MISSINGThe account holder did not give your platform payouts:writeAsk them to link again with that scope
4093061PLATFORM_ACCOUNT_DISCONNECTEDPocket mode. The account holder disconnected your platformStop paying out to the account
4093063PLATFORM_POCKET_NOT_READYPocket mode. The pocket is still being openedRetry in a few seconds, with the same key and a fresh signature
4043023PLATFORM_PAYOUT_NOT_FOUNDNo such payout on this account for your platformCheck both ids
4222701RAIL_NOT_AVAILABLEThe payout rail is not available on this hostContact MOOKHPay
4222702INVALID_AMOUNTamount is outside the payout rail's limitsSee Limits
4222731DISBURSEMENT_DISABLEDPayouts are switched off on this hostContact MOOKHPay
4222732INSUFFICIENT_BALANCEThe seller's main wallet, or in pocket mode your pocket, does not hold the amount plus the payout fee. See FeesRead the balance first
4223037PLATFORM_COMPANY_ACCOUNTS_OFFPocket mode, and the account is a company. A company's payouts are not paid from a pocket todayNothing in the request can change it
4222751LEDGER_BOOKING_FAILEDThe ledger refused to reserve the money for another reasonRead the account. Retry later with a new key
4222947PLATFORM_PAYOUT_CAP_REACHEDThe payout would pass your platform's daily payout cap. data is { cap, used, remaining }Wait for the next day (East Africa Time), or send remaining or less
4222948PLATFORM_ACCOUNT_LIMIT_REACHEDThe payout would pass the account's daily limit on money out. data is { cap, used, remaining }Wait, or have the seller pass the identity check
4223040PLATFORM_PAYOUT_DESTINATION_INVALIDThe seller's payout account or phone is not a number the rail can pay. data is { source }, payout_account or phoneAsk the seller to change it in MOOKHPay; nothing in the request can
4222949PLATFORM_PAYOUT_NO_DESTINATIONThe seller has no payout account and no phoneAsk the seller to choose a payout account in MOOKHPay
4223015IDEMPOTENCY_KEY_REUSEDThe Idempotency-Key was used with a different amount or remarkUse a new key
4232726POCKET_LOCKEDThe seller's wallet is lockedWait until the lock ends
5033016PLATFORM_ACCOUNTS_UNAVAILABLEThe seller's payout details could not be readRetry with the same key and a fresh signature

A payout for a company account is filed for its owners' signatures. If MOOKHPay cannot file it, the payout is refused with the code the approval service gives, and that refusal is replayed like any other.

Pay-ins and payout destinations (pockets) ​

POST /accounts/:id/transfers, GET /accounts/:id/transfers, GET /accounts/:id/transfers/:transfer_id, POST /accounts/:id/payout-destination and POST /accounts/:id/payout-destination/verify. The errors these routes answer themselves carry data.error; the shared checks (key, scope, platform, signature, unknown account, schema, per-minute rate limit) do not. See Pay into your users' pockets.

A pay-in refused for your balance (3060) is recorded: the same Idempotency-Key and body answer 3060 again. Its external_reference is used up too. Top up, then send the pay-in with a new key and a new external_reference.

HTTPCodeNameWhenWhat to do
4001701INVALID_REQUEST_DATAA schema error; a missing Idempotency-Key; amount not whole currency units (data.reason says so); limit outside 1 to 100Fix the request
4003012PLATFORM_CURSOR_INVALIDstarting_after is not one of this account's pay-insUse a transfer_id from the previous page
4013021PAYOUT_SIGNATURE_INVALIDThe signature was refused, as for payoutsSee How to sign a request
4032941API_KEY_SCOPE_REQUIREDA pay-in without transfers:write; a pay-in read without transfers:write or accounts:read; a payout destination call without payouts:writeReplace the key with one that has the scope
4033022PAYOUT_SIGNING_SECRET_MISSINGYour platform has no signing secretAn Owner makes one in the hub
4042943PLATFORM_ACCOUNT_NOT_FOUNDThe account is unknown, another platform's or malformedCheck the id. Each miss is counted
4043067PLATFORM_TRANSFER_NOT_FOUNDNo pay-in by that id on this account for your platformCheck both ids
4093061PLATFORM_ACCOUNT_DISCONNECTEDThe account holder disconnected your platformStop paying in. The money already in the pocket stays theirs
4093063PLATFORM_POCKET_NOT_READYThe pocket is still being openedRetry in a few seconds, with the same key and a fresh signature
4092945PLATFORM_REFERENCE_TAKENexternal_reference already names another of your pay-insUse the pay-in you already made, or a new reference
4223060PLATFORM_BALANCE_INSUFFICIENTYour main balance does not hold amount. data.available is your main balanceTop up your main balance, then send with a new key and a new external_reference
4223062PLATFORM_TRANSFER_CAP_REACHEDThe pay-in would pass your platform's daily pay-in cap (East Africa Time). data is { cap, used, remaining }. A cap of 0 means MOOKHPay has not set one yet, and every pay-in is refusedSend remaining or less, wait for the next day, or ask MOOKHPay
4223064PLATFORM_POCKET_NOT_SET_UPYour platform has no pocket set up by MOOKHPayAsk MOOKHPay to set up your pocket
4223040PLATFORM_PAYOUT_DESTINATION_INVALIDPayout destination: rail is not this country's (mpesa in Kenya), or phone is not a number the rail can paySend this country's rail and a number it can pay
4223065OTP_INVALIDWrong code. data.tries_left says how many are leftAsk the person for the code again
4223066OTP_EXPIREDThe code is more than 10 minutes old, has been used, was entered wrong 5 times, or verification_id is unknownStart again with POST /accounts/:id/payout-destination
4223015IDEMPOTENCY_KEY_REUSEDA pay-in's Idempotency-Key used with a different body or accountUse a new key
4291804RATE_LIMIT_EXCEEDEDOver 120 pay-ins a minute, or 30 payout destination calls a minute, per platform; or a second code for the same account inside a minute (data.retry_after)Wait, then retry
5033016PLATFORM_ACCOUNTS_UNAVAILABLEThe pocket could not be read, or a pay-in could not be booked yet. A pay-in left unbooked reads processingRetry with the same Idempotency-Key, the same body and a fresh signature. The retry books it once
5032741PROVIDER_UNAVAILABLEThe code could not be texted. Nothing was savedRetry

Your own balance ​

GET /balance and GET /balance/transactions, with balance:read. See Retrieve your balance.

HTTPCodeNameWhenWhat to do
4001701INVALID_REQUEST_DATAlimit is 1 to 100; to must be later than from; a bad date or an unknown parameterFix the query
4003012PLATFORM_CURSOR_INVALIDAn edited cursor, or one sent with different filtersStart again without a cursor
4032941API_KEY_SCOPE_REQUIREDThe key lacks balance:readReplace the key with one that has it. Only an Owner can issue it
4043019PLATFORM_WALLET_NOT_FOUNDYou hold no wallet by that wallet slugRead GET /balance for your wallets
5032752LEDGER_UNAVAILABLEThe ledger did not answerRetry with backoff

GET /fees refuses only with the key checks: 403 2941 for a key without accounts:read, payouts:write or transfers:write, and 403 2942 or 3013 like any platform route. See Fees.

HTTPCodeNameWhenWhat to do
4001701INVALID_REQUEST_DATAa login link takes no body; phone must be a number in this cluster's country; a scope your platform may not ask forFix the request
4033025PLATFORM_GRANT_SCOPE_MISSINGThe account holder did not give your platform login_links:writeAsk them to link again with that scope
4042943PLATFORM_ACCOUNT_NOT_FOUNDAlso answered for a business account, and for an account that is closed, banned or disabledLogin links are for a person's open account
4043027ACCOUNT_LINK_NOT_FOUNDNo account link by that id for your platformCheck the id
4223015IDEMPOTENCY_KEY_REUSEDAn account link's Idempotency-Key used with a different phone or scopesUse a new key
4293026LOGIN_LINK_LIMIT_REACHEDToo many login links from your key in a minute, or for this account in an hourMake the link only when the seller taps the button

Business account requests ​

HTTPCodeNameWhenWhat to do
4001701INVALID_REQUEST_DATAA schema error; a document upload that is not multipart/form-data with exactly the fields type and file; submit takes no bodyFix the request
4003038PLATFORM_TERMS_REQUIREDMOOKHPay holds no terms attestation for this account, so terms is neededSend terms
400 or 4133034ORG_REQUEST_DOCUMENT_REJECTEDThe file was not accepted; 413 when it is over 10 MB. data says whySend one PDF, JPEG or PNG of 10 MB or less
4033037PLATFORM_COMPANY_ACCOUNTS_OFFA company request, and your platform is not switched on for companiesAsk MOOKHPay, or ask for a sole proprietorship
4043028ORG_REQUEST_NOT_FOUNDNo such request on this account for your platformCheck both ids
4093029ORG_REQUEST_ALREADY_OPENThe seller already has a different request openRead the open request
4093030ORG_REQUEST_USERNAME_TAKENThe business username is takenChoose another
4093031ORG_REQUEST_MISSING_DOCUMENTSSubmitted with documents still missing. data lists themAttach them, then submit
4093032ORG_REQUEST_BAD_DIRECTORA director cannot be named. data says whyFix the directors
4093033ORG_REQUEST_WRONG_STATEThe request cannot be changed or sent in its current stateRead the request
4093035PLATFORM_ACCOUNT_UNCLAIMEDThe seller has not claimed their accountWait for account.claimed
4093036PLATFORM_ACCOUNT_NOT_A_PERSONThe account is a business, not a personAsk for the person's account
4223015IDEMPOTENCY_KEY_REUSEDThe Idempotency-Key used with a different bodyUse a new key

Keys and webhooks in the hub ​

These come from the hub's own routes, not from a merchant route. The hub words them for you; they are listed so a code in a support conversation can be placed.

HTTPCodeNameWhenWhat to do
4002763API_KEY_ALLOWLIST_ENTRY_INVALIDAn entry on Allowed Addresses is not an IPv4 or IPv6 address or a CIDR range. Nothing was savedFix the entry
4032601OWNER_ONLYSomeone other than an Owner tried to set allowed addresses, or to replace or revoke a key with a scope beyond checkoutsAsk an Owner
4042815WEBHOOK_DELIVERY_NOT_FOUNDResend on a delivery that does not exist, or is older than 30 days and was removedRecover by reading the object. See Retries and ordering
4092816WEBHOOK_DELIVERY_PENDINGResend on a delivery that is still pendingWait for it to be delivered or fail. Its retries are still running
4092817WEBHOOK_ENDPOINT_INACTIVEResend on a delivery whose endpoint is switched offSwitch the endpoint on, then resend

Payer routes ​

The hosted checkout page calls /v1/payments/public/checkouts/:id, …/pay and …/card. These are the payer's errors, not your server's. Your server still confirms with GET /checkouts/:id.

HTTPCodeNameWhen
4001701INVALID_REQUEST_DATAA phone the rail cannot prompt, or a bad payer_email
4032776CARD_ORIGIN_NOT_ALLOWEDThe card form was asked for from a page MOOKHPay does not serve
4032775CARD_SANDBOX_CURRENCY_BLOCKEDCards in this currency are not live here
4042783CHECKOUT_NOT_FOUNDNo checkout by that id, or its payee can no longer be paid
4092784CHECKOUT_EXPIREDThe checkout has expired
4092785CHECKOUT_PAIDThe checkout has been paid
4092786CHECKOUT_IN_PROGRESSA card payment is already in flight
4092836CHECKOUT_TEST_MODEA test checkout and a number that is not a test number, or a card on a test checkout
4092851CHECKOUT_CARD_ONLYA card top-up paid by mobile money
4092946PLATFORM_BALANCE_PAY_UNAVAILABLEA checkout taken through a platform paid from a MOOKHPay balance
4092709WALLET_NOT_PROVISIONEDThe payee's wallet does not exist
4222701, 2702, 2721RAIL_NOT_AVAILABLE, INVALID_AMOUNT, COLLECTION_DISABLEDThe rail cannot take this payment
4222838TEST_NUMBER_LIVEA test number on a real checkout
4222771CARD_CURRENCY_NOT_SUPPORTEDNo card payments in this currency
422, 5032854, 2853FX_NOT_OFFERED, FX_RATE_UNAVAILABLEPaying a card in another currency is not offered, or has no current rate
5022774CARD_CAPTURE_CONTEXT_FAILEDThe card form could not be started
5032752LEDGER_UNAVAILABLEThe payee's wallet could not be checked
4291804RATE_LIMIT_EXCEEDEDToo many attempts for this phone, checkout or address

Charge failure codes ​

Not HTTP errors. A charge that ends failed (mobile money), or a card charge that expires after a decline, carries failure: { code, message }. The same object is on payment.failed as failure when the payment was a charge. message is safe to show the payer.

failure.codeMessageTypical cause
payer_cancelledThe payer cancelled the promptM-Pesa result 1032; MoMo APPROVAL_REJECTED, TRANSACTION_CANCELED
insufficient_fundsThe payer did not have enough money for this paymentM-Pesa 1; MoMo NOT_ENOUGH_FUNDS; card INSUFFICIENT_FUND
wrong_pinThe payer entered a wrong PINM-Pesa 2001, 8006
prompt_timed_outThe prompt was not answered in timeM-Pesa 1019; MoMo EXPIRED
phone_unreachableThe payer's phone could not be reachedM-Pesa 1001, 1037; MoMo PAYER_NOT_FOUND
limit_exceededThe payment is over a limit on the payer's accountM-Pesa 2–5, 8; MoMo payer or payee limits; card EXCEEDS_CREDIT_LIMIT
rail_unavailableThe payment network could not take the paymentM-Pesa 17, 26, 1025, 9999; MoMo service errors; card processor or issuer unavailable
declinedThe payment was declinedEvery other decline, and any result MOOKHPay does not recognise

On a test charge the test numbers give insufficient_funds, prompt_timed_out and payer_cancelled.

Payout failure codes ​

Not HTTP errors. A payout that ends failed carries failure: { code, message } on the payout and on the platform's payout.failed. The money is back in the seller's wallet in every case.

failure.codeMessage
rail_unavailableThe payment network could not send the payout. The money is back in the wallet
recipient_unreachableThe number cannot receive this payout. The money is back in the wallet
limit_exceededThe payout is over a limit on the network. The money is back in the wallet
declinedThe payout was declined. The money is back in the wallet

A payout that was never handed to the rail fails as rail_unavailable. A result MOOKHPay does not recognise is declined.

Retry or not ​

ResultWhat to do
Network error, timeout, 500, 503Retry with the same body and the same Idempotency-Key, with backoff. Sign a payout, pay-in or payout destination call again with a fresh timestamp
429Wait Retry-After seconds, then retry with the same key
409 2709, 409 3063Retry after a few seconds
409 3061Stop. The account holder disconnected your platform
409 3002Wait for the pending charge to end or cancel it, then create a new charge with a new key
Any other 4xxChange the request. The same request fails the same way

See Idempotency for how retries are matched to the first request.

Staging documentation. A checkout made with a secret key on staging charges a real phone. See Environments.