E-commerce11 min read

Handle M-Pesa callback failures with a retry strategy in 2026

Mohamed Bah·Fondateur, Kolonell
August 25, 2026
Share:
Handle M-Pesa callback failures with a retry strategy in 2026

Handle M-Pesa callback failures with a retry strategy in 2026

E-commerce

The verdict in three sentences

On mobile money, the callback (webhook) can be lost: network drop, timeout, a momentarily unavailable server — and a lost callback becomes a phantom order, paid but never confirmed. The right decision is not "webhook only" but webhook + fallback polling: if no callback arrives, your server actively queries the status API. Add an exponential retry and a dead-letter queue after 5 attempts so no event is ever lost.

Webhook only vs webhook + polling

Webhook-only is optimal when the network is perfect. On African 3G markets it is not: fallback polling queries the provider's query status API for orders left pending.

ApproachCoverageServer loadPhantom-order risk
Webhook only~95 %LowHigh on lost callback
Polling only~99 %HighLow but costly
Webhook + polling~99.9 %ModerateNear zero

Retry, dead-letter and M-Pesa codes

When your webhook processing fails, replay with exponential backoff 1 / 5 / 25 minutes, then move to a dead-letter queue after 5 attempts for manual inspection. In parallel, polling queries the status every 30 seconds for 10 minutes after the payment is initiated.

Parameter2026 valueRole
Retry 1+1 minFast recovery
Retry 2+5 minShort outage
Retry 3+25 minExtended outage
Dead-letterafter 5 attemptsManual inspection
Polling interval30 sCallback fallback
Polling duration10 minPayment window
M-Pesa ResultCode 0SuccessConfirm order
M-Pesa ResultCode 1032Cancelled by userRelease the basket
M-Pesa ResultCode 1037Timeout (no response)Poll + retry

Key reading: 1032 = deliberate cancellation (don't insist), 1037 = timeout (query the status via the fallback API before concluding failure).

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

Fatou, who runs an online grocery in Thiès, receives 800 Orange Money payments/month. About 3 % of callbacks were lost (24 orders/month), half of which were genuinely paid: 12 phantom unshipped sales, average basket 12,500 FCFA, i.e. 150,000 FCFA/month of confusion and unhappy customers. With 30-second fallback polling and exponential retry, she recovers 11 of those 12 sales, i.e. ~137,500 FCFA/month, and support stops handling "I paid but got nothing".

FAQ

Why not rely on the webhook alone? Because a callback may never arrive (network, provider timeout). Fallback polling guarantees every initiated order reaches a final status, even without a callback.

What does ResultCode 1037 mean? It is a timeout: the user did not confirm in time or the response was lost. Do not conclude failure immediately — query the status API, since the payment may have succeeded on the operator side.

How long should I poll? Every 30 seconds for 10 minutes covers almost all mobile money payments. Beyond that, the order enters long-pending and a daily reconciliation takes over.

What is the dead-letter queue for? After 5 failed attempts, the event is placed there for manual inspection rather than lost. It prevents a transient bug from silently erasing a payment.

Should 1032 be treated as a failure? Yes but without retry: 1032 is a deliberate user cancellation. Release the reserved basket/stock and offer to restart the payment.

Let's talk about your project. We make your Orange Money and M-Pesa payments resilient: tested retry, dead-letter and fallback polling. WhatsApp +221 77 596 93 33.

Tags:#echec webhook#orange money retry#mpesa callback#polling paiement#dead letter queue#resilience paiement#gestion erreur paiement
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.