M-Pesa integration for your app, website or system

We add Safaricom M-Pesa payments through the Daraja API. STK Push, Paybill and Till, B2C payouts and the callbacks that make them reliable. Built in Kenya by a team that runs its own Paybill every day.

KEPAS adds Safaricom M-Pesa payments to apps, websites and business systems anywhere in Kenya. We work on the Daraja API every day because our own products run on it. KodiSap collects rent through our Paybill 4052037. Wabi holds a client's M-Pesa until the job is done and pays the worker after. daraja-js, our open source SDK, came out of the bugs we met running that Paybill with real money.

Chat on WhatsApp Send the details by form

What we integrate

STK Push (Lipa na M-Pesa Online)
The customer taps pay, the M-Pesa PIN prompt appears on their phone, and your system learns the result the moment Safaricom posts it back.
Paybill and Till payments (C2B)
Customers pay your Paybill or Till the way they already know. Validation and confirmation URLs match every payment to the right account, invoice, student or tenant.
B2C payouts
Pay workers, suppliers, refunds or loan disbursements straight to a phone from your shortcode, with every result parsed and stored.
B2B, reversals and status checks
Business to business payments, float transfers, transaction status, account balance and reversals on the same Daraja app.
Callbacks and reconciliation
Every callback is verified, stored before it is processed and never counted twice. Payments Safaricom never called back about are pulled in with the Pull Transaction API, so your records and your M-Pesa statement agree.
Paybill application and Go-Live
No shortcode yet? We guide you through the Safaricom Paybill or Till application and the Daraja Go-Live, the same forms and emails we went through for our own Paybill.

Where it goes to work

Why ask KEPAS

Nelson Lemein, founder of KEPAS
Nelson Lemein runs the KEPAS Paybill and wrote daraja-js.
We run a Paybill of our own
Paybill 4052037 collects rent for landlords on KodiSap, our Android app on Google Play. Callbacks, reconciliation and Safaricom's quirks are things we handle every day, not things we read about.
We wrote the SDK other developers use
daraja-js is our open source Node.js and TypeScript SDK for Daraja, published on npm as @kepas/daraja-js under the Apache 2.0 licence. Each check in it is a bug we hit in production and now stop before it reaches you.
We built a console for shortcodes
Daraja Studio is our simpler alternative to the Safaricom organisation portal, built on daraja-js.
We have written it all down
Read Adding M-Pesa to your app, what they don't tell you and How to integrate M-Pesa payments into your organisation website before you call us.

How an M-Pesa integration goes

  1. A short call. We look at your app or system, your shortcode if you have one, and what a payment should trigger. You get a written quote and dates.
  2. Accounts. Paybill or Till, Daraja app, callback URLs and credentials. We help with the Safaricom forms when you are starting from nothing.
  3. Build and test. We build against the Daraja sandbox, then test live with small real amounts on your shortcode.
  4. Go live. We watch the first days of real payments, then hand over the code, the credentials and a short guide. The code is yours.

What you need to have

What it costs

Safaricom does not charge for the Daraja API. M-Pesa charges its normal transaction fees on your Paybill or Till, and those stay the same whoever builds the integration.

A new app with M-Pesa, offline sync and push notifications costs between KSh 150,000 and KSh 500,000, as listed on our services page. Adding M-Pesa to a website, app or system you already have costs between KSh 20,000 and KSh 60,000. STK Push alone sits at the low end. Paybill payments, stored callbacks, a daily match and the Go-Live paperwork sit at the high end. We quote it in writing after the first call, before any work starts, and the quote is the price.

M-Pesa integration questions

Do I need my own Paybill or Till?
Yes. Payments go to your own Paybill or Till, so the money lands in your account and your name is on the customer's M-Pesa message. If you do not have one yet we guide you through the Safaricom application, the same one we did for Paybill 4052037.
How long does it take?
A single STK Push flow on an app or website that already exists takes days. A full layer with Paybill payments, callbacks, payouts and reconciliation takes weeks. Safaricom's own approvals, such as the Paybill and the Go-Live, take their own time, and we tell you the dates after the first call.
What happens when a payment fails or the customer cancels?
Safaricom sends a result code for every attempt. Your system records it as failed or cancelled, never as paid, and the customer can try again. Payments that succeed without a callback are picked up by the Pull Transaction API, so nothing is lost.
Can you integrate into a system I already have?
Yes. Most of our M-Pesa work is adding payments to an existing app, website or system. If the system has no API we add a small service beside it that receives the callbacks and writes the records.
Do you also take card payments?
If your customers also need cards, ask. We can add a Kenyan card gateway next to M-Pesa so both appear at checkout.
Will I own the code?
Yes. You get the source, the credentials and a short guide at handover. Nothing depends on a KEPAS account.
Do you work outside Nairobi?
Yes. We work with clients anywhere in Kenya over WhatsApp, calls and screen shares, and we visit when the project needs it. Our office is in Loitokitok, Kajiado County.

Tell us what should happen when a customer pays

Send a line about your app or system and whether you have a Paybill or Till. We reply with questions, then a written quote.

WhatsApp +254 741 642 093 contact@kepas.co.ke