> ## Documentation Index
> Fetch the complete documentation index at: https://www.bitnob.dev/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Bitnob has two APIs. The Business API (payouts, cards, trading, virtual accounts, stablecoin and bitcoin transfers) is at https://api.bitnob.com. The Enterprise API (non-custodial wallets) is at https://api.platform.bitnob.com.
> Business API auth: sign every request with HMAC-SHA256 and send four headers: `X-Auth-Client` (your client ID), `X-Auth-Timestamp` (Unix seconds), `X-Auth-Nonce` (16 random bytes, hex), and `X-Auth-Signature`, the hex HMAC-SHA256 of `CLIENT_ID:TIMESTAMP:NONCE:BODY` keyed with your client secret. BODY is the exact request body string you send, or an empty string. A missing header, a bad signature, or a timestamp more than about 5 minutes off returns `401`.
> Enterprise API auth: send your key in the `X-API-Key` header. Write requests such as creating a transaction also need an `Idempotency-Key` header, or they fail with `idempotency_key_required` before anything happens.
> Sandbox and production share the Business API base URL. The credentials you sign with select the environment, and `GET /api/whoami` returns it in `data.environment`. Use sandbox credentials in sample code and tests, and never put live credentials in code.
> Amounts are strings unless stated otherwise. Never parse them into floats. Balances, transactions, withdrawals (`POST /api/withdrawals`) and virtual accounts use integer strings in the smallest unit: satoshis for BTC, 6 decimals for USDT and USDC, kobo for NGN, and cents for KES and UGX (100 is 1 KES or 1 UGX). A mobile money collection takes `amount` as a JSON integer in cents.
> Payouts and trading use decimal strings in major units: a payout quote `amount` of `"1"` is 1 USDT, and a trading `quantity` of `"0.0001"` is 0.0001 BTC. Payout responses also carry `cent_amount`, the settlement amount in minor units.
> Card amounts are micro-units (1 USD = 1,000,000). Send them as JSON integers. Card responses return them as integer strings, and card webhooks as integers.
> Generate a unique `reference` for each money movement before the first attempt, and reuse it on retries. A reused reference returns `409` on payout quotes (`ALREADY_EXISTS`), withdrawals (`DUPLICATE_KEY_ERROR`) and card creation (`ALREADY_EXISTS`). It returns the existing record on NGN-pair trading orders, NGN virtual accounts and active mobile money collections. On a mobile money collection that has closed or failed it returns `409` `DUPLICATE_REFERENCE`. It isn't checked on crypto-pair trading orders, so look the order up with `GET /api/trading/orders/{reference}` before resending.
> Quotes expire at `expires_at`; read it from the response instead of assuming a window. An expired trading quote returns `422` `PRECONDITION_FAILED`, and an expired payout quote returns `400` `VALIDATION_ERROR`. Create a new quote rather than retrying. A payout quote can be initialized once, and a trading quote is consumed by the order that fills it.
> Webhooks: verify the `x-bitnob-signature` header, the hex HMAC-SHA512 of the raw request body keyed with your webhook secret, before parsing JSON. Compare in constant time and de-duplicate on `event_id`. A successful API response means accepted: confirm the outcome from the webhook, such as `payouts.withdrawal.success`.
> Errors return `status`, `code` and `detail`. Branch on `code`, never on `detail`. Since the November 5, 2026 response format change, each company gets either the current or the new error codes until its cutoff date, so handle both: `PROVIDER_ERROR` or `PROCESSING_ERROR`, and `BVN_PROVIDER_UNAVAILABLE` or `BVN_VERIFICATION_UNAVAILABLE`. A body that fails to parse returns `{"error": {"code": "BAD_REQUEST"}}`.

# Kenya

> Rails, beneficiary fields, cut-off times, and failure modes specific to KES payouts.

## 1. Overview

Kenya is one of the most mature mobile money markets globally. Mobile money is the default payment method for individuals, microbusinesses, and increasingly SMEs.

M-Pesa, operated by Safaricom, is the overwhelmingly dominant mobile money platform, with smaller market shares held by Airtel Money and Telkom's T-Kash.

For payout products, the operational reality is:

* **Only rail:** M-Pesa. Bitnob pays out to an M-Pesa personal number, a Paybill, or a Till.
* **No bank transfers.** KES payouts to bank accounts aren't supported.

## 2. Settlement methods available

| Method | Description |
| - | - |
| M-Pesa personal number | Payout to a customer's M-Pesa wallet, identified by phone number. |
| M-Pesa Paybill | Payout to a business Paybill number. |
| M-Pesa Till | Payout to a merchant Till number. |

> [!NOTE]
>
> In retail and small SME payouts, M-Pesa dominance is absolute.

## 3. Beneficiary validation standards

