Appearance
Retrieve your balance
Reads your own account's balance: its main wallet and its own pockets, as the ledger has them now. Use it to reconcile your books with MOOKHPay, for example every night.
This is the balance of the account that owns the key. A platform's main balance is here: the customer payments it took and has not paid in yet. The pockets your platform opened in other people's wallets are not; read those with Retrieve an account's balance.
It reads only. Nothing on this route moves money.
Endpoint
GET /v1/payments/merchant/balance| Auth | Secret key, Authorization: Bearer mkp_… |
| Scope | balance:read. Only an Owner can add it to a key, and no key has it unless an Owner chose it |
| Platform | Not needed. Any account's key can have balance:read: a business, a platform, or a person's own account |
| Switched on | On every host |
Headers
| Header | Required | Value |
|---|---|---|
Authorization | Yes | Bearer mkp_test_… or Bearer mkp_live_… |
There are no parameters.
Example request
sh
curl https://payments-ke-staging.mookhpay.co/v1/payments/merchant/balance \
-H "Authorization: Bearer $MOOKHPAY_SECRET_KEY"js
const BASE = "https://payments-ke-staging.mookhpay.co/v1/payments/merchant";
const res = await fetch(`${BASE}/balance`, {
headers: { Authorization: `Bearer ${process.env.MOOKHPAY_SECRET_KEY}` },
});
const answer = await res.json();
if (!answer.ok) throw new Error(`${res.status} ${answer.code}: ${answer.description}`);
const { currency, available, as_of } = answer.data;
console.log(`${currency} ${(available / 100).toFixed(2)} in main at ${as_of}`);Response
200 OK with description Balance.
json
{
"ok": true,
"description": "Balance",
"data": {
"currency": "KES",
"available": 48250000,
"pockets": 1500000,
"total": 49750000,
"wallets": [
{ "wallet": "main", "name": "Main", "balance": 48250000 },
{ "wallet": "tax-reserve", "name": "Tax reserve", "balance": 1500000 }
],
"as_of": "2026-11-25T21:00:00.412Z"
}
}Response fields
| Field | Type | Meaning |
|---|---|---|
currency | string or null | KES or UGX, from the host. null only on a deployment with no mobile-money rail switched on |
available | integer | Minor units. Your main wallet's balance |
pockets | integer | Minor units. Your own pockets added together. 0 when you have none |
total | integer | Minor units. available plus pockets |
wallets | array | One entry per wallet you hold, main and your own pockets |
wallets[].wallet | string | main, or a pocket's slug. Pass it as wallet to List your balance transactions |
wallets[].name | string | The wallet's name as you see it in MOOKHPay |
wallets[].balance | integer | Minor units. The ledger keeps whole currency units, so this is always a multiple of 100 |
as_of | string | ISO 8601. When MOOKHPay read the balance |
There is no pending or reserved split: money reserved for a payout in flight has already left the balance.
Errors
| HTTP | Code | Name | When | What to do |
|---|---|---|---|---|
400 | 3014 | IDENTITY_HEADER_REFUSED | The request carries a session or identity header | Remove the header |
401 | 2781 | API_KEY_INVALID | Missing, malformed, unknown or revoked key | Check the key |
403 | 2941 | API_KEY_SCOPE_REQUIRED | The key lacks balance:read | An Owner issues a key with the scope |
403 | 3042 | API_KEY_IP_NOT_ALLOWED | The account has allowed addresses and the call came from another address | Call from a listed address |
429 | 1804 | RATE_LIMIT_EXCEEDED | Over the rate limit below | Wait Retry-After seconds |
503 | 2752 | LEDGER_UNAVAILABLE | The ledger did not answer | Retry with backoff |
503 | 2782 | AUTHN_UNAVAILABLE | Keys cannot be checked | Retry with backoff |
Rate limit
120 requests a minute per account, or the higher number MOOKHPay set for it, shared with List your balance transactions. Over it: 429, code 1804, with Retry-After and data.retryAfter in seconds.