How to Add M-Pesa Payments to Your App in Kenya (2026)
7 min read
A practical guide to accepting M-Pesa in your app or website in Kenya, comparing Daraja and Paystack on fees, setup steps, documents and payment reliability.
To add M-Pesa payments to your app or website in Kenya, you either connect directly to Safaricom's Daraja API using your own Paybill or Till number, or you go through a payment gateway such as Paystack, which handles M-Pesa and cards for you. Paystack Kenya lists 1.5% per M-Pesa payment, with no setup or monthly fees.
I have set out both routes below, with the fees and rules as Safaricom and Paystack published them on 5 November 2026. Prices change, so check each provider's page before you commit.
Should I use Daraja directly or a payment gateway?
Daraja is Safaricom's developer platform for M-Pesa. It is now on version 3.0, and Safaricom says the ecosystem has more than 105,000 developers and over 66,000 integrations (TechCabal). Going direct gives you the most control and a lower fee on collections, and the money lands in your own Paybill or Till.
A gateway such as Paystack sits between you and the networks. You write one integration and accept M-Pesa, cards and other channels through it. In exchange you pay a higher fee per payment and wait for settlement on the gateway's schedule.
- Go direct to Daraja if you already have a Paybill or Till, a developer comfortable with server work, and most of your volume comes through M-Pesa.
- Use a gateway if you want cards and M-Pesa in one checkout, you have not registered a business yet, or you want to start taking payments quickly.
What does each option cost?
These are the published rates on 5 November 2026:
- M-Pesa Business Till (direct): Safaricom charges the business a maximum of 0.55% per payment, capped at KES 200, and collections of KES 200 and below are free. Customers pay nothing to pay a till, except at fuel stations (Safaricom Business Till).
- Paystack, M-Pesa: 1.5% per transaction, with no integration or maintenance fee (Paystack Kenya pricing).
- Paystack, cards: 2.9% per local card payment and 3.8% per international card payment.
- Paystack settlement: automatic, to your bank account or M-Pesa wallet, two working days after the payment (T+2).
Paybill tariffs are different from till tariffs and sit in Safaricom's tariff guide, so check the current table if you need a Paybill for payments tied to an account number, such as rent or school fees.
As an example, say you sell a KES 1,500 online course. On a till, the most Safaricom takes is 0.55%, about KES 8. Through Paystack's M-Pesa channel, 1.5% comes to KES 22.50. On ten sales a day the gap is small. On thousands of sales a month it adds up, which is why many teams start on a gateway and move high-volume M-Pesa payments to Daraja later.
How do I integrate M-Pesa with the Daraja API?
- Get a business shortcode. Apply for a Business Till on the Lipa na M-PESA application portal. Safaricom says applications in the individual category are processed within 10 minutes and other categories within 24 hours. A Paybill suits payments that carry an account number.
- Create a Daraja account and a sandbox app on the Daraja portal. The sandbox lets you simulate payments before any live money moves.
- Build M-Pesa Express, also called STK Push. Your server asks Daraja to send a payment prompt to the customer's phone. The customer enters their M-Pesa PIN, and Daraja sends the result to a callback URL on your server.
- Add the other APIs you need. Safaricom's API page describes customer-to-business payments with an optional validation step, so a Paybill can check the account number and amount before it accepts a payment. It also covers business-to-customer payouts and automated reversals (Safaricom M-PESA API).
- Apply to go live from the portal with your production shortcode and the APIs you plan to use. Ask only for what you need.
How do I accept M-Pesa through Paystack?
Paystack's M-Pesa channel sends the same kind of prompt to the customer's phone. Your server calls Paystack's charge API with the customer's phone number in international format, so 0722000000 becomes +254722000000. The customer approves on their phone, and Paystack sends a charge.success event to your webhook. For mobile money, Paystack's documentation says customers must complete the payment within 180 seconds or it fails, and that you should call its Verify Transaction endpoint if the webhook has not arrived by then (Paystack payment channels).
Before you take live payments, Paystack checks your documents. A starter business, meaning one that is not registered yet, needs a national ID or passport and a personal bank or mobile money account. A registered company needs its certificate of incorporation, CR12, company KRA PIN and a business bank account in the company's name (Paystack Kenya compliance requirements). Starter businesses in Kenya have a KES 600,000 collection limit, after which payments pause until you upgrade to a registered business (Paystack Starter Business).
Why do M-Pesa payments fail in apps, and how do I prevent it?
- Trusting the callback alone. Callbacks sometimes fail to arrive. Record every payment request as pending, then confirm it with the provider's status or verify endpoint before you mark the order paid or failed.
- Double charges. A customer who sees nothing happen taps Pay again. Give every order a unique reference and block a second prompt while one is pending.
- A blank screen while the customer waits. Tell them what to do ("Check your phone and enter your M-Pesa PIN"), then show a clear result: paid, cancelled or timed out.
- Phone numbers in the wrong format. Convert every number to international format on your server before you send it.
- Amounts taken from the browser. Compare the amount in the confirmation with the order total stored on your server.
- Skipping reconciliation. Once a day, match your orders against your M-Pesa statement or the Paystack dashboard. Each mismatch is a customer who paid and got nothing, or got something without paying.
If you want a desk with stable internet for a day of integration work, a Hackhouse day pass is KES 1,000, and our coworking plans start at KES 10,000 a month for a hot desk. The events calendar shows what else is on at the house.
Key facts
- Daraja 3.0 is Safaricom's M-Pesa developer platform, with a sandbox for testing before you go live.
- Business Till: up to 0.55% per payment, capped at KES 200, and free on collections of KES 200 and below.
- Paystack Kenya: 1.5% per M-Pesa payment, 2.9% for local cards and 3.8% for international cards, with no setup or monthly fee.
- Paystack settles two working days after a payment (T+2).
- Paystack starter businesses in Kenya can collect up to KES 600,000 before they must upgrade to a registered business.
- Confirm every payment on your server with the provider's status or verify call before you deliver.
Frequently asked questions
Do I need a registered business to accept M-Pesa payments online?
Not to start. Paystack's starter business tier accepts a national ID and a personal account, up to a KES 600,000 limit, and Safaricom has an individual category for Business Till applications. Plan to register your business as volumes grow.
How long does it take to go live with M-Pesa on Daraja?
You build and test in the sandbox, then submit a go-live request with your shortcode. Safaricom's portal does not publish a fixed approval time, so leave room for it in your launch plan.
Can I accept M-Pesa on a website without a mobile app?
Yes. STK Push works from any website or app with a server behind it. The customer types their phone number at checkout and approves the payment on their phone.
What is the cheapest way to accept M-Pesa?
On published rates, a direct Business Till costs the business up to 0.55% per payment and nothing on payments of KES 200 or less. A gateway costs more per payment and saves you integration and support work, so weigh the developer time against the extra fee.
Sources
- Pricing (Kenya), Paystack, checked 5 Nov 2026
- Payment Channels, Paystack, checked 5 Nov 2026
- Compliance requirements for Kenya, Paystack, checked 5 Nov 2026
- What is a Paystack Starter Business, Paystack, checked 5 Nov 2026
- M-PESA Business Till, Safaricom, checked 5 Nov 2026
- M-PESA API, Safaricom, checked 5 Nov 2026
- Daraja Developer Portal, Safaricom, checked 5 Nov 2026
- Safaricom upgrades M-PESA backbone as API transactions hit 25%, TechCabal, checked 5 Nov 2026
Go deeper with us. Join the Hackhouse community for conversations that go beyond the surface, where builders share the hard-won lessons that never make it into press releases.
Share this post
