Skip to content

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 checkoutDirect chargePayment linkPlatform
ForA shop or app that knows each order's priceA payer who must stay on your own screenA page people can pay, with no codeA marketplace that runs accounts for its sellers
The payerGoes to a MOOKHPay page and backStays on your page or tillOpens your MOOKHPay addressPays a seller, through you
MethodsMobile money; card and Pay Bill where switched onMobile money, Pay Bill, card (with the card element)Mobile money; card where switched onHosted checkout or direct charge, on behalf of a seller
You needA server and a keyA server, a key with charges:writeA hub accountAn organisation MOOKHPay has switched on as a platform
Start withQuickstartQuickstartPayment linksQuickstart

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 main wallet, 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.

AreaState
Hosted checkouts: create and readAlways on
Hosted page, mobile moneyAlways on
Hosted page, M-Pesa Pay Bill (Kenya)Where the deployment has Pay Bill on
Hosted page, cardWhere the deployment has the card rail on
A secret key per account, with scopes chosen by an OwnerAlways 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
WebhooksAlways on. Hub: API Integrations, Webhooks
Refunds through the API, reviewed by MOOKHPayWhere the deployment has the refund API on. See Refunds
Payment linksAlways on. Made in the hub
Direct charges by mobile money and Pay BillWhere the deployment has direct charges on
Direct charges by card, with the card elementWhere the deployment has card charges on. Production keys only
Platforms: seller accounts, payments with a fee, balances, transactions, business account requestsWhere the deployment has the platform API on, for an organisation MOOKHPay has switched on
Platforms: payouts, login links, account linksEach where the deployment has it on, as well as the platform API
Test paymentsPay Button pk_test_ checkouts, and direct charges from an mkp_test_ key. See Testing

What is not offered ​

Refunding a payment taken through a platformNot offered. Such a payment cannot be refunded through MOOKHPay
Listing checkoutsNot offered. Store the id you get back. Charges can be listed by your reference
A test mode for hosted checkouts from a secret keyNot offered. They are real on every deployment
Card charges on a test keyRefused. Card can be tried only in production
Paying out your own wallet through the APINot offered. Only a platform can pay out, and only a seller's wallet to that seller
A currency fieldNot offered. The currency is the deployment's
One key for both countriesNot offered. Each country has its own deployment and keys

Next ​

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