Read the fields each M-Pesa destination needs from [Country requirements](https://www.bitnob.dev/api-reference/payouts/country-requirements.md) at runtime.

| Type | Validation Process |
| - | - |
| M-Pesa Wallets | Validate mobile number format (07xx xxx xxx). Confirm wallet registration status (through API where available). |

## Best practices for M-Pesa validation

Normalize phone numbers: Ensure numbers are processed as 07xxxxxxxx, no country code at input (normalize to +2547xxxxxxxx if needed internally).

Carrier Mapping: Detect and validate Safaricom vs Airtel vs Telkom.

Wallet Status Check: Confirm that wallet is active, not closed, frozen, or under KYC restriction.

Display beneficiary name: Retrieve and show user wallet name if API allows..

## 4. Wallet tiering and transaction limits

M-Pesa wallets have tiered limits based on KYC level. The corridor min/max Bitnob enforces comes from [Get Limits](https://www.bitnob.dev/api-reference/payouts/payout-limits.md):

| Wallet Type | Limitation |
| - | - |
| Standard Consumer Wallet | Max single transaction KES 150,000 (\$1,000), Max daily total KES 300,000 (\$2,000). |
| SME / Business Wallets (Lipa na M-Pesa, Business Tills) | Higher transaction and balance limits, designed for merchants. |

Impact on Payouts:

Payouts exceeding KES 150,000 must be split onto multiple transactions automatically.

Users may hit daily caps if many payouts occur in a day: plan for progressive payouts if necessary.

## 5. Payout timing expectations

| Phase | Expected Time |
| - | - |
| Funding Confirmation (Bitcoin/Stablecoin) | \<15 minutes typically (network dependent). |
| M-Pesa Wallet Payout Processing | Real-time to under 2 minutes under normal conditions. |

## 6. Common failure modes

| Failure Mode | Description | Response Strategy |
| - | - | - |
| Invalid Mobile Number | Wrong format, non-Safaricom number for M-Pesa payout. | Normalize and validate carrier pre-payout. |
| Inactive Wallet | Wallet closed, suspended, or deregistered. | Pre-validate wallet status if API available; handle failures and refund quickly. |
| Transaction Limit Exceeded | Payout above KES 150,000 single transfer limit. | Automatically split large payouts into compliant chunks. |
| User Daily Limit Reached | User has reached daily wallet cap. | Notify user; retry payout the following day automatically or with consent. |
| Mobile Money Rail Downtime | Rare Safaricom system maintenance or overload. | Implement retry logic with exponential backoff. Communicate delay to users immediately if persistent. |

## 7. Liquidity management considerations

Maintain KES liquidity buffers separately from mobile money float. (M-Pesa agent cash-out networks are liquid, but KES liquidity must be managed separately for settlement.)

FX Volatility Management: Kenyan Shilling (KES) is generally more stable than NGN or GHS, but large BTC or USDT conversions should still account for minor volatility across days.

Mobile Money Agent Liquidity: Typically strong in urban centers, weaker in rural areas. Plan for agent liquidity challenges if payouts are intended for rural distribution.

## 8. Operational best practices for Kenya corridor

| Area | Recommendation |
| - | - |
| Validation | Always validate mobile number structure and match to carrier. |
| Limit Handling | Auto-split payouts exceeding KES 150,000. |
| Error Monitoring | Monitor M-Pesa error codes (e.g., insufficient funds, inactive wallet) live. |
| Retry Strategies | Implement safe retries for temporary mobile network issues (max 3 retries over 1 hour). |
| User Notifications | Proactively notify users if payouts must be split or delayed due to system issues. |
| Corridor Monitoring | Track Safaricom system status if possible; rare downtime windows (\~midnight to 5am local). |

## 9. Mobile money networks and prefixes in Kenya

| Network | Prefix Examples |
| - | - |
| Safaricom (M-Pesa) | 070, 071, 072, 074, 075 |
| Airtel Money | 073, 078 |
| Telkom T-Kash | 077 |

For M-Pesa payouts, prioritize Safaricom prefixes unless Airtel/Telkom explicitly supported and integrated separately.

## 10. Quick reference table

| Field | Value |
| - | - |
| Primary Rail | M-Pesa Mobile Money (Safaricom) |
| Standard Wallet Format | 07xxxxxxxx |
| SLA (Normal Conditions) | 95%+ payouts under 2 minutes |
| Main Risks | Transaction limit splits, mobile network outages, inactive wallets |
| Reversal Timing | Instant (majority) or under 24 hours (rare exceptions) |
| Recommended Liquidity Buffer | 2–3x daily payout volume in KES |

Kenya’s M-Pesa ecosystem provides near-perfect conditions for reliable, fast mobile payouts but only for platforms that properly respect:

* Wallet tier limits,
* Carrier prefix validations,
* Rail downtime contingencies,
* Urban vs rural liquidity patterns.

Operational excellence in the Kenya corridor means building silent, resilient payout systems that handle splitting, retries, and transparency automatically.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.