Appearance
List an account's transactions
Lists the movements on one wallet of one account, oldest first, with the balance after each. Use it for a seller's statement.
It reads one wallet at a time. For every account in one feed, newest first, use List transactions across accounts. The two lists use different ids and different type values for the same movement; see Response fields.
In pocket mode it reads only your platform's pocket, newest first, and the movements have a different shape. See Pocket mode.
Endpoint
GET /v1/payments/merchant/accounts/{id}/transactions| Auth | Secret key, Authorization: Bearer mkp_… |
| Scope | accounts:read on the key, and accounts:read in the account's grant |
| Platform | The key's organisation must be an active platform, and the call must come from an address on its allow-list if it has one |
| Feature flag | Registered only where the platform API is on |
Headers
| Header | Required | Value |
|---|---|---|
Authorization | Yes | Bearer mkp_test_… or Bearer mkp_live_… |
Parameters
Path
| Name | Type | Required | Constraints and meaning |
|---|---|---|---|
id | string | Yes | One of your account ids |
Query
Unknown query parameters are refused with 400 and code 1701.
| Name | Type | Required | Constraints and meaning |
|---|---|---|---|
wallet | string | No | main (the default) or a pocket's slug from the balance. In pocket mode, only your pocket's slug, which is also the default: a-z, 0-9 and -, starting with a letter or digit, up to 50 characters. A wallet the account does not hold is 404 and code 3019 |
from | string | No | ISO 8601 date-time with a time zone. Inclusive |
to | string | No | ISO 8601 date-time with a time zone. Inclusive. Must be later than from, or 400, 1701, to must be later than from |
limit | string of digits | No | 1 to 100, default 20 |
cursor | string | No | Up to 600 characters. The next_cursor of the previous page. It carries the wallet and window it was made for: send it alone, or with the same wallet, from and to. A different value, an edited cursor, or one made for another account or platform is 400 and code 3012 |
Example request
sh
curl -G "https://payments-ke-staging.mookhpay.co/v1/payments/merchant/accounts/acct_ke_9c2f41b07e5d38a6c1f0b294/transactions" \
--data-urlencode "wallet=main" \
--data-urlencode "from=2026-11-01T00:00:00+03:00" \
--data-urlencode "to=2026-11-30T23:59:59+03:00" \
--data-urlencode "limit=100" \
-H "Authorization: Bearer $MOOKHPAY_SECRET_KEY"js
const BASE = "https://payments-ke-staging.mookhpay.co/v1/payments/merchant";
const id = "acct_ke_9c2f41b07e5d38a6c1f0b294";
const movements = [];
let query = new URLSearchParams({
wallet: "main",
from: "2026-11-01T00:00:00+03:00",
to: "2026-11-30T23:59:59+03:00",
limit: "100",
});
for (;;) {
const res = await fetch(`${BASE}/accounts/${id}/transactions?${query}`, {
headers: { Authorization: `Bearer ${process.env.MOOKHPAY_SECRET_KEY}` },
});
const body = await res.json();
if (!body.ok) throw new Error(`${res.status} ${body.code}: ${body.description}`);
movements.push(...body.data.movements);
if (!body.data.next_cursor) break;
query = new URLSearchParams({ cursor: body.data.next_cursor, limit: "100" });
}
console.log(movements.length, "movements");python
import os
import requests
BASE = "https://payments-ke-staging.mookhpay.co/v1/payments/merchant"
account_id = "acct_ke_9c2f41b07e5d38a6c1f0b294"
movements = []
params = {
"wallet": "main",
"from": "2026-11-01T00:00:00+03:00",
"to": "2026-11-30T23:59:59+03:00",
"limit": "100",
}
while True:
res = requests.get(
f"{BASE}/accounts/{account_id}/transactions",
params=params,
headers={"Authorization": f"Bearer {os.environ['MOOKHPAY_SECRET_KEY']}"},
timeout=30,
)
body = res.json()
if not body["ok"]:
raise RuntimeError(f"{res.status_code} {body['code']}: {body['description']}")
movements.extend(body["data"]["movements"])
if not body["data"]["next_cursor"]:
break
params = {"cursor": body["data"]["next_cursor"], "limit": "100"}
print(len(movements), "movements")php
<?php
$base = "https://payments-ke-staging.mookhpay.co/v1/payments/merchant";
$id = "acct_ke_9c2f41b07e5d38a6c1f0b294";
$movements = [];
$params = [
"wallet" => "main",
"from" => "2026-11-01T00:00:00+03:00",
"to" => "2026-11-30T23:59:59+03:00",
"limit" => "100",
];
do {
$ch = curl_init("$base/accounts/$id/transactions?" . http_build_query($params));
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("MOOKHPAY_SECRET_KEY")],
]);
$body = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
if (!$body["ok"]) {
throw new RuntimeException("$status {$body['code']}: {$body['description']}");
}
array_push($movements, ...$body["data"]["movements"]);
$next = $body["data"]["next_cursor"];
$params = ["cursor" => $next, "limit" => "100"];
} while ($next !== null);
echo count($movements), " movements", PHP_EOL;http_build_query, URLSearchParams and requests encode the + in a time zone offset. When you build the URL by hand, encode it as %2B or use Z.
Response
200 OK.
json
{
"ok": true,
"description": "Transactions",
"data": {
"account": "acct_ke_9c2f41b07e5d38a6c1f0b294",
"wallet": "main",
"movements": [
{
"id": "48213",
"account": "acct_ke_9c2f41b07e5d38a6c1f0b294",
"wallet": "main",
"type": "deposit",
"status": "completed",
"direction": "in",
"amount": 135000,
"description": "Payment for order-8841",
"balance_after": 1235000,
"created_at": "2026-11-20T09:15:02.000Z"
},
{
"id": "48377",
"account": "acct_ke_9c2f41b07e5d38a6c1f0b294",
"wallet": "main",
"type": "withdrawal",
"status": "completed",
"direction": "out",
"amount": 500000,
"description": "Week 47",
"balance_after": 735000,
"created_at": "2026-11-21T07:00:11.000Z"
}
],
"next_cursor": null
}
}Response fields
| Field | Type | Meaning |
|---|---|---|
account | string | The account id |
wallet | string | The wallet read |
movements | array | Up to limit movements, oldest first. For a linked account this is the wallet's whole history, from before the link; the feed starts at the approval |
movements[].id | string | The ledger's transaction number, as a string of digits. The feed names the same movement by its SM… reference instead |
movements[].type | string | The ledger's stored type: deposit, withdrawal, transfer, fee or adjustment. This differs from the feed, whose rows carry derived types such as system_topup |
movements[].status | string | pending, completed, failed or reversed |
movements[].direction | string | in or out of this wallet |
movements[].amount | integer | Minor units, never negative. Read direction for the sign |
movements[].description | string | The ledger's description. An empty string when it has none |
movements[].balance_after | integer | Minor units. The running balance after this movement. Without from, it is the wallet's balance. With from, it counts from zero at from |
movements[].created_at | string | ISO 8601 |
next_cursor | string or null | Pass it as cursor for the next page. null on the last page |
Pocket mode
When your platform has a pocket set up, this route reads only that pocket, from your platform's side. The person's main wallet and their other pockets are never shown.
walletcan only be your pocket's slug, and is that by default. Any other wallet,mainincluded, is404and code3019.- Movements come newest first.
fromis inclusive andtois exclusive.limitis1to100, default20. - Pass
next_cursorback ascursor, with the samefromandto. An edited or foreign cursor is400and code3012. - If the pocket is still being opened, the call answers
409with code3063. If the person disconnected your platform,409with code3061.
json
{
"ok": true,
"description": "Transactions",
"data": {
"account": "acct_ke_9c2f41b07e5d38a6c1f0b294",
"wallet": "kazi",
"pocket": { "slug": "kazi", "name": "Kazi Studio" },
"movements": [
{
"id": "SM8K2QF7",
"account": "acct_ke_9c2f41b07e5d38a6c1f0b294",
"wallet": "kazi",
"type": "moved_out",
"status": "completed",
"direction": "out",
"amount": 50000,
"currency": "KES",
"description": "Moved by you",
"reference": null,
"created_at": "2026-11-25T12:40:09.000Z"
},
{
"id": "SM8K2PZ3",
"account": "acct_ke_9c2f41b07e5d38a6c1f0b294",
"wallet": "kazi",
"type": "transfer_in",
"status": "completed",
"direction": "in",
"amount": 150000,
"currency": "KES",
"description": "Payment for the Safari Lager campaign",
"reference": "job-7731",
"created_at": "2026-11-25T08:14:31.000Z"
}
],
"next_cursor": null
}
}| Field | Type | Meaning |
|---|---|---|
account | string | The account id |
wallet | string | Your pocket's slug |
pocket | object | { slug, name } of your pocket |
movements | array | Up to limit movements, newest first |
movements[].id | string | MOOKHPay's reference for the transaction, SM…, the same as on the feed |
movements[].type | string | What the movement was, from your side. See the table below |
movements[].status | string | The ledger's status: pending, completed, failed or reversed |
movements[].direction | string | in or out of the pocket |
movements[].amount | integer | Minor units, never negative. Read direction for the sign |
movements[].currency | string or null | KES on the Kenya host |
movements[].description | string or null | Moved by you for the person's own moves. Otherwise the ledger's description: for your pay-in, its remarks |
movements[].reference | string or null | For your pay-in, its external_reference. Otherwise the reference the movement was booked with, if any. Always null for the person's own moves |
movements[].created_at | string | ISO 8601 |
next_cursor | string or null | Pass it as cursor for the next page. null on the last page |
There is no balance_after in pocket mode. Read the balance for the pocket's balance now.
type | Direction | Meaning |
|---|---|---|
transfer_in | in | Money into the pocket that the person did not move there themselves, such as your pay-in |
payout | out | A withdrawal to a phone, whether you paid it out or the person withdrew in MOOKHPay |
payment_out | out | Money the person sent or spent from the pocket, to someone else |
moved_in | in | The person moved money into the pocket from another of their own wallets |
moved_out | out | The person moved money from the pocket to another of their own wallets |
For the person's own moves (moved_in, moved_out), MOOKHPay never says where the money came from or went: that is theirs to keep private.
Errors
| HTTP | Code | Name | When | What to do |
|---|---|---|---|---|
400 | 1701 | INVALID_REQUEST_DATA | A bad wallet, from, to or limit, to not later than from, or an unknown parameter | Fix the query |
400 | 3012 | PLATFORM_CURSOR_INVALID | The cursor was edited, made for another account, platform, wallet or window, or sent with different filters | Send the cursor alone, or start again |
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 accounts:read | Issue 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 |
403 | 2942 | PLATFORM_NOT_ENABLED | The organisation is not an active platform | Ask MOOKHPay |
403 | 3013 | PLATFORM_IP_NOT_ALLOWED | The call came from an address not on your allow-list | Call from a listed address |
403 | 3025 | PLATFORM_GRANT_SCOPE_MISSING | The account's grant does not include accounts:read | Ask the owner to approve a new account link with accounts:read |
404 | 2943 | PLATFORM_ACCOUNT_NOT_FOUND | Unknown, another platform's, revoked or malformed id | Check the id |
404 | 3019 | PLATFORM_WALLET_NOT_FOUND | The account has no wallet by that slug. In pocket mode, any wallet but your pocket | Read the balance for the wallets it holds |
409 | 3061 | PLATFORM_ACCOUNT_DISCONNECTED | Where pockets are available (Kenya): the person disconnected your platform in MOOKHPay. data.error is PLATFORM_ACCOUNT_DISCONNECTED | Read your own records. Ask them to connect again |
409 | 3063 | PLATFORM_POCKET_NOT_READY | Pocket mode: the pocket is still being opened. data.error is PLATFORM_POCKET_NOT_READY | Retry in a minute |
429 | 1804 | RATE_LIMIT_EXCEEDED | Over the rate limit, or over 100 unknown account ids in an hour | 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 |
503 | 3016 | PLATFORM_ACCOUNTS_UNAVAILABLE | The account, or in pocket mode its pocket, could not be read | Retry with backoff |
Rate limit
120 requests a minute per platform, shared with every other account route. Over it: 429, code 1804, Retry-After in seconds.