M-Pesa Integration Guide

Daraja API setup, STK Push at the POS, payment confirmation, reconciliation in Accounting and the M-Pesa collections report — everything you need to accept mobile money in Vendra.

M-Pesa Module 8 min read Updated June 2026

Vendra's M-Pesa integration connects your point of sale and accounting directly to Safaricom's mobile payment network. Customers pay by entering their PIN on their phone. Vendra receives confirmation automatically and completes the transaction — no manual checks, no calling the cashier to verify an SMS.

M-Pesa integration in Vendra is specific to Kenya and the Safaricom network. It uses the Safaricom Daraja API and requires a registered Paybill number or Buy Goods till. Businesses outside Kenya should use Vendra's other payment methods.

What the M-Pesa integration does

The integration uses the Safaricom Daraja API to trigger an STK Push (SIM Toolkit Push) payment request directly to the customer's phone. The cashier initiates the request from the POS screen. The customer sees a prompt on their phone, enters their M-Pesa PIN, and the payment is confirmed. Vendra listens for the confirmation callback from Safaricom and automatically marks the POS order as paid.

This eliminates the main pain point of manual M-Pesa collection — cashiers do not need to wait for an SMS confirmation message from the customer, and there is no risk of accepting a fake or forwarded SMS. The payment is confirmed directly by Safaricom's API.

Setup — Paybill, Consumer Key, Consumer Secret

Before configuring M-Pesa in Vendra, you need the following from Safaricom's Daraja developer portal (developer.safaricom.co.ke):

  • A registered Paybill number or Buy Goods till number linked to your business
  • A Daraja API app with STK Push (Lipa na M-Pesa Online) enabled
  • The Consumer Key for your Daraja app
  • The Consumer Secret for your Daraja app
  • Your Daraja passkey (provided in the Daraja portal after app activation)

Once you have these credentials, go to Accounting → Configuration → Payment Acquirers → M-Pesa in Vendra. Enter your Paybill number, Consumer Key, Consumer Secret and passkey. Save the configuration. You also need to whitelist your Vendra callback URL in the Daraja portal — this is the URL Safaricom sends the payment confirmation to. Your callback URL is shown on the M-Pesa configuration page in Vendra.

How STK Push works at the POS

Once M-Pesa is configured and added as a payment method on your POS terminal, the flow at checkout is as follows:

1. Cashier selects M-Pesa

After adding all products to the order, the cashier clicks Payment. On the payment screen, they select M-Pesa STK Push as the payment method.

2. Enter the customer's phone number

The cashier enters the customer's M-Pesa registered phone number in the format 2547XXXXXXXX (the international format for Kenyan numbers). The amount is pre-filled from the order total.

3. Send the STK Push request

The cashier clicks Send Request. Vendra calls the Safaricom Daraja API, which triggers an STK Push notification to the customer's phone number. The customer sees a prompt on their phone showing the Paybill name, the amount and an input field for their M-Pesa PIN.

4. Customer authorizes the payment

The customer enters their M-Pesa PIN on their phone and confirms. This happens entirely on the customer's device — the cashier does not need to touch anything.

5. Automatic confirmation

Safaricom sends a callback to Vendra confirming the payment. The POS status updates automatically to Confirmed. The cashier clicks Validate to complete the transaction and issue the receipt.

Payment confirmation callback

The callback is the mechanism by which Safaricom notifies Vendra that a payment has been made. When a customer enters their PIN and the payment goes through, Safaricom sends a POST request to your Vendra callback URL with the transaction details — M-Pesa transaction ID, phone number, amount and timestamp.

Vendra receives this callback, matches it to the waiting POS order, updates the payment status to confirmed and records the M-Pesa transaction reference. The entire process typically takes between 10 and 30 seconds from the time the customer confirms on their phone.

For the callback to reach Vendra, your Vendra URL must be publicly accessible (not behind a local network firewall) and the callback URL must be registered in the Daraja portal. Vendra's IT or onboarding team can assist with this if needed.

M-Pesa on Sales invoices

M-Pesa is not limited to POS. From any posted customer invoice in Accounting → Customers → Invoices, you can register a payment using the M-Pesa journal. This covers the scenario where a customer pays a sales invoice directly via M-Pesa transfer to your Paybill, outside of the POS terminal.

Click Register Payment on the invoice, select the M-Pesa journal, enter the payment date and amount, and optionally add the M-Pesa transaction reference in the memo field. Confirm the payment. The invoice is marked paid and the M-Pesa journal reflects the receipt.

Reconciliation in Accounting

