Vendra's M-Pesa integration uses Safaricom's Daraja API to initiate STK Push requests directly from the POS screen or from a customer invoice. When a customer authorises the push on their phone, Vendra receives a real-time callback and automatically confirms the payment — no manual reconciliation required at the point of sale. This guide covers the one-time setup and the day-to-day payment flow.
Steps to set up and receive M-Pesa payments
Set up a Safaricom Daraja API account
Go to developer.safaricom.co.ke and register for a developer account if you don't already have one. Once logged in, create a new app and note your Consumer Key and Consumer Secret. These are the API credentials Vendra uses to authenticate with Safaricom.
For live payments you will also need a Safaricom Lipa na M-Pesa shortcode (paybill number or till number), a Passkey (provided by Safaricom for your shortcode), and your shortcode must be approved for STK Push. Contact Safaricom Business or your M-Pesa aggregator to complete go-live if you haven't already.
Configure M-Pesa credentials in Vendra
In Vendra, go to Accounting → Configuration → Payment Providers. Find the M-Pesa provider (it is pre-installed). Click on it to open the configuration form. Enter your Shortcode, Consumer Key, Consumer Secret and Passkey in the designated fields.
Set the Callback URL to your Vendra domain — for example https://yourdomain.vendraapp.com/mpesa/callback. This is the URL Safaricom calls when a payment is confirmed or fails. Save the configuration. Switch the provider status from Test to Live when you are ready to accept real payments.
Use Safaricom's sandbox credentials (from developer.safaricom.co.ke) while testing. Sandbox STK Pushes simulate the payment flow without moving real money. Switch to your production credentials only when you are ready to go live.
Add M-Pesa as a POS payment method
Go to Point of Sale → Configuration → Payment Methods. Click New to create a payment method. Set the name to M-Pesa STK Push and set the Type field to M-Pesa STK. Select the M-Pesa accounting journal from the Journal dropdown — this journal records all M-Pesa receipts in your accounts.
Save the payment method. Then go to Point of Sale → Configuration → Point of Sale, open your terminal settings and find the Payment section. Add the M-Pesa STK Push method to the list of accepted payment methods on the terminal. Repeat for each terminal that should accept M-Pesa.
Process an M-Pesa payment at the POS
Open a POS session and add products to the order as usual. Tap the Payment button. On the payment screen, tap M-Pesa STK Push. A phone number field appears — enter the customer's M-Pesa registered phone number in international format: 2547XXXXXXXX (replace the leading 0 with 254).
Tap Send Request. Vendra calls the Daraja API and Safaricom sends an STK Push notification to the customer's phone. The customer sees a prompt asking them to enter their M-Pesa PIN to pay the displayed amount. The POS screen shows a "Waiting for confirmation" status while it listens for the callback.
Confirm the transaction
Once the customer enters their PIN and the payment is processed, Safaricom sends a confirmation callback to Vendra. The payment status on the POS screen changes to Confirmed automatically — no cashier action required. Tap Validate to complete the order. The receipt prints or is displayed on screen.
The transaction is also logged in the M-Pesa module: go to M-Pesa → Transactions to see the full details including the phone number, amount, Safaricom confirmation code, and the linked POS order.
Receive M-Pesa payment on a customer invoice
M-Pesa is not just for the POS — you can also collect payment on a standard customer invoice. Open the posted invoice in Accounting → Customers → Invoices. Click Register Payment. In the payment dialog, select the M-Pesa journal from the Journal field.
A phone number field appears. Enter the customer's M-Pesa number and click Send STK Push. The customer receives the payment prompt on their phone. Once they authorise, Vendra marks the invoice as paid automatically and posts the matching accounting entry.
Reconcile M-Pesa transactions in accounting
Each M-Pesa payment creates a journal entry in the M-Pesa journal automatically when the payment is confirmed. For month-end reconciliation, go to Accounting → Accounting → Bank Statements and select the M-Pesa journal. You can import your Safaricom M-Pesa statement (available from the M-Pesa portal) as a CSV or enter transactions manually.
Vendra's reconciliation engine matches statement lines to the journal entries by amount and date. Review each suggested match and confirm it. Any unmatched lines can be manually reconciled or posted as a new entry. Once all lines are matched, mark the statement as done. Your M-Pesa balance in Vendra will match the Safaricom float statement.