Skip to content
M-Pesa & Payments

How to Reconcile M-Pesa Payments With Orders and Invoices

8 min read

On this page
  1. Why reconciliation breaks
  2. Account references that work
  3. A manual reconciliation routine
  4. Automated matching with callbacks
  5. Handling overpayments and partial payments
  6. The report your accountant actually wants
  7. Reconciliation inside a CRM or ERP
  8. Next step

M-Pesa reconciliation means proving that every payment into your Till or Paybill matches an order, an invoice or a known reason, and that every order marked paid has a real payment behind it. Done well, it is a ten-minute daily habit. Done badly, it is the reason your bookkeeper dreads month end and customers keep sending screenshots of messages "proving" they paid.

This guide goes from the cheapest fix (better account references) to full automation, with the awkward cases in between.

Why reconciliation breaks

When businesses tell us their M-Pesa records do not tie up, the cause is nearly always one of these:

  • No reference. Payments to a Till, or Paybill payments where the customer typed "fees" or their own name as the account.
  • Same amount, same hour. Three customers pay KES 1,500 on a Saturday morning. Which one is order 204?
  • Someone else paid. A husband pays for his wife's order, a company accountant pays for an employee's course, a cousin in Nairobi pays a Kisii student's fees. The name on the statement matches nobody on file.
  • Split and combined payments. One invoice paid in three instalments, or two invoices paid with one transfer.
  • Records in different places. Orders in WooCommerce, invoices in Excel, payments in an SMS inbox on the manager's phone.

Software can fix the last one. The first four are fixed by habits, and the most important habit is the reference.

Account references that work

A reference is whatever links a payment to what it is for. On a Paybill it is the account number the customer types. On STK push it is the reference your system sends with the request. On a Till there is no field, which is why Tills are harder to reconcile for anything other than checkout payments; we compare the two in Till vs Paybill for a website.

Rules for good references

  1. One reference, one thing. An invoice number (INV2310) or a customer number (C0458), not "January payment".
  2. Short and typeable on a phone keypad. Digits and a few capital letters. No spaces, slashes or dashes.
  3. Printed everywhere the customer looks: invoice header, order confirmation, SMS reminder, WhatsApp message.
  4. Decide in advance what a customer number means. If someone pays with their customer number instead of an invoice number, the system should apply it to their oldest unpaid invoice. Write that rule down.
  5. Tolerate small typing errors. A good system flags "INV231O" (letter O) as a probable match for INV2310 instead of silently ignoring it.

A manual reconciliation routine

Many businesses run on manual matching for years, and that is fine if it is systematic. Here is a routine that works with nothing more than a spreadsheet.

Daily (10–20 minutes)

  1. Export yesterday's transactions from the M-Pesa organisation portal.
  2. For each payment, look up the reference in your order or invoice list. Mark matches with the M-Pesa receipt code.
  3. Anything without a clear match goes to a separate "unidentified" tab with code, amount, time and payer name.
  4. Release goods or services only for matched payments.

Weekly

  1. Work the unidentified tab: call or message likely payers, check for payments on the wrong invoice.
  2. List orders marked paid with no receipt code. These are the dangerous ones, since someone released goods on trust or on a screenshot.

Month end

  1. Total the statement and total your matched records. The difference should equal the unidentified list plus charges.
  2. Agree the closing balance and any transfers to the bank with the bank statement.
  3. Hand the matched report to your accountant for the books and for KRA records.

A worked example

Say a Machakos hardware shop's statement for one week shows 62 payments totalling KES 418,700. Matching by invoice number clears 55 of them (KES 371,200). Four more are matched by phone number to regular customers (KES 31,000). Three remain: KES 9,000, KES 4,500 and KES 3,000 with names nobody recognises. Those KES 16,500 go to the unidentified list. The weekly check then finds that the KES 9,000 was a contractor paying for his site foreman. Two items, KES 7,500, carry forward. Nothing is guessed, and the totals tie exactly. The figures are invented for illustration, but the method is real.

Automated matching with callbacks

Once volume grows, the daily routine becomes the bottleneck. Automation removes it by letting Safaricom tell your system about each payment the moment it happens.

  • STK push callbacks report the outcome of every prompt your website sends, with the reference already attached. These match themselves. See how STK push confirms payment if you want the detail.
  • C2B confirmations report payments customers make from the M-Pesa menu to your shortcode, including the account number typed on a Paybill. Your system applies the same matching rules a person would.

