Skip to content

Retrieve a payout ​

Reads one payout your platform made from one of your accounts, with its status worked out at the moment you read it. It does not return payouts the seller made themselves in MOOKHPay, or another platform's payouts from the same person.

Endpoint ​

GET /v1/payments/merchant/accounts/{id}/payouts/{payout_id}
AuthSecret key
Scopepayouts:write or accounts:read (either one)
PlatformYour organisation must be switched on as a platform, and the call must come from an allowed address if MOOKHPay set a list
Switched onPer deployment (PLATFORM_PAYOUTS_ENABLED). Where it is off, the route answers 404

Headers ​

HeaderRequiredValue
AuthorizationYesBearer mkp_…

Parameters ​

Path

NameTypeRequiredConstraints
idstringYesOne of your account ids: acct_, the country, _ and 24 hex characters
payout_idstringYespo_, the country, _ and 24 hex characters, made from this account

Example request ​

sh
curl https://payments-ke-staging.mookhpay.co/v1/payments/merchant/accounts/acct_ke_9c2f41b07e5d38a6c1f0b294/payouts/po_ke_6b1f0e9a2c7d48e3a5b2c810 \
  -H "Authorization: Bearer $MOOKHPAY_SECRET_KEY"
js
const BASE = "https://payments-ke-staging.mookhpay.co/v1/payments/merchant";
const account = "acct_ke_9c2f41b07e5d38a6c1f0b294";
const payoutId = "po_ke_6b1f0e9a2c7d48e3a5b2c810";

const res = await fetch(`${BASE}/accounts/${account}/payouts/${payoutId}`, {
  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}`);
console.log(answer.data.status, answer.data.failure);
python
import os

import requests

BASE = "https://payments-ke-staging.mookhpay.co/v1/payments/merchant"
account = "acct_ke_9c2f41b07e5d38a6c1f0b294"
payout_id = "po_ke_6b1f0e9a2c7d48e3a5b2c810"

res = requests.get(
    f"{BASE}/accounts/{account}/payouts/{payout_id}",
    headers={"Authorization": f"Bearer {os.environ['MOOKHPAY_SECRET_KEY']}"},
    timeout=30,
)
answer = res.json()
if not answer["ok"]:
    raise RuntimeError(f"{res.status_code} {answer['code']}: {answer['description']}")
print(answer["data"]["status"], answer["data"]["failure"])
php
<?php
$base = 'https://payments-ke-staging.mookhpay.co/v1/payments/merchant';
$account = 'acct_ke_9c2f41b07e5d38a6c1f0b294';
$payoutId = 'po_ke_6b1f0e9a2c7d48e3a5b2c810';

$ch = curl_init("{$base}/accounts/{$account}/payouts/{$payoutId}");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('MOOKHPAY_SECRET_KEY')],
]);
$answer = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if (!$answer['ok']) {
    throw new RuntimeException("{$status} {$answer['code']}: {$answer['description']}");
}
echo $answer['data']['status'], PHP_EOL;

Response ​

200 OK with description Payout.

json
{
  "ok": true,
  "description": "Payout",
  "data": {
    "payout_id": "po_ke_6b1f0e9a2c7d48e3a5b2c810",
    "account": "acct_ke_9c2f41b07e5d38a6c1f0b294",
    "status": "failed",
    "amount": 500000,
    "fee": 0,
    "total": 500000,
    "currency": "KES",
    "remarks": "Week 47 sales",
    "destination": { "rail": "mpesa", "phone_masked": "+254 7•• ••• 678" },
    "approval_id": null,
    "failure": {
      "code": "recipient_unreachable",
      "message": "The number cannot receive this payout. The money is back in the wallet"
    },
    "created_at": "2026-11-20T10:00:04.000Z"
  }
}

Response fields ​

data is the payout object.

Errors ​

HTTPCodeNameWhenWhat to do
4003014IDENTITY_HEADER_REFUSEDThe request carries a session or identity headerRemove it
4012781API_KEY_INVALIDMissing, malformed, unknown or revoked keyCheck the key
4032941API_KEY_SCOPE_REQUIREDThe key has neither payouts:write nor accounts:readIssue a key with one of them
4033042API_KEY_IP_NOT_ALLOWEDThe account has allowed addresses and the call came from another addressCall from a listed address
4032942PLATFORM_NOT_ENABLEDYour organisation is not a platform, or its platform is suspendedTalk to MOOKHPay
4033013PLATFORM_IP_NOT_ALLOWEDThe call came from an address not on your platform's allow-listCall from a listed address
4042943PLATFORM_ACCOUNT_NOT_FOUNDThe account is unknown, another platform's, revoked or malformedCheck the id
4093061PLATFORM_ACCOUNT_DISCONNECTEDWhere pockets are on: the person disconnected your platform, or their account closedStop calling for the account until they link again
4043023PLATFORM_PAYOUT_NOT_FOUNDThe payout is unknown, malformed, from another account or another platform, or was refused when you created itCheck both ids. A refused payout never becomes readable
4291804RATE_LIMIT_EXCEEDEDOver the rate limit, or your platform reached its limit of unknown account idsWait Retry-After seconds
5032782AUTHN_UNAVAILABLEThe key could not be checkedRetry
5033016PLATFORM_ACCOUNTS_UNAVAILABLEThe account could not be readRetry

Rate limit ​

120 requests a minute, shared by every account, balance, transaction, payout read, account link and business account request route your platform calls. Over it: 429, code 1804, with Retry-After and data.retryAfter in seconds. Unknown account ids also count against your platform: after 100 in an hour by default, account routes answer 429 until the hour is up.

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