What is the M-Pesa API? Safaricom's Mobile Money Gateway Explained

The M-Pesa API is Safaricom's developer platform that allows businesses and remittance services to programmatically send and receive money through M-Pesa mobile wallets. It exposes Kenya's dominant mobile money network — used by over 51 million active users — to third-party applications via REST endpoints, enabling automated payouts directly to a recipient's phone number without manual intervention.

How the M-Pesa API works for remittances

Remittance platforms integrate the M-Pesa API through Safaricom's Daraja portal. The most relevant endpoint for cross-border payouts is B2C (Business to Customer), which pushes KES directly from a business's M-Pesa float account to any registered M-Pesa phone number in Kenya. The platform registers as a business shortcode, funds a float account in KES, and calls the B2C endpoint with the recipient's phone number and amount. M-Pesa confirms delivery with a callback — typically within seconds. The sender's platform handles the upstream FX conversion before funding the float.

What it costs to integrate and use the M-Pesa API

Accessing the Daraja API is free — there are no integration fees or monthly subscription costs for basic API access. Transaction costs are the primary expense: B2C payouts to M-Pesa wallets are charged at Safaricom's standard Business Pay Bill or B2C tariff, which scales with the amount (typically KES 5-75 per transaction, roughly $0.04-0.58). Remittance companies also incur the cost of maintaining a KES float account, which requires a formal partnership with Safaricom or a licensed aggregator such as Flutterwave, Cellulant, or Africa's Talking — these aggregators add their own margin.

M-Pesa API vs crypto rails for KES payouts

Both M-Pesa API and crypto rails (USDC on Stellar or Tron) can deliver funds to Kenya in under a minute, but the cost structures differ. Crypto rails charge network fees under $0.01 per transaction plus exchange spreads of 0.3-1.5%, while M-Pesa delivers directly to the recipient's phone with no crypto knowledge required. The practical tradeoff: crypto rails have lower all-in costs (often 0.5-1.5% total) but require the recipient to use an exchange. M-Pesa payouts cost 1.5-3% all-in but land instantly on a device 96% of Kenyan adults already use. RemitRoutes shows live costs for both on the USD-KES corridor.

Limitations and access requirements

The M-Pesa API is primarily available for the Kenyan market. M-Pesa operates in 7 other countries (Tanzania, Ghana, Egypt, Mozambique, DRC, Lesotho, Ethiopia) but each market has a separate API instance managed by a local entity, with different credentials and endpoints. International platforms typically partner with an aggregator rather than integrating directly with each Safaricom subsidiary. Sandbox access is open to any developer on the Daraja portal, but production access requires a signed business agreement, KYC verification, and a minimum float balance — typically $5,000-10,000 equivalent.

Frequently asked questions

What is the M-Pesa Daraja API?

Daraja is Safaricom's developer portal and API gateway for M-Pesa integrations. It provides endpoints for B2C payouts, C2B collections, STK Push (payment prompts), and transaction status queries. Developers can register, access a sandbox, and test integrations for free before applying for production credentials.

Do I need a direct Safaricom agreement to use the M-Pesa API?

For production use, you typically need either a direct business agreement with Safaricom or a partnership with a licensed payment aggregator like Flutterwave, Africa's Talking, or Cellulant. Aggregators simplify compliance and float management but add a margin on top of Safaricom's base tariff.

Is the M-Pesa API available outside Kenya?

M-Pesa operates in Kenya, Tanzania, Ghana, Egypt, Mozambique, DRC, Lesotho, and Ethiopia, but each country has a separate API operated by a different local entity. A Safaricom Kenya integration does not automatically cover Tanzania M-Pesa — each market requires its own partnership and credentials.

How fast does a B2C M-Pesa payout settle?

B2C payouts typically settle in under 10 seconds during normal operating hours. The recipient receives an SMS confirmation immediately. Delays can occur during high-traffic periods or if the recipient's wallet has reached its balance limit (currently capped at KES 300,000).

How does M-Pesa compare to USDC on Stellar for sending money to Kenya?

Both settle in under a minute. USDC on Stellar has lower all-in costs (often 0.5-1.5%) but requires the recipient to have an exchange account to cash out. M-Pesa delivers directly to a phone wallet with no crypto knowledge needed, but total costs including FX and float fees typically run 1.5-3%. For recipients without crypto access, M-Pesa is the more practical option. RemitRoutes compares both live.

What is the B2C transaction limit on M-Pesa?

The standard B2C per-transaction limit is KES 150,000 (approximately $1,150 USD). Daily limits for business accounts depend on the tier and agreement with Safaricom or your aggregator. Recipients cannot hold more than KES 300,000 in their wallet at any time, so large payouts may require splitting across multiple transactions.

Compare live rates across 370+ corridors on RemitRoutes · methodology. Last updated 2026-03-08.