Digital Africa11 min read

Integrating M-Pesa Daraja STK Push at checkout in Nairobi 2026

Mohamed Bah·Fondateur, Kolonell
August 25, 2026
Share:
Integrating M-Pesa Daraja STK Push at checkout in Nairobi 2026

Integrating M-Pesa Daraja STK Push at checkout in Nairobi 2026

Digital Africa

The verdict in three sentences

In Nairobi, collecting in M-Pesa runs through the Daraja API and its STK Push: the customer gets a prompt on their phone, enters their PIN and confirms. The success rate sits between 85 and 93% in 2026, with confirmation in 5 to 30 seconds via a callback URL. The secret to a reliable integration is ResultCode handling and server-side reconciliation.

The STK Push flow, step by step

STK Push (Lipa Na M-Pesa Online) triggers a payment prompt directly on the customer's phone. Your server initiates the request, M-Pesa pushes the prompt, the customer confirms, then M-Pesa calls your callback.

StepWhat happensDuration (est.)
1. OAuth authGet token via key/secret< 1 s
2. STK Push initSend amount, number, reference1-2 s
3. Mobile promptCustomer sees prompt and enters PIN5-25 s
4. CallbackM-Pesa notifies your CallBackURL1-3 s
5. ReconciliationCheck ResultCode, mark paid< 1 s

Never validate the order on the init's immediate return: only the signed callback confirms the real payment.

Handling ResultCodes

Every attempt returns a ResultCode that drives your logic. Here are the most frequent cases and the action to plan.

ResultCodeMeaningAction
0Payment successfulMark paid, send receipt
1Insufficient balanceOffer another provider
1032Cancelled by userRetry or offer fallback
1037Timeout / no responseRetry STK Push once
2001Wrong PINPrompt to retry
1019Transaction expiredRegenerate a prompt

Codes 1032 and 1037 make up most failures: a fallback offered at the right moment recovers a good share of these payments.

Till vs Paybill fees

The choice between Till (Buy Goods) and Paybill affects merchant fees and reconciliation. 2026 ballpark figures (estimate).

ModeUseMerchant fee (est.)Reconciliation
Till (Buy Goods)Direct sale~0.5-1.5%by amount
PaybillInvoices, references~0.5-1.5%by customer reference
B2C (payouts)Paying out to vendorsfixed fee per bandby batch

Need a professional website?

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

Mini case study

Wanjiru runs an online grocery in Nairobi and processes 700 STK Push payments a month. At a raw 88% success rate, 84 payments fail. Adding an automatic fallback on codes 1032 and 1037, she recovers about 45% of those failures, i.e. 38 orders saved. At a 900 KES average basket, that is 34,200 KES of recovered revenue every month, with no extra acquisition.

FAQ

How long does an STK Push confirmation take?

Between 5 and 30 seconds depending on customer and network responsiveness. Plan a waiting screen on the client and a server reconciliation triggered by the callback, never by a mere timer.

What about timed-out payments (code 1037)?

Retry the STK Push once, then offer a fallback if the failure persists. These timeouts make up a large share of failures and recover well.

Till or Paybill for a store?

Till (Buy Goods) is enough for a simple direct sale; Paybill is preferable if you must match each payment to a customer reference or an invoice.

Can the 85-93% success rate be improved?

Yes, a good prompt design, targeted retries and an automatic fallback push it toward the top of the range by recovering cancellations and timeouts.

Let's talk about your project. We integrate Daraja, handle ResultCodes cleanly and set up callback-based reconciliation. WhatsApp +221 77 596 93 33.

Tags:#mpesa#daraja api#stk push#kenya#payment integration#mobile checkout
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.