How to Receive M-Pesa Payments in Vendra

Configure the Daraja API, add M-Pesa STK Push to your POS and invoices, confirm payments automatically, and reconcile M-Pesa transactions in your accounts.

7 min read Updated June 2026

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

1

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.

2

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.

3

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.

4

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.

5

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.

6

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.

7

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.

FAQ

M-Pesa payment questions

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

Contact support
Do I need a paybill number or a till number?
Vendra's STK Push integration works with both Lipa na M-Pesa paybill numbers and till numbers (buy goods). You enter your shortcode type when configuring the Daraja credentials. Most retail businesses use a till number (buy goods shortcode). Contact Safaricom Business to apply for either if you don't have one yet.
What if the STK push times out before the customer pays?
Safaricom STK Push requests expire after approximately 60 seconds. If the customer does not enter their PIN in time, the request times out and Vendra marks the payment as failed. You can tap Send Request again to issue a new STK Push. The previous timed-out request does not charge the customer — only a successfully authorised push deducts from their M-Pesa balance.
How does M-Pesa appear in my accounts?
Each confirmed M-Pesa payment creates a journal entry: it debits the M-Pesa account (asset) and credits the sales or receivable account. The M-Pesa journal balance represents your current M-Pesa float. When you withdraw from M-Pesa to your bank, you record a transfer from the M-Pesa journal to the Bank journal in Vendra to keep the balances accurate.
Can I use M-Pesa for both POS sales and customer invoices?
Yes. The same Daraja API configuration and M-Pesa journal are used for both. POS cashiers initiate STK Push from the payment screen; accounts staff initiate it from the Register Payment dialog on an invoice. All transactions appear in the same M-Pesa journal and in the M-Pesa Transactions log in the M-Pesa module.

Ready to accept M-Pesa?

Get started with Vendra and take M-Pesa payments at your POS today.