Skip to content

Environments ​

Each country is its own deployment, with its own host, currency and keys. A checkout, charge or account exists only on the host that created it.

Hosts ​

CountryCurrencyMobile money railPayments host (staging)
KenyaKESM-Pesahttps://payments-ke-staging.mookhpay.co
UgandaUGXMTN MoMohttps://payments-ug-staging.mookhpay.co

Two prefixes on that host matter to you:

PrefixWho calls itAuth
/v1/payments/merchantYour serverYour secret key. See API keys and scopes
/v1/payments/publicThe payer's browser: the hosted checkout page and the card elementNone, or a charge's client_secret
text
https://payments-ke-staging.mookhpay.co/v1/payments/merchant/checkouts

Production hosts are not listed on this site. The paths are the same in production; only the host changes. Keep the host in configuration, not in code.

Country and currency ​

The country is the country of the deployment that issued your key. A Kenyan key works only on the Kenyan host, and everything it makes is in KES. A Ugandan key works only on the Ugandan host, in UGX.

There is no currency or country field on any request. Do not send one: unknown fields are refused with 400 and code 1701.

Ids carry the country: cs_ke_…, ch_ug_…, acct_ke_…. The hosted checkout page reads the prefix to call the right host.

A platform that serves both countries needs an organisation and a key in each.

Key prefix ​

PrefixIssued by
mkp_test_Staging. Every key staging issues has this prefix
mkp_live_Production. Every key production issues has this prefix

The hub has no Test and Live switch for secret keys. The prefix follows the deployment. It does not grant anything by itself, but payments-service reads it in one place: a direct charge made with an mkp_test_ key is a test charge.

What is real on staging and what is a test ​

Staging moves real money

Staging calls the real M-Pesa and MTN MoMo rails. A hosted checkout for KES 1 made with a secret key prompts a real phone for KES 1, and the money lands in a real wallet.

On staging, with an mkp_test_ keyReal or test
A hosted checkout (POST /checkouts)Real. A secret key's checkouts are never test checkouts, on any deployment. Test with a small amount and your own phone
A direct charge by mobile_moneyTest. Paid only by the four test numbers. No prompt, nothing booked
A direct charge by paybillRefused: 400 and code 3004. Pay Bill is not offered in test mode
A direct charge by cardRefused: 400 and code 3004. Card is never offered in test mode. See Testing
A checkout from a Pay Button pk_test_ keyTest. Paid only by the test numbers
Platform accounts, balances, payouts, login linksReal. An account created on staging is a real MOOKHPay account, and a payout sends real money

In production, an mkp_live_ key makes real checkouts and real charges, and a test number is refused with 422 and code 2838.

Switched on per deployment ​

Some route groups exist only where the deployment switches them on. Where a group is off, its routes are not registered and answer 404.

RoutesSwitched on by
POST /checkouts, GET /checkouts/:idAlways on
/chargesDirect charges on the deployment
card as a charge method, and the card element routesDirect charges and card charges on the deployment, with the card rail on for the country's currency
/accounts, /transactions, business account requestsThe platform API on the deployment
PayoutsThe platform API and platform payouts
Login linksThe platform API and login links
Account linksThe platform API and account links

Platform routes also need your organisation to be switched on as a platform by MOOKHPay. See How platforms work.

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