Appearance
Overview
MOOKHPay takes payments into a MOOKHPay wallet in Kenya (KES, M-Pesa) and Uganda (UGX, MTN MoMo). Your server talks to it with a secret key; the payer pays by mobile money, by card, or in Kenya from the M-Pesa Pay Bill menu.
There are four ways to use it. Pick by where the payer is and what your server knows.
| Hosted checkout | Direct charge | Payment link | Platform | |
|---|---|---|---|---|
| For | A shop or app that knows each order's price | A payer who must stay on your own screen | A page people can pay, with no code | A marketplace that runs accounts for its sellers |
| The payer | Goes to a MOOKHPay page and back | Stays on your page or till | Opens your MOOKHPay address | Pays a seller, through you |
| Methods | Mobile money; card and Pay Bill where switched on | Mobile money, Pay Bill, card (with the card element) | Mobile money; card where switched on | Hosted checkout or direct charge, on behalf of a seller |
| You need | A server and a key | A server, a key with charges:write | A hub account | An organisation MOOKHPay has switched on as a platform |
| Start with | Quickstart | Quickstart | Payment links | Quickstart |
Taking payments for your own business needs only a hosted checkout or a direct charge. The platform routes (seller accounts, payouts to sellers, login links and account links) are for a marketplace that opens a separate MOOKHPay account for each seller; see Do you need the platform API?.
How a hosted checkout works
Three rules hold for every product:
- Your server decides the amount and creates the payment. The browser never holds the secret key or sends the amount.
- A redirect is a hint. Confirm with a read (
GET /checkouts/:id,GET /charges/:id) or a verified webhook before you fulfil. See Confirming payments. - Money goes to the account that owns the key, into its
mainwallet, unless a platform pays a seller on their behalf.
What is available
Some features are switched on per deployment. Where one is off, its routes answer 404. See Environments.
| Area | State |
|---|---|
| Hosted checkouts: create and read | Always on |
| Hosted page, mobile money | Always on |
| Hosted page, M-Pesa Pay Bill (Kenya) | Where the deployment has Pay Bill on |
| Hosted page, card | Where the deployment has the card rail on |
| A secret key per account, with scopes chosen by an Owner | Always on. Hub: API Integrations, API Keys, Secret Key. A replaced key works for 24 hours more, and an Owner can limit keys to allowed addresses |
| Webhooks | Always on. Hub: API Integrations, Webhooks |
| Refunds through the API, reviewed by MOOKHPay | Where the deployment has the refund API on. See Refunds |
| Payment links | Always on. Made in the hub |
| Direct charges by mobile money and Pay Bill | Where the deployment has direct charges on |
| Direct charges by card, with the card element | Where the deployment has card charges on. Production keys only |
| Platforms: seller accounts, payments with a fee, balances, transactions, business account requests | Where the deployment has the platform API on, for an organisation MOOKHPay has switched on |
| Platforms: payouts, login links, account links | Each where the deployment has it on, as well as the platform API |
| Test payments | Pay Button pk_test_ checkouts, and direct charges from an mkp_test_ key. See Testing |
What is not offered
| Refunding a payment taken through a platform | Not offered. Such a payment cannot be refunded through MOOKHPay |
| Listing checkouts | Not offered. Store the id you get back. Charges can be listed by your reference |
| A test mode for hosted checkouts from a secret key | Not offered. They are real on every deployment |
| Card charges on a test key | Refused. Card can be tried only in production |
| Paying out your own wallet through the API | Not offered. Only a platform can pay out, and only a seller's wallet to that seller |
A currency field | Not offered. The currency is the deployment's |
| One key for both countries | Not offered. Each country has its own deployment and keys |
Next
- Quickstart: hosted checkout
- Quickstart: direct charge
- Quickstart: platform
- Kahawa, a small shop on Cloudflare Pages
- A creator marketplace, built on the platform API