Payments

    M-Pesa Integration Explained: A Plain-English Guide for Kenyan Businesses

    Every Kenyan business eventually asks the same question: 'Can we just plug M-Pesa into our website?' The short answer is yes — but the long answer involves Daraja API tiers, STK Push versus C2B, Safaricom approvals and a few traps that catch first-timers. This is the plain-English version, no jargon.

    14 May 202610 min read

    The four ways customers can pay you with M-Pesa

    1. Send Money (personal) — Customer types your number on the M-Pesa menu. Free for them, but you cannot automate reconciliation. Avoid for any serious business.

    2. Buy Goods (Till Number) — Customer enters a Till Number. Lower transaction fees than Paybill, no account-number step. Best for retail and quick checkouts.

    3. Pay Bill — Customer enters a Paybill and an account number (e.g. invoice or member ID). Best for utilities, schools, SACCOs and any business that needs to identify what each payment is for.

    4. STK Push (Lipa na M-Pesa Online) — A pop-up appears directly on the customer's phone after they click 'Pay' on your website. The smoothest checkout experience, requires Safaricom Daraja API.

    What is the Safaricom Daraja API?

    Daraja is Safaricom's official developer platform — a set of APIs that let your website, app or system talk to M-Pesa programmatically. It's free to register and free to test in the sandbox. You pay normal M-Pesa transaction charges in production.

    The two Daraja products that matter for most websites are Lipa na M-Pesa Online (for STK Push) and Customer-to-Business (C2B), which gives you instant notifications every time anyone pays your Paybill or Till. Combined, they let you take a payment, confirm it on your server, mark the invoice as paid, send an SMS receipt and update your dashboard — all in under 30 seconds.

    How long does M-Pesa integration take?

    Sandbox integration on a modern website takes 2–4 days for an experienced Kenyan developer. Going live requires Safaricom approval — typically 5–10 working days once you submit a valid certificate of incorporation, KRA PIN, and details of your existing Paybill or Till.

    Realistic end-to-end timeline from kickoff to live: 2–3 weeks for a simple checkout, 4–6 weeks if you also need invoice matching, refund handling, accounting integration and reconciliation reports.

    What does M-Pesa integration cost in Kenya?

    Two costs to plan for. First, development: a clean STK Push checkout on an existing website runs KES 60,000–150,000. Add C2B reconciliation and invoice matching and you're at KES 180,000–350,000. Custom workflows (split payments, recurring billing, multi-till routing) start around KES 400,000.

    Second, transaction charges: Safaricom charges the merchant per successful transaction on Buy Goods, Paybill and Lipa na M-Pesa Online. Current published tiers range roughly from 0.5 percent to 1.5 percent depending on volume — confirm the live rate with Safaricom for your specific Till or Paybill before going live.

    Five things first-timers always get wrong

    1. Treating STK Push as 'paid' before the callback. The pop-up means the customer was prompted, not that they paid. Always wait for Safaricom's confirmation callback before fulfilling the order.

    2. No retry logic. Telco glitches happen. Your system needs to handle timeouts and let customers retry without double-charging.

    3. Skipping reconciliation. C2B notifications must be matched to invoices automatically — manual matching breaks at 50 transactions a day.

    4. Hardcoding sandbox credentials. Many launches break on day one because someone forgot to swap the sandbox keys for production.

    5. No logging. Every payment attempt, callback and failure must be logged for audit and KRA compliance.

    More from RDX

    We’ve got answers.

    A little clarity before we get started.

    Have something else in mind?Talk to our team

    Need M-Pesa working on your website or app?

    We've shipped Daraja integrations dozens of times. Tell us what you need and we'll quote it within 24 hours.

    Start your project
    WhatsApp