The verdict in three sentences
An M-Pesa STK push fails in silence: if the customer doesn't enter their PIN within 60 to 120 seconds, the prompt expires without any clear signal to you. The result is 15 to 25 % abandonment among customers who actually wanted to pay. A clean state machine plus one well-calibrated retry recover on average +18 % of successes.
The anatomy of an STK timeout
When you trigger an STK push, Safaricom sends a menu to the customer's phone. Until they enter their PIN, the transaction stays pending. The problem: network, battery, an incoming call or hesitation push past the window.
| Parameter | 2026 order of magnitude | Impact |
|---|---|---|
| Validation window | 60-120 s | Beyond: timeout |
| Prompt abandonment rate | 15-25 % | Lost sales |
| Polling interval | 5-10 s | Detect the status |
| Gain after 1 retry | +18 % | Recovered successes |
| Delay before retry | 30-60 s | Not too early, not too late |
Without polling, your back office stays stuck on pending and you never know whether the customer paid, abandoned, or is still entering their PIN.
The state machine to implement
A payment is not binary. Model it as a sequence of explicit states, each triggering an action.
| State | Trigger | Action |
|---|---|---|
| initiated | Customer taps pay | STK push sent |
| pending | Prompt displayed | Poll every 5-10 s |
| timeout | 120 s without PIN | Offer retry |
| confirmed | PIN validated | Fulfill + receipt |
| failed | Insufficient funds / decline | Clear message + alternative |
The key: distinguish timeout (recoverable by retry) from failed (definitive failure). Retrying a failed for insufficient funds annoys the customer; retrying a timeout recovers the sale.
Mini case study
Wanjiru sells data bundles in Nairobi via an M-Pesa payment page. On 500 attempts one Saturday, 110 hit timeout (22 %). She thinks she lost 110 sales of KES 200, i.e. KES 22,000.
She enables an automatic retry 45 seconds after timeout, with an SMS: "Your payment didn't go through, dial the STK prompt again to finish." The +18 % gain on timeouts recovers 20 sales (110 x 18 %), i.e. KES 4,000 more per Saturday, KES 16,000/month with no extra ads. Polling every 8 seconds also stops her from fulfilling before confirmation.
Need a professional website?
Kolonell builds websites that attract clients, optimized for the Sénégalese market. Free quote in 2 minutes.
FAQ
Why does the status stay stuck on pending?
Because the customer hasn't entered their PIN yet and the 60 to 120 s window is still running. Polling every 5 to 10 seconds tells you in real time whether the transaction flips to confirmed or timeout.
When should I retry without harassing the customer?
Wait 30 to 60 seconds after the timeout, then offer a single clear retry. An immediate retry arrives before the first prompt has expired network-side and creates confusion, even a double charge.
Polling or webhook for STK?
Both: the webhook is the source of truth when it arrives, polling covers the 1 to 2 % of cases where it doesn't. For STK, polling is essential because validation depends on an unpredictable manual action.
How do I avoid fulfilling on a timeout?
Never fulfill on the pending or initiated state: wait strictly for confirmed. An unhandled timeout that resolves late to confirmed can happen, which is why you keep the order open for 24h.
Can a timeout become a real payment later?
Yes: sometimes the customer validates at the last moment and the confirmed arrives after you flipped to timeout. Keep the transaction reconcilable for 24h and match it against the next day's settlement.
Let's talk about your project. We wire an STK state machine with polling and smart retry to recover your abandoned payments. WhatsApp +221 77 596 93 33.
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.
