Appearance
List accounts
Lists the accounts your platform reaches, created and linked, newest first, a page at a time.
An account whose owner disconnected your platform is not listed. Reading it by id answers 409 with code 3061 where pockets are available (Kenya), or 404 elsewhere. There is no filter: to find one seller, keep their account id, or their external_reference, on your side.
In pocket mode, the accounts in this list do not carry pocket. To see a pocket's status, read the account with Retrieve an account.
Endpoint
GET /v1/payments/merchant/accounts| 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 |
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 |
|---|---|---|---|
limit | string of digits | No | 1 to 100, default 20 |
cursor | string | No | 1 to 400 characters. The next_cursor of the previous page. It is opaque and tied to your platform; an edited one, or one from another platform, is 400 and code 3012 |
Example request
Walk every page:
sh
curl "https://payments-ke-staging.mookhpay.co/v1/payments/merchant/accounts?limit=100" \
-H "Authorization: Bearer $MOOKHPAY_SECRET_KEY"
# Next page: pass next_cursor back as cursor, URL-encoded
curl -G "https://payments-ke-staging.mookhpay.co/v1/payments/merchant/accounts" \
--data-urlencode "limit=100" \
--data-urlencode "cursor=$NEXT_CURSOR" \
-H "Authorization: Bearer $MOOKHPAY_SECRET_KEY"js
const BASE = "https://payments-ke-staging.mookhpay.co/v1/payments/merchant";
const accounts = [];
let cursor = null;
do {
const query = new URLSearchParams({ limit: "100" });
if (cursor) query.set("cursor", cursor);
const res = await fetch(`${BASE}/accounts?${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}`);
accounts.push(...body.data.accounts);
cursor = body.data.next_cursor;
} while (cursor);
console.log(accounts.length, "accounts");python
import os
import requests
BASE = "https://payments-ke-staging.mookhpay.co/v1/payments/merchant"
accounts = []
cursor = None
while True:
params = {"limit": "100"}
if cursor:
params["cursor"] = cursor
res = requests.get(
f"{BASE}/accounts",
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']}")
accounts.extend(body["data"]["accounts"])
cursor = body["data"]["next_cursor"]
if not cursor:
break
print(len(accounts), "accounts")php
<?php
$base = "https://payments-ke-staging.mookhpay.co/v1/payments/merchant";
$accounts = [];
$cursor = null;
do {
$params = ["limit" => "100"];
if ($cursor !== null) {
$params["cursor"] = $cursor;
}
$ch = curl_init("$base/accounts?" . 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($accounts, ...$body["data"]["accounts"]);
$cursor = $body["data"]["next_cursor"];
} while ($cursor !== null);
echo count($accounts), " accounts", PHP_EOL;Response
200 OK.
json
{
"ok": true,
"description": "Accounts",
"data": {
"accounts": [
{
"id": "acct_ke_9c2f41b07e5d38a6c1f0b294",
"username": "joyotieno4821",
"status": "active",
"origin": "created",
"external_reference": "seller-5521",
"requirements": { "currently_due": ["identity"], "pending": [] },
"capabilities": { "payments": true, "payouts": true },
"created_at": "2026-11-20T09:00:00.000Z"
},
{
"id": "acct_ke_1d7b30c5a9e24f8b6c0e3a71",
"username": "wanjiku_prints",
"status": "active",
"origin": "linked",
"external_reference": null,
"requirements": { "currently_due": [], "pending": [] },
"capabilities": { "payments": true, "payouts": true },
"created_at": "2026-11-18T14:22:10.000Z"
}
],
"next_cursor": null
}
}Response fields
| Field | Type | Meaning |
|---|---|---|
accounts | array | Up to limit account objects, newest first by when your platform got the account. Never with pocket, even in pocket mode |
next_cursor | string or null | Pass it as cursor for the next page. null on the last page |
See Pagination for how the cursors on the different lists behave.
Errors
| HTTP | Code | Name | When | What to do |
|---|---|---|---|---|
400 | 1701 | INVALID_REQUEST_DATA | limit outside 1 to 100, or an unknown parameter | Fix the query |
400 | 3012 | PLATFORM_CURSOR_INVALID | The cursor was edited or came from another platform | 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 |
429 | 1804 | RATE_LIMIT_EXCEEDED | Over the rate limit | Wait Retry-After seconds |
503 | 2782 | AUTHN_UNAVAILABLE | Keys cannot be checked | Retry with backoff |
503 | 3016 | PLATFORM_ACCOUNTS_UNAVAILABLE | The account service did not answer | 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.