M-Pesa reconciliation in ERPNext
If customers pay you by Paybill or Till, someone on your team is probably matching M-Pesa statements to invoices by hand. ERPNext can do most of that for you.
The problem
M-Pesa payments arrive all day, often with a reference that is a name, a phone number or nothing useful. Matching them to the right customer and invoice by hand takes hours, and mistakes show up as customers chased for invoices they have already paid.
Three ways to bring M-Pesa into ERPNext
- Request payment at the counter (STK push). ERPNext's standard M-Pesa integration lets a point of sale user send a payment prompt to the customer's phone. It works with the ERPNext point of sale for companies whose currency is the Kenyan shilling.
- Receive Paybill and Till payments automatically (C2B). With an M-Pesa payments app connected to Safaricom's Daraja API, every payment to your Paybill or Till is recorded in ERPNext as it happens. If the customer used the invoice number or their customer number as the account number, ERPNext can match the payment to the right customer and invoice automatically. Payments it cannot match are left for review in a reconciliation screen.
- Import the M-Pesa statement. Where an API connection is not practical, the M-Pesa statement can be imported into ERPNext's bank reconciliation tool and matched against payments in bulk, with rules for common references.
Setting it up well
- Make the account number work for you. Ask customers to pay using the invoice number or a customer number as the account number, and print it on every invoice. This one change drives most automatic matches.
- Use an M-Pesa clearing account. Treat M-Pesa like a bank account in your chart of accounts, and record M-Pesa charges and withdrawals to the bank so the balance always agrees to the Safaricom statement.
- Get your Daraja credentials early. Going live with the Safaricom Daraja API needs an approved app and production credentials, which can take time. Start that process at the beginning of the project.
- Decide how unmatched payments are handled. Agree who reviews them and how often, so they do not pile up.
Other mobile money
The same approach works for Airtel Money, MTN MoMo, telebirr and other wallets. Where there is no suitable API, statement import and matching rules still remove most of the manual work.
Last reviewed October 2026. Tax rules change often. This guide is general information, not tax advice. Check the latest notices from the tax authority or speak to your tax adviser before acting.
Frequently asked questions
Does ERPNext support M-Pesa out of the box?
ERPNext includes an M-Pesa integration for requesting payment from the point of sale. Automatic recording and matching of Paybill and Till payments uses an M-Pesa payments app connected to Safaricom's Daraja API.
Can ERPNext match M-Pesa payments to invoices automatically?
Yes, when customers use the invoice number or customer number as the account number. Payments that cannot be matched are left for your team to allocate in a reconciliation screen.
Do we need Safaricom's approval?
To receive payments through the Daraja API you need an approved app and production credentials from Safaricom. Statement import works without them.
Find out what ERPNext would look like in your business
A 45-minute consultation with our lead consultant. We look at how you run finance and operations today and tell you plainly whether ERPNext is the right fit.