Skip to content

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
AuthSecret key, Authorization: Bearer mkp_…
Scopeaccounts:read
PlatformThe 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 flagRegistered 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 ​

HeaderRequiredValue
AuthorizationYesBearer mkp_test_… or Bearer mkp_live_…

Parameters ​

Query ​

Unknown query parameters are refused with 400 and code 1701.

NameTypeRequiredConstraints and meaning
accountstringNoOne of your account ids. Only that account's movements. An account you do not reach is 404 and code 2943
fromstringNoISO 8601 date-time with a time zone. Inclusive
tostringNoISO 8601 date-time with a time zone. Exclusive. Must be later than from, or 400, 1701, to must be later than from
typestringNoThe ledger's stored type: deposit, withdrawal, transfer, fee or adjustment. Note that the rows carry a different set of type values (below)
limitstring of digitsNo1 to 100, default 20
cursorstringNoUp 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 ​

FieldTypeMeaning
movementsarrayUp 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[].idstringMOOKHPay's reference for the transaction, SM…. The same movement in List an account's transactions has a numeric id
movements[].accountstringThe account id the row belongs to
movements[].walletstringmain or a pocket's slug
movements[].typestringWorked 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[].statusstringpending, completed, failed or reversed
movements[].directionstringin or out of the account
movements[].amountintegerMinor units, the amount moved
movements[].feeintegerMinor units, a fee the account paid on a movement out. 0 on money in
movements[].descriptionstring or nullThe ledger's description
movements[].counterpartystring or nullThe name on the other side, where the ledger has one
movements[].sourcestring or nullWhere money came from or went: topup, link, checkout, c2b, send or withdraw, or null
movements[].railstring or nullmpesa, momo, card-uc and so on, or null
movements[].external_referencestring or nullThe rail's own reference, such as the M-Pesa receipt
movements[].refunded_amountintegerMinor units refunded against this movement so far
movements[].created_atstringISO 8601
next_cursorstring or nullPass it as cursor for the next page. null on the last page

Which movements are in the feed ​

AccountWhat the feed shows
One you createdIts whole history
One linked to youMovements from the moment its owner approved the link
One whose owner disconnected your platformNothing, including what happened before

Errors ​

HTTPCodeNameWhenWhat to do
4001701INVALID_REQUEST_DATAA bad from, to, type or limit, to not later than from, or an unknown parameterFix the query
4003012PLATFORM_CURSOR_INVALIDThe cursor is malformed, edited or another platform'sStart again without a cursor
4003014IDENTITY_HEADER_REFUSEDThe request carries a session or identity headerRemove the header
4012781API_KEY_INVALIDMissing, malformed, unknown or revoked keyCheck the key
4032941API_KEY_SCOPE_REQUIREDThe key lacks accounts:readIssue a key with the scope
4033042API_KEY_IP_NOT_ALLOWEDThe account has allowed addresses and the call came from another addressCall from a listed address
4032942PLATFORM_NOT_ENABLEDThe organisation is not an active platformAsk MOOKHPay
4033013PLATFORM_IP_NOT_ALLOWEDThe call came from an address not on your allow-listCall from a listed address
4042943PLATFORM_ACCOUNT_NOT_FOUNDaccount names an account you do not reachCheck the id
4291804RATE_LIMIT_EXCEEDEDOver the rate limit, or over 100 unknown account ids in an hourWait Retry-After seconds
5032752LEDGER_UNAVAILABLEThe ledger did not answerRetry with backoff
5032782AUTHN_UNAVAILABLEKeys cannot be checkedRetry with backoff
5033016PLATFORM_ACCOUNTS_UNAVAILABLEThe map from movements to account ids could not be readRetry with backoff
5033020PLATFORM_FEED_UNAVAILABLEThe ledger's feed is not switched on for this deploymentRead 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.

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