Automation should never discard what it cannot match. It should put those payments in an exceptions queue for a person, exactly like the unidentified tab above. The win is that staff look at the five exceptions, not all two hundred payments.

Keep a monthly check against the downloaded statement even when automation is running. Callbacks can be missed during outages or server moves, and the statement is the source of truth. A gap between the two is your early warning.

If you are still choosing how payments come in at all, our comparison of M-Pesa payment options explains how each route affects reconciliation, including the double step aggregators add.

Handling overpayments and partial payments

Decide these rules once and configure them, rather than letting each staff member improvise.

SituationSensible default
Payment less than invoiceApply it; invoice becomes "part paid" with balance shown on the next reminder
Payment more than invoiceClear the invoice; hold the extra as customer credit and tell the customer
One payment for two invoicesApply to oldest first unless the customer says otherwise
Payment with a customer number onlyApply to oldest unpaid invoice for that customer
Duplicate payment (paid twice by mistake)Hold as credit; refund on request and record the refund separately
Payment reversed by SafaricomRecord the reversal as its own transaction; reopen the invoice

Never edit or delete the original payment record to make the numbers look right. Corrections are new entries, so the history explains itself to an auditor.

The report your accountant actually wants

Reconciliation ends with a document someone else can check. Accountants and auditors do not want a screenshot of your dashboard; they want a table they can tick against the statement. For each month, aim to produce one export with these columns:

  • M-Pesa receipt code and transaction date and time
  • Amount received and any charges deducted
  • Reference or account number as received
  • Invoice, order or loan it was applied to
  • Status: matched, part-applied, credit, unidentified, reversed or refunded
  • Who matched it (system or a named staff member) and when

Add a one-line summary at the top: opening balance, total received, total charges, transfers to bank, closing balance. If those five numbers agree with the organisation portal statement, the month is closed. If they do not, the detail below shows exactly where to look.

Keep these monthly files somewhere backed up, not only on one laptop. Questions about a payment often come months later, from a customer, a KRA review or a partner in a dispute.

Reconciliation inside a CRM or ERP

The real goal is that the payment lands where the invoice already lives. If your invoices are in a CRM, payments should post there; if loans are in a loan system, repayments should post there.

  • Service businesses issuing quotes and invoices benefit from invoice software that records M-Pesa receipt codes against each invoice. Our Edgecom CRM handles quotes, invoices and client records, and our guide to quotation and invoicing software covers what to look for in any tool.
  • SACCOs and microfinance lenders need repayments posted to the right loan and split between principal, interest and fees. That logic belongs in loan software such as Microfin or an equivalent, not in a spreadsheet.
  • Retailers on an ERP or accounting package can usually import a statement file, but matching rules still need setting up.

Remember that matching a payment is not the same as issuing a tax invoice. KRA's eTIMS requirements apply separately; confirm with your accountant or KRA how your sales should be invoiced.

Next step

If your team spends hours a week matching M-Pesa messages to invoices, that is a system problem worth solving. Our system development service builds payment matching, exception queues and reports into the tools you already use, or into a new one where needed.

FAQ

Questions about this topic

Statements for a Till or Paybill are available through the M-Pesa organisation portal for that shortcode, where users with the right role can search transactions and export them for a date range. Exact menus change from time to time, so if you cannot find the option, ask whoever administers the portal or contact Safaricom's business support. Personal M-Pesa statements are requested separately through the M-Pesa app or menu.

Match payments daily if you release goods or services against them, because a missed payment means an unhappy customer today. Do a full reconciliation of the statement against your records at least weekly, and a formal close at month end before your accountant prepares returns. Automated matching shortens the daily step but does not replace the monthly close.

Record it in a suspense list with the receipt code, amount, date and payer name shown on the statement, and do not post it to any customer yet. Try the payer's phone number from your records, or wait for the customer to call asking where their payment went. If nobody claims it after a reasonable period, ask your accountant how to treat it.

Ready to build something great?

Tell us what you need. We'll come back with a fixed-scope proposal within one business day.

Start a conversation