Appearance
Limits and rate limits
Every amount is an integer in minor units: 100 is 1.00 and 15000000 is 150,000.00. Ugandan shillings have no sub-unit, so a UGX amount is still sent in minor units and must be a multiple of 100.
Amounts
Payments in
A hosted checkout and a direct charge are checked against the country's mobile-money rail when they are created, whatever method the payer later uses.
Kenya (KES, M-Pesa) | Uganda (UGX, MTN MoMo) | |
|---|---|---|
| Minimum | 1.00 (100) | 1.00 (100) |
| Maximum | 150,000.00 (15000000) | 5,000,000.00 (500000000) |
| Whole units only | No | Yes. A multiple of 100 |
Outside those limits the create answers 422 and code 2702. The Uganda limits are placeholders in the code until MTN's commercial limits are confirmed.
A payment taken for a seller with on_behalf_of must be whole units in both countries: a multiple of 100. Otherwise 400 and code 3017.
Cards
- The card fee is added on top for the payer. You and the seller receive the checkout or charge
amount. A charge shows the fee and the total innext_action.feeandnext_action.total; the hosted page shows them ascard.feeandcard.total. - Card payments are meant to be whole units. The create call does not check this for a card: a
KESamount that is not a multiple of100is accepted. Send a multiple of100for any payment a payer may pay by card. - The card rail's own ceiling (1,000,000.00) is higher than the mobile-money maximum, but the create call applies the mobile-money maximum, so 150,000.00 is the most a Kenyan card payment can be.
Payouts
A platform payout must be whole units (a multiple of 100, else 400 and code 1701) and inside the payout rail's limits (else 422 and code 2702).
| Kenya (M-Pesa) | Uganda (MTN MoMo) | |
|---|---|---|
| Minimum | 10.01 by the rail, so 11.00 (1100) in whole units | 500 (50000) |
| Maximum | 150,000.00 (15000000) | 5,000,000 (500000000) |
Field limits
| Field | Limit |
|---|---|
amount | Integer, at least 1. Charges: at most 100000000000 before the rail check |
reference | 1 to 64 characters. Required on a charge, optional on a checkout |
description | 1 to 140 characters. The payer sees it |
return_url | 1 to 2048 characters, https |
line_items | 1 to 50. Each description 1 to 140 characters, amount at least 1, quantity 1 to 999. They must add up to amount |
Checkout phone | 9 to 15 digits with the country code, no + |
Charge payment_method.phone | 9 to 15 digits with the country code, + optional, and a number the rail can prompt |
payer_email | Up to 254 characters |
Charge metadata | Up to 20 keys of 1 to 40 characters, string values up to 500 characters |
Idempotency-Key | 1 to 128 characters |
Account external_reference | 1 to 100 printable ASCII characters, no spaces |
Account username | 3 to 50 characters: a-z, 0-9, _ |
Account first_name, last_name | 1 to 100 characters, not only spaces |
Payout remarks | 1 to 100 printable ASCII characters |
| Request body | 1 MiB on every route but document uploads, which take up to 10 MiB and 64 KiB |
| Business account documents | One PDF, JPEG or PNG of at most 10 MB per call, at most 10 on a request |
| Business account directors | At most 20 |
Unknown fields are refused with 400 and code 1701 on every create.
Rate limits
Limits are counted in buckets. A bucket is shared by every route that names it, so two routes in one bucket spend one budget. Over a bucket the API answers 429, sets Retry-After to the seconds left, and puts the same number in data.retryAfter.
Your server's buckets are keyed on the account that owns the key, not on the key or your IP address. Replacing a key does not reset them.
| Bucket | Routes | Limit | Code |
|---|---|---|---|
| Merchant | POST /checkouts, GET /checkouts/:id, GET /charges/:id, GET /charges, POST /charges/:id/cancel | 120 a minute | 1804 |
| Charges per account | POST /charges | 300 an hour by default, counted across every key the account holds | 3005 |
| Prompts per phone | POST /charges with mobile_money | 5 an hour to one phone, counted across every merchant and the hosted page. A test number is counted per merchant instead, so other developers' tests do not use your budget | 3005 |
| Prompts per phone from you | POST /charges with mobile_money | 3 an hour to one phone from your account by default | 3005 |
| Refunds | POST /refunds, GET /refunds, GET /refunds/:id | 120 a minute | 1804 |
| Platform | POST /accounts, GET /accounts, GET /accounts/:id, GET /accounts/:id/balance, GET /accounts/:id/transactions, GET /transactions, POST /account-links, GET /account-links/:id, every business account request route, GET /accounts/:id/payouts, GET /accounts/:id/payouts/:payout_id | 120 a minute | 1804 |
| Payout requests | POST /accounts/:id/payouts | 60 a minute | 1804 |
| Login links per key | POST /accounts/:id/login-links | 30 a minute by default | 3026 |
Checkouts and charge reads share one budget. A checkout-heavy integration that also polls charges can run out of both at once.
MOOKHPay can change the defaults marked "by default" per deployment, and a deployment can switch rate limiting off altogether (RATE_LIMIT_ENABLED=false). Production has it on. Do not rely on any limit being absent. MOOKHPay can also raise some of them for your account alone; see Raising your limits.
Raising your limits
The limits above are per account. Two keys on one account, such as a key and the one it replaced, share one budget, and replacing a key does not reset it.
If you expect more than the defaults, for example a ticket on-sale, ask MOOKHPay before it happens. Say which account, the volume you expect (charges an hour, requests a minute, prompts to one buyer's phone), and the dates it starts and ends. MOOKHPay staff can set higher values for your account alone:
| Limit | Default | Can be raised |
|---|---|---|
| Charges per account | 300 an hour | Yes |
| Requests a minute, on every bucket that allows 120 a minute | 120 a minute | Yes. One value applies to each of those buckets |
| Prompts per phone from you | 3 an hour to one phone | Yes, up to the 5 an hour across every merchant |
| Prompts per phone, across every merchant | 5 an hour to one phone | No. It protects payers from being prompted by everyone at once, and is never raised |
A raised limit can run until a date MOOKHPay sets, at most a year ahead, such as the end of an on-sale. After that date your account is back on the defaults with nothing for you to do. A raise takes effect within 60 seconds of MOOKHPay saving it.
Polling within the limits
- Poll a pending charge every 2 seconds and stop at
next_action.expires_at. One charge polled that way uses about 30 requests a minute of the merchant bucket. - Confirm a checkout when the payer comes back to your
return_url. For orders where the payer never came back, poll every 10 to 30 seconds, or rely on the webhook. - Prefer webhooks to polling for anything you watch for more than a minute.
Platforms
| Limit | Value | When it is reached |
|---|---|---|
| Accounts created a day | Set per platform by MOOKHPay, counted on East Africa Time | 429, code 2950 |
| Unknown account ids | 100 an hour per platform by default. Every lookup of an id that is malformed, unknown, another platform's or revoked counts | Every account lookup answers 429, code 1804, until the hour from the first miss is up |
| Platform fee | At most a share of amount set per platform by MOOKHPay, and it must leave the seller at least 100 | 400, code 3017 |
| Payouts a day | A total set per platform by MOOKHPay, counted on East Africa Time | 422, code 2947, with data.cap, used, remaining |
| Money out of an account you created, before its identity check passes | One daily cap for every such account, when MOOKHPay switches it on, counted on East Africa Time across sends, withdrawals and payouts. Moves between the seller's own wallets do not count | 422, code 2948, with data.cap, used, remaining |
| Login links your platform makes for one account | 10 an hour by default, counted per platform and account; another platform's links do not count | 429, code 3026 |
| IP allow-list | Optional, set by MOOKHPay staff | 403, code 3013 |
A linked account, and an account you created whose identity check has passed, has no platform cap on money out. Its own MOOKHPay limits apply.
Payer limits
These are on the hosted page and the card element, not on your key. They protect payers from being prompted repeatedly.
| Route | Limit |
|---|---|
GET /v1/payments/public/checkouts/:id | 120 a minute per IP address |
POST …/checkouts/:id/pay | 5 an hour to one phone (shared with direct charges), 20 an hour per checkout, 300 an hour per IP address |
POST …/checkouts/:id/card | 10 an hour per checkout, 200 an hour per IP address |
POST …/charges/:id/card | 200 an hour per IP address (shared with the hosted card route), 10 an hour per charge |
POST …/charges/:id/card/payer-auth, …/charge, …/refresh | 30 a minute per IP address, and 60 an hour per charge for each route |
Expiry
| Object | Life |
|---|---|
| Hosted checkout | 30 minutes by default. Read expires_at |
| Mobile-money charge | The prompt's 5 minutes and a 60-second grace: 6 minutes by default. Read expires_at |
| Pay Bill charge | 30 minutes by default |
Card charge and its client_secret | 30 minutes by default, or until the charge leaves pending |
| Card element capture context | 15 minutes. The element refreshes it |
| A charge that expired but is then paid | Still booked if the payment arrives within 7 days: it moves to succeeded and payment.succeeded is sent |
| Login link | One use, within 60 seconds. The session it opens lasts 30 minutes |
| Account link | 30 minutes |
| Payout signing secret, after it is replaced | The old one keeps signing for 24 hours |
| Payout signature timestamp | Within 300 seconds of MOOKHPay's clock |
| API key after it is replaced | Keeps working for 24 hours. Replacing again inside that time ends it at once |
| Webhook signing secret after it is rotated | The old one keeps signing for 24 hours, alongside the new one |
| Webhook delivery history | 30 days after the delivery was first sent |
| API key result cache, and the account's allowed addresses | 60 seconds |
List sizes
Every list takes limit from 1 to 100 and defaults to 20. See Pagination.
Keys and endpoints
| Limit | |
|---|---|
| Secret keys | One current key per account, plus the key it replaced for 24 hours. A platform needs an organisation and a key in each country |
| Allowed addresses | 50 per account, each an address or a CIDR range. 10 saves an hour |
| Key issues | 10 an hour per account, in the hub |
| Webhook endpoints | 5 per account |
| Webhook test sends | 20 an hour |
| Webhook secret rotations | 10 an hour per account |
| Webhook resends | 30 an hour per account, and 1 a minute for one delivery |
| Card element origins | 10 per mode |