Appearance
List transactions across accounts
One feed of the movements on every account your platform reaches, newest first, each row naming its account. Use it for your own dashboard and reconciliation.
The feed is always your platform's: no parameter can widen it to another platform's accounts. It does not include your platform's own wallet, and it has no running balance; for a statement with balances use List an account's transactions.
Pocket mode
A platform with a pocket sees only the movements of the pockets its connections opened, never a person's main wallet or their other pockets. Each row then has the pocket shape List an account's transactions answers in pocket mode: type is transfer_in, payout, moved_in, moved_out or payment_out, the person's own moves read "Moved by you" with reference null, and there is no counterparty, fee, rail or source.
Endpoint
GET /v1/payments/merchant/transactions| Auth | Secret key, Authorization: Bearer mkp_… |
| Scope | accounts:read |
| 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. The ledger must also have the feed switched on, or the route answers 503 and code 3020 |
Headers
| Header | Required | Value |
|---|---|---|
Authorization | Yes | Bearer mkp_test_… or Bearer mkp_live_… |
Parameters
Query
Unknown query parameters are refused with 400 and code 1701.
| Name | Type | Required | Constraints and meaning |
|---|---|---|---|
account | string | No | One of your account ids. Only that account's movements. An account you do not reach is 404 and code 2943 |
from | string | No | ISO 8601 date-time with a time zone. Inclusive |
to | string | No | ISO 8601 date-time with a time zone. Exclusive. Must be later than from, or 400, 1701, to must be later than from |
type | string | No | The ledger's stored type: deposit, withdrawal, transfer, fee or adjustment. Note that the rows carry a different set of type values (below) |
limit | string of digits | No | 1 to 100, default 20 |
cursor | string | No | Up to 500 characters. The next_cursor of the previous page, signed for your platform. An edited one, or one from another platform, is 400 and code 3012. Send the same filters with it |
Example request
sh
curl -G "https://payments-ke-staging.mookhpay.co/v1/payments/merchant/transactions" \
--data-urlencode "from=2026-11-20T00:00:00Z" \
--data-urlencode "limit=100" \
-H "Authorization: Bearer $MOOKHPAY_SECRET_KEY"js
const BASE = "https://payments-ke-staging.mookhpay.co/v1/payments/merchant";
const rows = [];
let cursor = null;
do {
const query = new URLSearchParams({ from: "2026-11-20T00:00:00Z", limit: "100" });
if (cursor) query.set("cursor", cursor);
const res = await fetch(`${BASE}/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}`);
rows.push(...body.data.movements);
cursor = body.data.next_cursor;
} while (cursor);
const byAccount = new Map();
for (const row of rows) byAccount.set(row.account, [...(byAccount.get(row.account) ?? []), row]);
console.log(byAccount.size, "accounts moved money today");python
import os
from collections import defaultdict
import requests
BASE = "https://payments-ke-staging.mookhpay.co/v1/payments/merchant"
rows = []
cursor = None
while True:
params = {"from": "2026-11-20T00:00:00Z", "limit": "100"}
if cursor:
params["cursor"] = cursor
res = requests.get(
f"{BASE}/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']}")
rows.extend(body["data"]["movements"])
cursor = body["data"]["next_cursor"]
if not cursor:
break
by_account = defaultdict(list)
for row in rows:
by_account[row["account"]].append(row)
print(len(by_account), "accounts moved money today")php
<?php
$base = "https://payments-ke-staging.mookhpay.co/v1/payments/merchant";
$rows = [];
$cursor = null;
do {
$params = ["from" => "2026-11-20T00:00:00Z", "limit" => "100"];
if ($cursor !== null) {
$params["cursor"] = $cursor;
}
$ch = curl_init("$base/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($rows, ...$body["data"]["movements"]);
$cursor = $body["data"]["next_cursor"];
} while ($cursor !== null);
$byAccount = [];
foreach ($rows as $row) {
$byAccount[$row["account"]][] = $row;
}
echo count($byAccount), " accounts moved money today", PHP_EOL;Response
200 OK.
json
{
"ok": true,
"description": "Transactions",
"data": {
"movements": [
{
"id": "SM8K2QF7",
"account": "acct_ke_9c2f41b07e5d38a6c1f0b294",
"wallet": "main",
"type": "system_topup",
"status": "completed",
"direction": "in",
"amount": 135000,
"fee": 0,
"description": "Payment for order-8841",
"counterparty": null,
"source": "checkout",
"rail": "mpesa",
"external_reference": "TKL4XQ2B9M",
"refunded_amount": 0,
"created_at": "2026-11-20T09:15:02.000Z"
}
],
"next_cursor": "eyJwIjoiNDIiLCJ0Ijo0ODIxMywiZSI6OTY0MjB9.mJ7c0yYB3tQ2Vh8nX1rUaKpL5eWzS9dFq4gT6oNiR0E"
}
}Response fields
| Field | Type | Meaning |
|---|---|---|
movements | array | Up to limit rows, newest first. A page can hold fewer than limit rows and still have a next_cursor: rows of an account your platform stopped reaching are left out after the page is read |
movements[].id | string | MOOKHPay's reference for the transaction, SM…. The same movement in List an account's transactions has a numeric id |
movements[].account | string | The account id the row belongs to |
movements[].wallet | string | main or a pocket's slug |
movements[].type | string | Worked out from who the money moved between: system_topup (money in from outside, such as a payment or a top-up), system_withdrawal (money out to outside, such as a payout), p2p_transfer (between two MOOKHPay accounts), internal_transfer (between the account's own wallets) or transfer (anything else). These are not the values the type filter takes |
movements[].status | string | pending, completed, failed or reversed |
movements[].direction | string | in or out of the account |
movements[].amount | integer | Minor units, the amount moved |
movements[].fee | integer | Minor units, a fee the account paid on a movement out. 0 on money in |
movements[].description | string or null | The ledger's description |
movements[].counterparty | string or null | The name on the other side, where the ledger has one |
movements[].source | string or null | Where money came from or went: topup, link, checkout, c2b, send or withdraw, or null |
movements[].rail | string or null | mpesa, momo, card-uc and so on, or null |
movements[].external_reference | string or null | The rail's own reference, such as the M-Pesa receipt |
movements[].refunded_amount | integer | Minor units refunded against this movement so far |
movements[].created_at | string | ISO 8601 |
next_cursor | string or null | Pass it as cursor for the next page. null on the last page |
Which movements are in the feed
| Account | What the feed shows |
|---|---|
| One you created | Its whole history |
| One linked to you | Movements from the moment its owner approved the link |
| One whose owner disconnected your platform | Nothing, including what happened before |
Errors
| HTTP | Code | Name | When | What to do |
|---|---|---|---|---|
400 | 1701 | INVALID_REQUEST_DATA | A bad from, to, type or limit, to not later than from, or an unknown parameter | Fix the query |
400 | 3012 | PLATFORM_CURSOR_INVALID | The cursor is malformed, edited or another platform's | Start again without a cursor |
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 |
404 | 2943 | PLATFORM_ACCOUNT_NOT_FOUND | account names an account you do not reach | Check the id |
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 map from movements to account ids could not be read | Retry with backoff |
503 | 3020 | PLATFORM_FEED_UNAVAILABLE | The ledger's feed is not switched on for this deployment | Read accounts one at a time, or retry later |
Rate limit
120 requests a minute per platform, shared with every other account route. Over it: 429, code 1804, Retry-After in seconds.