So You Want to Add M-Pesa to Your App
App Development · 8 min read

So You Want to Add M-Pesa to Your App

Adding M-Pesa to your school or hospital app is not just a feature—it's a strategic decision. Here's what you need to know about costs, requirements, and the right way to do it.

Nelson

Nelson

Architect, KEPAS Technologies

March 1, 2026 · 8 min read

A school principal in Nakuru called us last month. He had just spent KES 450,000 on a custom app for his school. Parents could check exam results, see fee balances, and get announcements. But when it came time to pay fees through the app, the only option was a bank transfer. Usage dropped by 70% in the first term. The principal’s question was simple: “Can we just add M-Pesa to it?”

The answer is yes, but it’s rarely as simple as plugging in a new cable. Adding M-Pesa to an app is a decision that touches your budget, your technical setup, and how your users actually behave. Let’s walk through what this really involves.

A school administrator seated at a desk in an office, looking frustrated at a laptop screen showing a school app dashboard. A parent is standing nearby, holding a phone and gesturing as if asking about payment options. Paper fee statements are scattered on the desk.
A school administrator seated at a desk in an office, looking frustrated at a laptop screen showing a school app dashboard. A parent is standing nearby, holding a phone and gesturing as if asking about payment options. Paper fee statements are scattered on the desk.

First, Understand the Scale

M-Pesa is not just a payment method in Kenya; for many, it is the payment method. According to the Communications Authority of Kenya’s Q4 2024-2025 report, there are over 47.7 million active mobile money subscriptions in the country. Safaricom itself reported that in the first half of the 2026 financial year, M-Pesa had 37.9 million monthly active users—more people than were using Safaricom’s core connectivity services.

47.7 Million — Active mobile money subscriptions in Kenya, as reported by the Communications Authority of Kenya for Q4 2024-2025. This is where your parents, patients, and donors already are.

If your app serves Kenyans and asks for money, not having M-Pesa is like opening a shop in Nairobi’s CBD but refusing to accept cash. It creates friction where none should exist. For a school in Kiambu or a clinic in Kisumu, an app without M-Pesa is often an app that gets deleted.

What You Actually Need (It’s More Than Code)

Technically, adding M-Pesa means connecting to Safaricom’s Daraja API. This requires a business to be formally registered in Kenya and to have a Safaricom business account. You’ll need to apply for a PayBill or Till number, which involves paperwork and approval time. Then come the technical pieces: API keys, a Lipa Na M-Pesa Online (LNMO) shortcode, and a passkey.

But the bigger requirement is often overlooked: your app’s architecture. Was it built to handle financial transactions securely? Can it generate and validate unique transaction references? Does it have a clear, auditable record of what was paid, when, and by whom? If the answer to any of these is no, adding M-Pesa isn’t a feature update—it’s a significant rebuild.

A spreadsheet dashboard showing payment reconciliation data: a line chart tracking daily transaction volumes, a table with columns for Transaction ID, Date, Amount (KES), and Status, and summary cards showing total collected fees and successful payment rate.
A spreadsheet dashboard showing payment reconciliation data: a line chart tracking daily transaction volumes, a table with columns for Transaction ID, Date, Amount (KES), and Status, and summary cards showing total collected fees and successful payment rate.

The Cost Question (Be Ready for This)

This is where we have to be direct. If you are asking “how much to just add the button,” you are asking the wrong question. The cost depends entirely on what you are starting with.

  • Scenario 1: Adding to a well-built, modern app. If your app was developed with secure practices and a clear structure, integrating the Daraja API might be a focused project. In the Kenyan market, this could range from KES 80,000 to KES 250,000, depending on complexity.
  • Scenario 2: Fixing an app first. Many apps we see, especially from schools and small NGOs, were built cheaply and fast. They often lack proper security, database structure, or error handling. Adding a payment gateway to this is risky. You might need to spend KES 200,000 to KES 500,000+ to rebuild core parts before M-Pesa can be added safely.

A hospital administrator in Mombasa we worked with faced this. Their patient management app worked fine for records, but its payment module was an afterthought. Adding M-Pesa properly meant redesigning the entire patient billing flow. It was more work, but the alternative—mixing up payments for patient Jane and patient John—was not an option.

Think Android First, But Not Only

Android holds over 90% of Kenya’s smartphone market. Your M-Pesa integration must work flawlessly on the affordable Tecno, Samsung, and Redmi devices that parents and community health workers use. This means testing on slow networks, with limited RAM, and on older Android versions.

However, if your organization also deals with donors, partners, or high-net-worth parents who might use iPhones, you cannot ignore iOS. The Daraja API works there too, but the development and testing effort—and cost—nearly doubles if you need both platforms. For many schools, a well-built Android-only app with M-Pesa is a better first step than a shaky app on two platforms.

A developer's workstation with two phones side-by-side for testing: an Android phone showing the M-Pesa STK Push prompt on screen, and an iPhone showing a successful payment confirmation screen. The developer's hand is pointing at the Android device.
A developer's workstation with two phones side-by-side for testing: an Android phone showing the M-Pesa STK Push prompt on screen, and an iPhone showing a successful payment confirmation screen. The developer's hand is pointing at the Android device.

The One Thing Most People Forget

Reconciliation. M-Pesa will send you money. Your app will record a payment. Your accounting system needs to know about it. Without a smooth, automated way to match incoming M-Pesa transactions to specific student fees or patient invoices, your finance officer will spend hours each week manually checking spreadsheets. A good integration doesn’t just collect money; it tells your backend system exactly what that money is for.

We helped a secondary school in Kajiado link their M-Pesa-integrated app directly to their existing finance software. The result? The bursar cut her weekly reconciliation time from 6 hours to about 30 minutes. That is the real benefit—not the payment itself, but the time and accuracy gained afterwards.

A Practical Way Forward

Before you talk to a developer, do three things:

  1. Get your Safaricom business account and PayBill/Till number application started. This can take weeks, so don’t let it be the last step.
  2. Audit your current app. Can you easily export a clean list of users and their pending invoices? If not, you have foundational work to do.
  3. Define the simplest success. Is it “Parents of Class 8 can pay their trip fee”? Start there, not with “All payments for everything.”
A 3D illustration of a server rack and backend system with glowing connection lines. One line flows from a smartphone icon into a secure server, another line connects that server to a database symbol, and a third line connects to an accounting ledger icon, visualizing the payment data flow.
A 3D illustration of a server rack and backend system with glowing connection lines. One line flows from a smartphone icon into a secure server, another line connects that server to a database symbol, and a third line connects to an accounting ledger icon, visualizing the payment data flow.

Adding M-Pesa is a powerful move. It meets your users where they are and removes a major barrier to using your app. But treat it as a core part of your system’s design, not a last-minute add-on. The goal isn’t just to have the button; it’s to have the confidence that when a parent in Eldoret taps it at 10 PM, the right amount is paid, recorded correctly, and everyone sleeps well.

Want to see what this looks like for your organization?

Talk to Us on WhatsApp
Share

Ready to Start Your Project?

Let's discuss how we can bring your digital vision to life.

Get in Touch