Automating M-PESA Payment Reconciliation: Stop Matching Statements by Hand
How to automatically match Paybill and Till payments to invoices, customers and accounts — and handle wrong references, partial payments and overpayments.

For many Kenyan businesses, M-PESA is the main payment channel. Yet in countless offices, someone still downloads statements, scrolls through hundreds of lines and ticks off payments against invoices in a spreadsheet. It is slow, error-prone and delays receipts to customers. Automation solves it.
Why manual reconciliation breaks down
- Customers type the wrong account number or none at all.
- One customer pays several invoices in one transaction — or one invoice in several instalments.
- Someone else pays on the customer's behalf from a different phone number.
- Payments arrive on weekends and at night, but are only processed during office hours.
- Staff time spent matching could be spent serving customers.
How automated reconciliation works
- Capture every payment in real time using C2B confirmation URLs for direct Paybill/Till payments and STK Push callbacks for checkout payments.
- Match automatically using rules: exact account reference → invoice; phone number → customer; amount and date → open invoice.
- Allocate the payment to one or more invoices, handling partial payments and overpayments as credit.
- Notify the customer instantly by SMS, email or WhatsApp with a receipt.
- Queue exceptions — payments that cannot be matched go to a short review list instead of being lost.
- Post to accounting and, where required, issue the KRA eTIMS invoice.
Design tips for cleaner matching
- Use Paybill account references that are short and meaningful — invoice number, admission number, house number or member number.
- Prefer STK Push at checkout so the reference is filled in automatically — see STK Push explained.
- Validate references with a C2B validation URL where your setup allows, rejecting obviously wrong account numbers.
- Store the M-PESA receipt number as a unique key to prevent double posting.
- Run a daily statement check against M-PESA records to catch anything a callback missed.
Industry examples
- Schools: fees paid with admission numbers post straight to the student ledger and parents receive SMS receipts — see school management.
- SACCOs and lenders: repayments update loan balances and penalties instantly — see loan management and chama software.
- Landlords: rent is matched by house number and arrears update automatically — see rent management.
- Online businesses: orders and hosting invoices are marked paid in seconds through WooCommerce and WHMCS integrations.
Bank payments too
Many businesses also receive bank transfers and card payments. The same rules-based approach works with bank statements and APIs through our banking integrations, giving finance a single view of all collections.
The payoff
- Hours of manual work saved every week.
- Customers receive receipts instantly, reducing "have you received my payment?" calls.
- Accurate, real-time cash position for management.
- Clean audit trail for tax and compliance — see our eTIMS compliance checklist.
Developers can find API details on Safaricom's Daraja portal and in our Daraja integration checklist. Want it done for you? Explore M-PESA integration or talk to our team.
Share this article
Was this article helpful?
Your vote helps us write better guides.
