·Motion Devs EngineeringFintechM-Pesa
M-Pesa reconciliation: the part every integration tutorial skips
Every Daraja tutorial ends at the successful STK push callback. Production starts there.
Callbacks fail silently, arrive twice, or land minutes late. If your system marks invoices paid only on callback receipt, you will eventually take money without recording it — and hear about it from an angry customer.
The fix is a reconciliation loop: store every initiated transaction, poll the transaction status API for anything unresolved after a timeout, and run a daily sweep comparing your ledger against C2B statement pulls. Match on the M-Pesa receipt number, never on amount and phone alone.