E-commerce11 min read

Integrate the M-Pesa Daraja API in Nairobi (2026)

Mohamed Bah·Fondateur, Kolonell
August 31, 2026
Share:
Integrate the M-Pesa Daraja API in Nairobi (2026)

Integrate the M-Pesa Daraja API in Nairobi (2026)

E-commerce

The verdict in three sentences

M-Pesa in Kenya (via STK Push on the Daraja API) and MTN MoMo in Cameroon (via RequestToPay) work on the same model: the server triggers a payment prompt on the phone, the customer enters a PIN, a callback confirms. Fees hover around 0.5 to 1.5 % for an M-Pesa Till and ~1.5 % for MTN MoMo. Budget 250,000 FCFA (about 400 USD) for an integration covering collection and refund.

STK Push vs RequestToPay, side by side

Both APIs require getting keys, testing in sandbox, then providing a public callback URL to receive the result. The difference is mostly vocabulary and limits; the logic is twin.

ElementM-Pesa (STK Push)MTN MoMo (RequestToPay)
TriggerSTK Push serverRequestToPay server
Customer actionPrompt + PINPrompt + PIN
Timeout~60 s~60 s
ConfirmationCallback URLCallback URL
SandboxYes (Daraja)Yes
Indicative fees~0.5-1.5 % (Till)~1.5 %

Both require a publicly reachable HTTPS callback URL. In sandbox you simulate test numbers before switching to real numbers in production.

Collection, refund and 2026 figures

Parameter2026 order of magnitudeComment
M-Pesa Till fee~0.5-1.5 %Depends on operator tariff
MTN MoMo fee~1.5 %Depends on merchant contract
STK Push timeout~60 sPrompt expires after
Completion rate~90 %Depends on network and UX
Integration cost250,000 FCFA / 400 USDCollection + refund
RefundDedicated APIIdempotency required

The refund uses a dedicated API (reversal / disbursement). As with collection, each operation must be idempotent to avoid double payouts.

Mini case study

Paul builds a booking app in Nairobi. He collects 200 payments/month via M-Pesa, average ticket 7,500 FCFA, i.e. 1,500,000 FCFA. At ~1 %, he pays about 15,000 FCFA/month in fees. With a 90 % completion rate, roughly 20 prompts fail each month; by adding an automatic prompt reminder he recovers half, about ~10 payments (75,000 FCFA). The refund module, tested in sandbox, avoids disputes by automatically crediting cancellations.

Need a professional website?

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

FAQ

Are STK Push and RequestToPay the same thing?

Conceptually yes: both push a payment prompt to the phone that the customer approves with a PIN. Only vocabulary, limits and callback format differ between M-Pesa and MTN MoMo.

Is a public callback URL mandatory?

Yes, both APIs notify the result asynchronously on a public HTTPS URL. Without a reliable callback you cannot know whether the payment succeeded and risk shipping by mistake.

How does the refund work?

Through a dedicated reversal or disbursement API. It must be idempotent: the same refund reference credits the customer only once, even on a retry.

What completion rate should I target?

Expect ~90 % under normal conditions. The remaining 10 % (timeout, PIN, balance) is partly recovered with a prompt reminder and a clear message inviting the customer to retry.

Let's talk about your project. We integrate M-Pesa and MTN MoMo with collection and refund tested in sandbox. WhatsApp +221 77 596 93 33.

Tags:#M-Pesa#MTN MoMo#Daraja API#STK Push#Nairobi#Yaounde#integration#Kenya
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.