M-Pesa integration for websites, apps and systems

Your customer taps Pay, gets the M-Pesa prompt on their phone, enters their PIN, and your system marks the order paid on its own. No screenshots of messages, no checking your phone to confirm, no manual matching at the end of the day.

We build this on Safaricom's Daraja API. We run it in our own products too — Tixa sells event tickets over M-Pesa — so we have already hit the problems your developer would find in production.

What we integrate

STK Push checkout

The customer enters their number and gets the payment prompt on their phone. Works with a till or a paybill. This is what most shops, booking sites and apps need.

Paybill and till payments (C2B)

Customers who pay from the M-Pesa menu instead are matched to their order or account number automatically.

Payouts and refunds (B2C)

Sending money back to customers or out to vendors and agents. This needs a B2C shortcode from Safaricom; we help you get one.

Receipts and reports

SMS or email receipts with the M-Pesa code, and a dashboard showing what was paid, when, and by whom.

Where integrations usually go wrong

Getting a prompt to appear is the easy part. These are the things that cost businesses money after launch, and how we handle each one.

Trusting the callback

Anyone who finds your callback URL can post a fake "payment successful" message to it. We confirm each payment with Safaricom's transaction status before an order is marked paid.

Lost callbacks

Callbacks sometimes never arrive. A scheduled job re-checks pending payments, so the customer who paid still gets their order.

Paying twice

Impatient customers tap Pay again. Orders are locked while a prompt is pending, and a duplicate callback can never credit an order twice.

"Who is this?" cancellations

The prompt shows the name on your till, which is often not your brand. If customers don't recognise it, they cancel. We name it on the checkout page before the prompt appears.

How it works

1

Look at your setup

Your till or paybill, your current site or app, and how orders flow today.

2

Build on sandbox

Everything is built and tested against Safaricom's test environment first.

3

Go live

We help with the Daraja go-live, then test with real small payments.

4

Reconcile

Daily checks make sure every M-Pesa payment matches an order.

Questions

What do I need from Safaricom before you can integrate M-Pesa?

A till number or paybill registered to your business, and a Daraja account at developer.safaricom.co.ke. We build and test on the Daraja sandbox first, then help you apply to go live, which gives us the production keys and passkey for your shortcode.

Can I use a till number, or do I need a paybill?

Both work for STK Push, so customers can pay either one from a prompt on their phone. The difference is in paying money out: sending money to customers or partners (refunds, payouts) needs a B2C shortcode, which a till alone cannot do.

Why do customers sometimes cancel the M-Pesa prompt?

Usually because the name on the prompt does not match the shop they think they are paying. The prompt shows the name registered on your till, not your brand. We make your checkout say that name before the prompt arrives, so customers know it is you.

What happens if the payment callback never arrives?

We never rely on the callback alone. Every pending payment is checked against Safaricom's transaction status, and a scheduled job reconciles anything left over, so a lost callback does not become a lost order or a free order.

Can you add M-Pesa to a website someone else built?

Usually yes, if we can get access to the code and hosting. We look at the system first and give you a fixed price for the integration.

How much does M-Pesa integration cost?

It is included in our Automated Shop package at KES 90,000. Adding it to an existing system is quoted after we have seen the code, because the work depends on how the site handles orders today.

Want customers to pay with M-Pesa?

Tell us what you sell and where. We'll tell you what it takes.

Chat with Us