E-commerce11 min read

Integrating the M-Pesa Daraja API for Nairobi Checkout: A 2026 Developer Guide

Mohamed Bah·Fondateur, Kolonell
August 5, 2026
Share:
Integrating the M-Pesa Daraja API for Nairobi Checkout: A 2026 Developer Guide

Integrating the M-Pesa Daraja API for Nairobi Checkout: A 2026 Developer Guide

E-commerce

The verdict in three sentences

The M-Pesa Daraja API is the fastest route to online payments in Nairobi, built around STK Push (the push prompt sent to a customer's phone) and a signed callback URL. Integration takes roughly 2 to 5 developer days, centred on an OAuth token valid for one hour that you refresh before each batch of requests. The real bottleneck is not code but the 3 to 7 business day paybill/till onboarding with Safaricom, so start that before writing a line.

Integration steps and their duration

Daraja follows a clear flow: obtain an OAuth token, trigger an STK Push, and confirm the order only when the signed callback arrives. Never confirm an order on the client-side response alone.

StepPrerequisite2026 estimate
Register on Daraja portalSafaricom line, ID1 day
Paybill / till onboardingBusiness registration, KRA PIN3-7 business days
Sandbox app + keysPortal accountImmediate
OAuth token endpointConsumer key/secret0.5 day dev
STK Push requestShortcode + passkey1 day dev
Callback URL handlerPublic HTTPS URL1 day dev
Sandbox testingTest MSISDN1-2 days

API fields and 2026 fees

STK Push needs only a few fields, which keeps integration short. Here are the key parameters and a fee order of magnitude.

ElementValue / field2026 note
AmountInteger in KESMin 1 KES
BusinessShortCodePaybill/tillSandbox: 174379
CallBackURLHTTPSRequired
AccountReferenceYour order IDUsed for idempotency
Till fee0-0.55 %Merchant side, estimate
SettlementT+1To M-Pesa/bank
OAuth tokenValid 1 hourRefresh before expiry
CallbackSigned POSTValidate before fulfilling

Mini case study

Joseph runs a sneaker store in Kilimani, Nairobi. He sells about 90 pairs a month at KES 6,500, roughly KES 585,000 in online revenue. At a 0.55 % till rate, his monthly payment fees are about KES 3,217. Had he used a 2 % card gateway, he would have paid KES 11,700, so KES 8,483 saved every month (over KES 100,000 a year). Picking the right rail is a margin decision, not an accounting detail.

Need a professional website?

Kolonell builds websites that attract clients, optimized for the Sénégalese market. Free quote in 2 minutes.

FAQ

How long until I am live with Daraja?

Expect 2 to 5 developer days, but plan mainly for the 3 to 7 business day paybill or till onboarding with Safaricom. Most stores go live within about 10 calendar days.

What are the real merchant fees in 2026?

The order of magnitude is 0 to 0.55 % on till transactions, among the lowest for Kenyan mobile money. Always confirm your merchant agreement, as tiers vary by volume.

Can I test without production access?

Yes. The sandbox provides keys and shortcode 174379 with test MSISDNs to simulate success and failure before go-live, usually within 1 to 2 days.

Is the callback really mandatory?

Yes. The client response can be interrupted or spoofed; only the signed callback should trigger final order confirmation, after you validate it.

Let's talk about your project. We integrate the M-Pesa Daraja API for your Nairobi store in under a week, onboarding included. WhatsApp +221 77 596 93 33.

Tags:#Wave API#M-Pesa Daraja#integration paiement#checkout#Abidjan#Nairobi#STK Push#mobile money
Share:

Mohamed Bah

Fondateur, Kolonell

Passionate about digital and entrepreneurship in Africa, Mohamed has been helping Sénégalese businesses with their digital transformation since 2020. Founder of Kolonell, he believes every SME deserves a professional and accessible online présence.