Skip to main content
Hosting for customers worldwide, from our team in Nairobi, Kenya · Pay securely with Visa, Mastercard or M-Pesa
M-Pesa Payments

M-Pesa Integration Kenya (2026): How the Daraja API Works and What It Costs

Sell anything online in Kenya and the first thing customers ask is whether they can pay with M-Pesa. To answer yes properly, your website has to talk to Safaricom's payment system, and setting up that connection is what M-Pesa integration in Kenya is about. Below we explain how the Daraja API and STK Push work, what you need before you start, what it costs and whether to build it yourself or have someone do it for you.

What M-Pesa Integration Really Means

Put simply, an integrated website or app asks for, receives and confirms M-Pesa payments by itself, so you no longer have to keep checking your phone for "received KSh" texts. Customers are not told to send money to a number and then share a screenshot. They pay inside your checkout, the funds go to your Paybill or Till, and your system knows straight away that the order has been paid.

Behind the scenes, this runs on Safaricom's Daraja API, the Lipa Na M-Pesa platform for developers. Daraja is the link between your website and Safaricom. Your site sends a payment request through it, Safaricom prompts the customer, and Daraja returns a "paid" or "failed" result that your system then acts on.

STK Push, C2B and B2C in Everyday Terms

Daraja is made up of several "products", and three come up most often:

  • STK Push (Lipa Na M-Pesa Online): the favourite. At checkout the customer types in their phone number, a prompt appears on their phone asking for their M-Pesa PIN, they confirm, and the payment goes through. Nobody has to remember a paybill number or risk mistyping an account number, which is why most Kenyan businesses want this one.
  • C2B (Customer to Business): covers customers who pay straight into your Paybill or Till, with Safaricom then notifying your system. It is handy for invoices, regular bills and offline payments that you still want logged online.
  • B2C (Business to Customer): money moving the other way, from your business out to customers, such as refunds, payouts, salaries or affiliate commissions.

On a typical online shop or service site, STK Push does most of the work, often backed up by C2B confirmations for extra reliability.

What to Have Ready Before You Integrate

You do not need special connections at Safaricom to begin. The essentials are simple:

  • A Safaricom Paybill or Till number registered to your business. This is where your money is collected. If you do not have one, apply to Safaricom for a business shortcode.
  • A Daraja developer account. Sign up on Safaricom's developer portal to receive your API keys (a consumer key and secret) and a sandbox for testing before you go live.
  • A hosted website running on HTTPS (SSL). Daraja posts payment confirmations to a secure callback URL on your site, so you need dependable hosting and a valid SSL certificate. Every one of our shared hosting plans comes with free Let's Encrypt SSL, starting at KSh 80/mo.
  • Someone to connect the pieces. That can be a developer who understands the Daraja flow, or a done-for-you service that takes care of everything.

Safaricom grants go-live access after your integration passes its checks. How long that takes varies, so leave some slack before an important launch.

Running WooCommerce? There Is a Quicker Route

On a WordPress and WooCommerce store, integration can move much faster. M-Pesa payment plugins link your Daraja credentials to your checkout and add "Pay with M-Pesa" as a payment option. You still need a Paybill or Till and Daraja keys, but there is no custom code to write. If your store does not exist yet, start with our guide on how to set up a WooCommerce online shop in Kenya, and add M-Pesa once it is built.

What M-Pesa Integration Costs in Kenya

Now for the price. SiteBoma offers fixed, one-off integration packages, so the cost is clear from the start. These are our current prices for M-Pesa integration in Kenya:

PackageOne-off priceSuited to
Basic (STK Push)KSh 15,000One website or shop that needs a reliable M-Pesa prompt at checkout.
BusinessKSh 35,000Shops that need STK Push together with C2B confirmations and order reconciliation.
EnterpriseKSh 70,000Custom platforms that need STK Push, C2B and B2C payouts, with deeper links into their own systems.

You pay these once for setup; they are not monthly subscriptions. Safaricom also takes its own transaction fees on the money collected through your Paybill or Till. Safaricom sets those fees, and they have nothing to do with the cost of the integration work.

Build It Yourself or Have It Built?

If you or your team write code, you can certainly integrate M-Pesa on your own. Daraja's documentation, sandbox and sample flows are open to everyone. Doing it yourself makes sense when you have developers in house and want complete control.

Even so, most of the business owners we work with go for done-for-you, and for sound reasons. Daraja takes some learning: callback URLs, security credentials, expiring tokens, the move from sandbox to production, and awkward cases such as timeouts and double payments all have to be handled. Get it wrong and customers may be charged while their orders stay unpaid in your system, which turns into a support headache. A fixed fee to get it right first time often costs less than weeks spent debugging.

A simple test: if M-Pesa is how your money comes in, it is not a weekend side project. Make it reliable first, then put your energy into selling.

For the full range of ways to take money online, cards included, read our guide to taking online payments on a Kenyan website. If you have not chosen a host yet, our walkthrough on hosting a website in Kenya and paying by M-Pesa covers the basics.

M-Pesa Integration Questions, Answered

How long does it take to integrate M-Pesa?

When your Daraja account and Paybill or Till are in place, the technical side of a standard STK Push setup is usually quick. What varies is Safaricom's review before go-live. Sort out your shortcode and developer account early so you are not held up.

Is a Paybill or a Till number required?

To receive payments you need at least one Safaricom business shortcode, which can be a Paybill or a Till (Buy Goods) number. The right one depends on what kind of business you run, and either works with the Daraja API for STK Push.

Can I add M-Pesa to WooCommerce without writing code?

For the most part, yes. With an M-Pesa plugin you enter your Daraja credentials and switch on M-Pesa at checkout, with no custom code. In production, it still only works with valid API keys and a registered Paybill or Till.

Do I pay the integration fee every month?

No. Our integration packages, from KSh 15,000, are paid once at setup. Safaricom's per-transaction charges on the money you collect are separate and are set by Safaricom.

What if a customer pays and the order still shows as unpaid?

Preventing that is the whole point of a proper integration. A well-built setup relies on Daraja's confirmation callbacks and on reconciliation, so each successful payment is matched to its order automatically. Our done-for-you packages are designed to cover these edge cases.

Want customers to be able to pay by M-Pesa the moment they decide to buy? Look through our M-Pesa integration packages, from KSh 15,000. We will take care of the Daraja setup from start to finish while you get on with running your business.

Need M-Pesa on your website, minus the Daraja hassle?

We take care of the entire Safaricom integration: STK Push, callbacks and testing before go-live. Built properly, from KSh 15,000.

Add M-Pesa to my site →
Tags: M-Pesa integration Kenya Daraja API STK Push accept M-Pesa online WooCommerce M-Pesa online payments Kenya
Pass this guide on:

Ready to put your website online?

Hosting from KSh 80$0.62 a month, with free SSL and payment by M-Pesa or card. Your account switches on as soon as the payment clears.