Every M-Pesa STK Push confirmed in Vendra creates a payment record in the M-Pesa journal. To reconcile against your Safaricom M-Pesa statement:

  • Download your M-Pesa statement from the M-Pesa Manager portal (for Paybill holders)
  • Go to Accounting → Accounting → Bank Statements
  • Create a new bank statement for the M-Pesa journal and import or manually enter the statement lines
  • Vendra automatically suggests matches between statement lines and the M-Pesa payment records created by STK Push
  • Review and confirm matches — any discrepancies (payments recorded in M-Pesa statement but missing from Vendra, or vice versa) are flagged for investigation
  • Mark the statement reconciled when all lines are matched

STK Push at POS

Cashier enters phone number, customer receives push notification, PIN confirmation triggers automatic payment completion in Vendra.

Invoice payments

Register M-Pesa payments against any customer invoice manually. Useful for transfers made directly to your Paybill outside of POS.

Automatic journal entries

Every confirmed M-Pesa payment creates an accounting entry automatically. No manual bookkeeping needed for mobile money receipts.

Collections report

The M-Pesa module transactions view shows all payments by date, phone, amount and status. Filter and export for reconciliation or audit.

Failed transactions

A transaction can fail or remain pending for several reasons: the customer does not respond to the push, they enter the wrong PIN, they have insufficient M-Pesa balance, the Safaricom network times out, or the customer cancels the request.

Failed and timed-out transactions appear in the M-Pesa Transactions log (M-Pesa → Transactions) with a status of Failed or Cancelled. The associated POS order remains open and unpaid. The cashier has two options:

  • Select M-Pesa again and resend the STK Push to the same or a different phone number
  • Switch to a different payment method (cash, card or bank) to complete the sale

Failed transactions do not create any accounting entries. They are recorded in the log for audit purposes only.

M-Pesa collections report

The M-Pesa Transactions view (M-Pesa module → Transactions) is the primary report for mobile money activity. Each row shows the transaction date, customer phone number, amount, status and the linked POS order reference.

Filter by date range, status or company to see all confirmed payments for a period. Export the list to Excel or CSV for reconciliation with your Safaricom M-Pesa statement. The total of all Completed transactions for a period should match the corresponding lines on your Safaricom M-Pesa statement.

For a higher-level view, Accounting → Reporting → Invoice Analysis filtered to the M-Pesa journal shows revenue collected via M-Pesa across both POS and invoice payments.

Help centre

Browse all help topics

Step-by-step guides for every Vendra module.

View all topics
FAQ

M-Pesa integration questions

Common questions about setting up and using M-Pesa in Vendra.

Contact support
Is Vendra's M-Pesa integration available outside Kenya?
No. The M-Pesa integration in Vendra uses the Safaricom Daraja API, which is specific to the Kenyan market. M-Pesa STK Push requires a Safaricom Paybill number or till number registered in Kenya. Businesses operating outside Kenya should use the other payment methods available in Vendra (cash, bank transfer, card).
What credentials do I need to set up M-Pesa in Vendra?
You need three things from Safaricom's Daraja developer portal: a Paybill number (or Buy Goods till number), a Consumer Key, and a Consumer Secret. These are obtained by registering an app on the Safaricom Daraja portal at developer.safaricom.co.ke. You also need to whitelist your Vendra callback URL in the Daraja portal.
What happens if the customer does not enter their PIN and the STK Push times out?
If the customer does not respond to the STK Push within the timeout window (typically 60 seconds), the transaction is marked as failed in Vendra's M-Pesa Transactions log. The POS order remains open and unpaid. The cashier can resend the STK Push request, ask the customer to try again, or switch to a different payment method to complete the sale.
How does M-Pesa reconciliation work in the Accounting module?
When an M-Pesa payment is confirmed via STK Push, Vendra automatically creates a payment record in the M-Pesa journal in Accounting. When you receive your M-Pesa statement from Safaricom, import it as a bank statement in Vendra and run reconciliation. The system matches confirmed STK Push payments against the statement lines and highlights any discrepancies.
Can M-Pesa be used for invoice payments outside of POS?
Yes. From any posted customer invoice in Accounting, click Register Payment and select M-Pesa as the payment journal. This records the payment manually if the customer paid via M-Pesa outside the POS (for example, a direct transfer to your Paybill). The M-Pesa collections report in Accounting shows all M-Pesa transactions whether they originated from POS or from invoice payments.

Accept M-Pesa at your till — automatically

STK Push confirmation. Automatic journal entries. Reconciliation built in. Start with Vendra today.