By Digital World Kenya · 29 October 2026 · 7 min read
If you sell anything online in Kenya, your customers expect to pay with M-Pesa. Mobile money subscriptions reached about 54 million by June 2026, and M-Pesa holds the lion's share of that market (reported at 88.8%). Integrating M-Pesa into your website, app or system lets customers pay in seconds, and updates your records automatically.
This guide explains how M-Pesa integration works through Safaricom's Daraja API, which option fits your business, and how to avoid common mistakes.
Daraja is Safaricom's developer platform for M-Pesa. It exposes M-Pesa features through REST endpoints you can call from any backend, such as Laravel, Node.js, Python or Flutter apps. You register on the Daraja developer portal, create an app, get your consumer key and secret, and test in a sandbox before going live.
Integration What it does Typical use STK Push (M-Pesa Express) Sends a payment prompt to the customer's phone; they enter their PIN. E-commerce checkout, bookings, subscriptions C2B (Customer to Business) Registers URLs so you are notified when a customer pays your Paybill or Till. Invoices, school fees, rent, till payments B2C (Business to Customer) Sends money from your business to customers' phones. Salaries, refunds, commissions, payouts B2B Moves funds between business shortcodes. Supplier payments, internal transfers Transaction Status and Account Balance Query a payment's status or your balance. Reconciliation, dashboards
The first response is only an acknowledgement. The real result arrives later at your callback, so your system must be built to handle that delay.
Use a Paybill when customers must pay against an account number, such as an invoice, student number or rent unit. Use a Till (Buy Goods) for simple retail-style payments. Your choice affects both the setup and how you reconcile payments.
A sandbox STK Push can run in hours; allow a few weeks to be live in production.
Tip: Daraja details change. Always confirm current requirements in Safaricom's official Daraja documentation before you build.
A well-built integration is more than an STK Push button. It includes a clean checkout, automatic order and invoice updates, receipts by SMS or email, reconciliation reports, refund and payout flows through B2C, and dashboards for finance teams. It also works well on slower mobile connections. For our earlier technical walkthrough, see our Daraja API STK Push guide, and for the bigger picture read about Kenya's expanding Digital Superhighway.
Digital World Kenya integrates STK Push, C2B and B2C into websites, mobile apps and enterprise systems, and supports you after launch.
Get a free quote on WhatsApp: +254 790 412 453
Safaricom's developer platform for M-Pesa. It lets your website or app receive payments, send payouts and check transaction status.
A payment prompt sent directly to the customer's phone. They enter their M-Pesa PIN and the result is delivered to your callback URL.
A sandbox version can work in hours. Production depends on your shortcode and Safaricom's go-live process, so plan for a few weeks.
Yes, for a secure and reliable result. A developer handles callbacks, security, reconciliation and edge cases. Message us on WhatsApp and we will scope it with you.