Appearance
Changelog
Changes to the merchant API, the payer routes, webhooks and mookhpay.js, newest first. Most features below are switched on per deployment; where one is off, its routes answer 404. GET /balance and GET /balance/transactions are on everywhere. See Environments and Versioning.
25 November 2026
Fix your payout signature
- The signing recipe in these docs was wrong. Create a payout and Pay out sellers said to sign
timestamp + "." + body. MOOKHPay signs and checkstimestamp.METHOD.path.Idempotency-Key.followed by the raw body, wherepathis the request path from/v1/payments/merchant/with no host and no query string. A signature over the timestamp and body alone answers401and code3021. - What to change: build the signed string from the timestamp, the method in capitals (
POST), the path, theIdempotency-Keyyou send, each followed by a., then the body bytes. The test vector is new too. See How to sign a request. - Each signature is accepted once. A retry keeps its
Idempotency-Keyand body and is signed again with a fresh timestamp; resending a signature answers3021. - The same signature, secret and rules protect the new pay-in and payout destination routes.
Pockets and pay-ins
- A platform can have a pocket: a wallet with its name on it, opened inside each connected person's MOOKHPay wallet. MOOKHPay staff set the pocket up; it is available in Kenya. See Pay into your users' pockets.
- Pay-ins:
POST /accounts/:id/transfersmoves money from your platform's main balance into a person's pocket, free, in whole currency units, signed, with anIdempotency-Keyand anexternal_referenceunique across your platform. Each platform has a daily pay-in cap, which starts at0until MOOKHPay sets it. Read pay-ins withGET /accounts/:id/transfersandGET /accounts/:id/transfers/:transfer_id. See The transfer object. - There is no
transfer.*webhook event. A pay-in settles on the call; confirm it from the call's answer, or by reading it. See Confirm a pay-in without a webhook. - In pocket mode,
GET /accounts/:id/balanceandGET /accounts/:id/transactionsshow only your pocket. The balance addspocketandavailable; movements are newest first, withtypetransfer_in,payout,payment_out,moved_inormoved_out, and the person's own moves read "Moved by you". See Balances and dashboards. - In pocket mode, a payout comes out of your pocket, with the fee on top from the pocket, and a failed payout returns to the pocket. A company account's payout is refused with
422and code3037. See Pay out sellers. - The account object adds
pocket(slug,name,status,balance_currency). See The account object.
Payout destination by code
- In pocket mode,
POST /accounts/:id/payout-destinationtexts a six-digit code to a phone, andPOST /accounts/:id/payout-destination/verifysets that number as the pocket's payout destination once you send the code back. Both needpayouts:writeand a signature. A code lasts 10 minutes and allows 5 wrong tries. See Set the payout destination.
Disconnected accounts answer 409
- Where pockets are on, an account whose holder disconnected your platform now answers
409and code3061(PLATFORM_ACCOUNT_DISCONNECTED) on every route that names it, instead of404and code2943. It does not count toward the unknown-id limit. If your code treats only404as "gone", handle4093061too. Seeaccount.disconnected.
Your own balance
GET /balanceandGET /balance/transactionsread the key owner's own wallets:available(main),pockets,total, each wallet, and its movements oldest first. Read-only. They need the newbalance:readscope and are not platform routes. Use them to reconcile your books. See Balances and dashboards.
Fees API
GET /feesanswers what MOOKHPay charges today:payout,topupandcardfees, each a string in minor units. It needs a platform key withaccounts:read,payouts:writeortransfers:write. Payouts are still free. See Fees.
How a payment was paid
payment.succeededandpayment.failedcarrymethod:mpesa,momo,airtel,cardormookhpay, andGET /checkouts/:idcarries it aspayment.method, besidepayment.rail. These fields were already sent but missing from these docs. The hub's test events do not includemethodyet. See the event catalogue and The checkout object.
API keys
- New scopes
transfers:write(pay into pockets; a platform scope, Owner only) andbalance:read(read your own balance; Owner only, not a platform scope). A scope cannot be added to a key: replace the key with one that has every scope you need. See Which scopes a platform key needs. X-Staff-ID,X-Staff-PermissionsandX-Staff-Reauthare refused with400and code3014, like the other identity headers.- The pay-in and payout destination routes check the key afresh on every call, so a revoked key stops at once.
Error codes
- New codes
3060to3067:PLATFORM_BALANCE_INSUFFICIENT,PLATFORM_ACCOUNT_DISCONNECTED,PLATFORM_TRANSFER_CAP_REACHED,PLATFORM_POCKET_NOT_READY,PLATFORM_POCKET_NOT_SET_UP,OTP_INVALID,OTP_EXPIREDandPLATFORM_TRANSFER_NOT_FOUND.3037is also answered on a pocket-mode payout for a company account. - Errors from the pocket routes carry the code's name in
data.error, beside any other data. See Errors.
24 November 2026
Payout fees
- Payouts are free for now. The fee is reported on every payout so a fee can be charged later without a change to the API: it would be taken from the wallet on top of
amount, the phone would still receive exactlyamount, and a payout that fails or is reversed would return it. See Fees. - The payout object has
feeandtotal(amount + fee), integers in minor units likeamount. 2732INSUFFICIENT_BALANCEonPOST /accounts/:id/payoutsnow means the wallet does not holdamountplus the fee. A payout that empties a wallet must leave room for the fee.- A refund paid back to the payer's phone follows the payout fee, free for now. The refund object has
fee:0for a refund to a MOOKHPay balance, to a card or by hand, and whilemethodisnull. - Transfers between MOOKHPay accounts are free. A payer who pays a checkout or charge by mobile money still pays exactly the
amount. openapi.yamladdsfeeandtotaltoPayoutandfeetoRefund.
Breaking: a checkout's Idempotency-Key now compares the body
POST /checkoutswith anIdempotency-Keyit has seen and a different body now answers422and code3015. It used to answer200with the first checkout. The same key and the same body still answer200with the first checkout, as before. If your code reuses a key when an order changes, give the changed order a new key. See Idempotency.- A checkout made before this change has no stored body to compare, so its key keeps answering
200with that checkout whatever the body.
Webhooks
- Every event body has an
id(evt_…), also sent as theX-Mookh-Event-Idheader. It is the same on every retry, every resend and every endpoint of your account that receives the event. Deduplicate on it. See Retries and ordering. - An endpoint's secret can be rotated in the hub with Rotate Secret. For 24 hours both secrets sign each delivery, in one header, newest first:
X-Mookh-Signature: sha256=<new>, sha256=<old>. Split the header on,, trim each part and accept any one match in constant time. A verifier that compares the whole header with one signature will refuse every delivery during a rotation. The samples on Verify signatures are updated. - Resend in the hub's Deliveries sends a delivered or failed delivery again: one attempt, with the same
id. A delivery stillpending(2816), one whose endpoint is off (2817) or one that is gone (2815) cannot be resent. - Delivery history is kept for 30 days and paged in the hub with Load More, where it used to show the latest 50.
- New events
refund.declined(MOOKHPay declined a refund; carriesdecline_reason) andrefund.failed(an attempt to send a refund's money failed and the refund went back for review; carriesattemptandmethod, and can be sent more than once for one refund). Every refund event now also carriescharge_idandstatus. See the event catalogue.
Refunds
POST /refunds,GET /refundsandGET /refunds/:id, with the newrefunds:writescope, which only an Owner can issue. A refund names onecheckout_idorcharge_id, and anamountor nothing for all that is left; a part must be whole currency units. MOOKHPay reviews every refund before money moves. A payment taken through a platform cannot be refunded. See Refunds and Create a refund.- New error codes
2861to2864on these routes. See Errors.
API keys
- An Owner chooses a key's scopes on the hub's Create A Key and Replace Key. Members and Accountants still make
checkoutskeys. - Replace Key keeps the old key working for 24 hours, so you can deploy the new one first. An account holds at most two live keys; replacing again inside the 24 hours ends the older one at once. Revoke ends every live key, within a minute. See API keys and scopes.
- An Owner can set Allowed Addresses for the account's keys in the hub, with their PIN: up to 50 IPv4 or IPv6 addresses or CIDR ranges. A call from any other address answers
403and code3042. A change takes up to 60 seconds. A platform's own list, set by MOOKHPay staff, still applies on platform routes. See Allowed addresses.
Limits
- Rate limits are counted per account, not per key; the charges limit is renamed Charges per account to say so.
- MOOKHPay can raise an account's charges an hour, requests a minute and prompts to one phone from you, until a date if you like, such as the end of an on-sale. Ask with your expected volume and dates. The limit of 5 prompts an hour to one phone across every merchant is never raised. See Raising your limits.
Documentation
- New pages: Refunds, Create a refund, Retrieve a refund, List refunds and The refund object.
- Corrected: the hub does issue scopes other than
checkouts; the pages that said it did not are updated. openapi.yamladds the refund routes and schemas,4223015onPOST /checkouts,4033042on every merchant route, andid,charge_id,status,decline_reason,attemptandmethodon the event schemas.
20 November 2026
Direct charges
POST /charges,GET /charges/:id,GET /charges?reference=andPOST /charges/:id/cancel, with thecharges:writescope. A charge prompts the payer's phone (mobile_money), answers a Pay Bill number to show them (paybill, Kenya), or opens a card payment for the card element (card). See Direct charges and Create a charge.- A charge made with a
mkp_test_key is a test charge, paid only by the test numbers. Pay Bill and card charges are refused on amkp_test_key with400and code3004. - New webhook events
charge.expiredandcharge.cancelled.payment.succeededandpayment.failedfor a charge carrycharge,metadataandfailure. See the event catalogue. - New error codes
3001to3007. See Errors.
Card element
mookhpay.js1.0.0, athttps://mookhpay.co/js/v1/1.0.0/mookhpay.js(pinned, with an SRI hash) andhttps://mookhpay.co/js/v1/mookhpay.js(latest). It takes the card in CyberSource fields on your page, so card data never reaches your server. See Card payments.- Four browser routes under
/v1/payments/public/charges/:id/card, authorised by the charge'sclient_secretand an allowedOrigin. See Card element routes. - The pages allowed to take card payments are a list per account, kept separately for
mkp_live_andmkp_test_charges and saved in the hub under API Integrations, With Code, Card Payment Pages. A page not on the list is refused with403and code2776.
Platforms
- Seller accounts:
POST /accounts,GET /accounts/:idandGET /accounts. See Open seller accounts. - Payments for a seller with a platform fee:
on_behalf_ofandplatform_feeonPOST /checkoutsandPOST /charges. See Take payments with a fee. - Balances and movements:
GET /accounts/:id/balance,GET /accounts/:id/transactionsand the all-accounts feedGET /transactions. See Balances and dashboards. - Payouts:
POST /accounts/:id/payouts, signed with the platform's payout signing secret, plusGET /accounts/:id/payoutsandGET /accounts/:id/payouts/:payout_id. See Pay out sellers. - Login links (
POST /accounts/:id/login-links) open a 30-minute view-only MOOKHPay session for a seller. See Login links. - Account links (
POST /account-links,GET /account-links/:id) ask an existing MOOKHPay user to let your platform in. The link'surlis answered once, on the201; a replay answersurlnull.account.linkedis sent when the owner approves, withdata{ link_id, scopes, approved_at }. See Link an existing account. - Business account requests for sellers:
POST /accounts/:id/org-requests, documents, submit and read. See Business accounts. - New key scopes
charges:write,accounts:read,accounts:write,accounts:link,payments:write,payouts:writeandlogin_links:write. An Owner chooses them on the hub's Create A Key (from 24 November 2026). See API keys and scopes. - New webhook events
account.created,account.linked,account.claimedandaccount.disconnected.account.updatedcan be subscribed to but is not sent yet. - New error codes
2941to2950and3011to3040.
Merchant API, all keys
- A request to
/v1/payments/merchantthat carries a session or identity header, such asX-User-IDorX-Acting-As, is refused with400and code3014.
Documentation
- The guides are regrouped by task: get started, accept payments, platforms, webhooks, going live and API conventions.
- New pages: Quickstart: direct charge, Quickstart: platform, Testing, Card payments, the platform guides, the four webhook pages, Go-live checklist, Security, Pagination, Versioning and the creator marketplace tutorial.
- Every guide step and API page has samples in curl, Node, Python and PHP.
openapi.yamlcovers every merchant route and the public routes a merchant integration uses, including the card element routes. Its paths are now written in full (/v1/payments/merchant/checkouts), with the host alone as the server.- Corrections: a checkout's
referenceis shown to the payer under the amount; a field or header error is answered after the key and scope checks, not before; the payer rate limits are 300 pay attempts and 200 card attempts an hour from one address. - Moved:
/guide/platformsis now /platforms/overview,/guide/webhooksis /webhooks/overview, and/guide/test-numbersis /guide/testing. The old addresses redirect.