Payment Integration

How to Accept M-Pesa Payments on Your Website (2026 Guide)

A practical guide to taking M-Pesa on your website or online shop. We cover the Daraja API, a no-code pay button that pays straight into your own Paybill or Till, payment gateways like PesaPal and Flutterwave, what each really costs, and how to stay safe.

M-Pesa is not just a payment method in Kenya — it's the payment method. Most of your customers will reach for it before a card, so a Kenyan online business that can't take M-Pesa is leaving money on the table. Literally.

But integrating M-Pesa into your website can be confusing. Should you use Safaricom's Daraja API directly? Use a ready-made pay button? Go through a payment gateway like PesaPal or Flutterwave? How much does each cost, and who holds your money?

This guide answers all of these questions and helps you choose the right M-Pesa integration approach for your business.

Why M-Pesa Is Essential for Kenyan E-Commerce

If you're selling anything online to Kenyan customers, M-Pesa integration is not optional — it's a necessity. Here's why:

  • Mobile money comes first: Kenya leads the world in mobile money adoption. Most Kenyans use M-Pesa as their main way to pay, ahead of bank transfers and cards.
  • Low credit card penetration: Unlike Western markets, only a small percentage of Kenyans have credit or debit cards. If your website only accepts card payments, you're excluding the majority of potential customers.
  • Trust and familiarity: Kenyans trust M-Pesa. They use it daily for everything from buying groceries to paying rent. An M-Pesa payment option feels safe and familiar.
  • Instant confirmation: M-Pesa transactions are confirmed within seconds, allowing you to process and fulfill orders immediately.
  • Low costs on small sales: at the time of writing, a customer pays nothing to pay a Till, and the business pays nothing on Till payments up to KES 500 (details in the fees section below).

4 Ways to Integrate M-Pesa Into Your Website

There are four main approaches to accepting M-Pesa payments on your website. Each has different levels of complexity, cost, and features — and they differ on one thing that matters a lot: whether the money lands in your own Paybill or Till, or in someone else's account first.

Option 1: Safaricom Daraja API (Direct Integration)

The Daraja API is Safaricom's official API for M-Pesa integration. It gives you direct access to M-Pesa's payment infrastructure with maximum control and flexibility.

Key Features

  • STK Push (Lipa Na M-Pesa Online): The most popular feature. Your website sends a payment prompt directly to the customer's phone. They simply enter their M-Pesa PIN to complete payment. No need to manually enter Paybill numbers or amounts.
  • C2B (Customer to Business): For traditional Paybill and Till number payments where the customer initiates the transaction from their phone.
  • B2C (Business to Customer): Send money to customers — useful for refunds, cashbacks, or payouts.
  • Transaction Status Query: Check the status of any transaction programmatically.
  • Account Balance Query: Check your M-Pesa account balance via API.

Pros

  • Full control over the payment experience
  • No intermediary fees — only standard M-Pesa transaction charges
  • Direct relationship with Safaricom
  • Real-time callbacks for instant payment confirmation
  • Customizable to your exact business needs

Cons

  • Requires significant development effort
  • You handle security, error handling, and reconciliation yourself
  • Safaricom's API documentation can be challenging
  • Only supports M-Pesa (no card payments, no bank transfers)
  • Going live needs Safaricom's approval and an M-Pesa Org Portal administrator (see our Daraja API keys guide)

Best for: Businesses with development teams that need maximum control and want to avoid gateway fees. For a deeper technical walkthrough, see our M-Pesa integration technical guide.

Option 2: A Pay Button With Your Own Daraja Keys (KenZobe Checkout)

In between doing everything yourself and handing your money to a gateway, there is a third way: a hosted checkout that uses your own Daraja app, so every payment goes straight into your own Paybill or Till. This is what we built KenZobe Checkout for. It is our own product, so weigh it like any other option.

Key Features

  • A pay button for any website: one script tag and one button, no backend needed to start. Works on plain HTML, WordPress and AI-built sites.
  • Payment links you can share on WhatsApp or Instagram when you don't have a website.
  • STK Push to your customer's phone; a payment counts as paid only after Safaricom confirms it with a status query.
  • A REST API and signed webhooks for developers.
  • Free sandbox for testing; you can try a test payment before you even have Daraja keys.

Pros

  • Money goes directly to your own Paybill or Till — KenZobe never holds it, so there is no settlement wait
  • A flat monthly plan instead of a percentage of every sale (Basic KES 2,400 a month for up to 300 payments)
  • Visitors can't change what they pay: the button sends a price id, never an amount
  • A customer's payment is never blocked because you went over your plan's volume

Cons

  • M-Pesa only — no cards, Airtel Money or bank transfers
  • For live payments you still need your own Paybill or Till and a Daraja app that has gone live
  • Before delivering anything, your server should confirm the payment with the API (a short check, shown in the guide)

Best for: Small shops, AI-built and no-code sites, and developers who want the Daraja route without building and running it. See how to add an M-Pesa pay button to any website, or try the demo checkout (no real prompt is sent).

Option 3: PesaPal

PesaPal is Kenya's most established payment gateway. It acts as a middleman between your website and M-Pesa (plus other payment methods), simplifying integration significantly.

Key Features

  • Accepts M-Pesa, Airtel Money, Visa, Mastercard, and bank transfers
  • Pre-built checkout pages and iFrames
  • Plugins for WordPress, WooCommerce, Shopify, and other platforms
  • Merchant dashboard for tracking payments and generating reports
  • Recurring payment support
  • Multi-currency support for businesses selling internationally

Pros

  • Much easier to integrate than direct Daraja API
  • Multiple payment methods in one integration
  • PCI DSS compliant — PesaPal handles card security
  • Reliable and well-established in Kenya
  • Good customer support

Cons

  • A transaction fee per payment (PesaPal's site did not show its rate when we checked in October 2026 — ask them)
  • Funds are held in a trust account; bank settlement takes up to 72 working hours (3 working days), per PesaPal's FAQ
  • Less control over the payment experience
  • Checkout page redirect can increase cart abandonment

Best for: Businesses that want a quick, reliable integration with multiple payment methods and don't mind paying slightly higher fees for convenience.

Option 4: Flutterwave

Flutterwave is a pan-African payment gateway that supports M-Pesa alongside dozens of other payment methods across the continent.

Key Features

  • M-Pesa, Airtel Money, cards, bank transfers, and mobile money across 30+ African countries
  • Beautiful, modern checkout experience
  • Developer-friendly APIs and SDKs
  • Subaccount and split payment features (useful for marketplaces)
  • Payment links for businesses without websites
  • Subscription and recurring billing

Pros

  • Best option if you sell across multiple African countries
  • Modern, well-documented API
  • Supports more payment methods than PesaPal
  • Split payments for marketplace businesses
  • Excellent developer experience

Cons

  • 2.9% per M-Pesa payment, plus KES 100 per transfer out, excluding VAT (published rates, October 2026)
  • Funds collect in your Flutterwave balance; local payments settle the next day
  • Customer support can be slow during peak periods
  • Less local presence than PesaPal in Kenya

Best for: Tech-savvy businesses, pan-African companies, and marketplace platforms that need split payments.

Comparison: Daraja API vs Pay Button vs PesaPal vs Flutterwave

Here's a quick comparison to help you decide:

  • Setup complexity: Daraja: High | KenZobe Checkout: Low | PesaPal: Low | Flutterwave: Medium
  • Who holds the money: Daraja: you (your Paybill/Till) | KenZobe Checkout: you (your Paybill/Till) | PesaPal: PesaPal, then your bank | Flutterwave: Flutterwave, then you
  • Fees on top of M-Pesa tariffs: Daraja: none listed by Safaricom | KenZobe Checkout: flat monthly plan, no percentage | PesaPal: per-transaction (ask) | Flutterwave: 2.9% + KES 100 per transfer out
  • Payment methods: Daraja: M-Pesa only | KenZobe Checkout: M-Pesa only | PesaPal: M-Pesa + cards + banks | Flutterwave: M-Pesa + cards + banks + many countries
  • Settlement: Daraja: instant | KenZobe Checkout: instant (it's your own Paybill/Till) | PesaPal: up to 3 working days | Flutterwave: next day
  • Best for: Daraja: teams with developers | KenZobe Checkout: small shops and no-code sites | PesaPal: shops that need cards too | Flutterwave: pan-African businesses

Requirements for M-Pesa Integration

Regardless of which approach you choose, you'll need these basics in place:

Business Requirements

  • Safaricom Business Account: You need a registered Safaricom Paybill or Till number. This requires a valid Kenyan business registration certificate, KRA PIN, and company bank account.
  • Daraja API credentials: Register at developer.safaricom.co.ke to get your consumer key, consumer secret and passkey for testing and production. Our step-by-step Daraja keys guide covers going live, including the Org Portal administrator Safaricom asks for.
  • Business registration: Payment providers require proof of legitimate business registration in Kenya.

Technical Requirements

  • SSL certificate: Your website must have HTTPS enabled. M-Pesa callbacks and payment gateway integrations require secure connections. Any professional web development includes SSL as standard.
  • Server with callback URL: M-Pesa's Daraja API sends payment confirmations to a callback URL on your server. You need a reliable server that can receive and process these callbacks.
  • Database: To store transaction records, order status, and reconciliation data.
  • Testing environment: Safaricom provides a sandbox for testing before going live. Always test thoroughly before accepting real payments.

How M-Pesa STK Push Works on Your Website

The STK Push flow is the most popular M-Pesa integration for websites because it provides the smoothest customer experience. Here's how it works:

  1. Customer clicks "Pay with M-Pesa" on your website checkout page and enters their phone number.
  2. Your server sends an STK Push request to Safaricom's Daraja API with the customer's phone number, amount, and transaction description.
  3. Safaricom sends a payment prompt (SIM Toolkit Push) to the customer's phone. The prompt shows the amount and your business name.
  4. Customer enters their M-Pesa PIN on their phone to authorize the payment.
  5. Safaricom processes the payment and deducts the amount from the customer's M-Pesa wallet.
  6. Safaricom sends a callback to your server saying the payment succeeded (or failed).
  7. Your server confirms it with a status query (STK Query) before marking the order paid, then your website shows a confirmation to the customer.

When the customer is ready with their phone, the whole thing takes a few seconds. They don't need to remember any Paybill or account numbers, and they can't type the wrong amount.

Transaction Fees Breakdown

Understanding the fee structure helps you price your products correctly and choose the right integration method:

Safaricom M-Pesa Fees (Your Own Till or Paybill)

Safaricom lists no fee for using the Daraja API itself. What you pay are the normal M-Pesa tariffs on each payment. At the time of writing (October 2026), Safaricom's tariff page says:

  • Buy Goods (Till): the customer pays nothing. The business pays nothing on payments up to KES 500, 0.55% from KES 501 to KES 36,363, and a flat KES 200 above that. (The free band rose from KES 200 to KES 500 in August 2026.)
  • Paybill: the charge falls on the business, on the customer, or is split, depending on the Paybill tariff agreed with Safaricom. Check the Business Paybill page or your Safaricom account manager.
  • Limits: KES 1 minimum, KES 250,000 per transaction, KES 500,000 a day.

For a fuller breakdown with worked examples, see Is the M-Pesa API free?

Payment Gateway Fees

  • Paystack: 1.5% per M-Pesa payment; payout after 2 working days
  • Flutterwave: 2.9% per M-Pesa payment, plus KES 100 per transfer out, excluding VAT
  • IntaSend: 3% per M-Pesa payment, plus KES 100 per M-Pesa payout
  • PesaPal: per-transaction rate not shown on its site when we checked; ask PesaPal

These are each provider's published rates in October 2026 and are charged to you, the merchant. A percentage feels small per sale but grows with every shilling you sell; a flat monthly plan such as KenZobe Checkout's (from KES 2,400 a month, no percentage) stays the same.

Security Considerations

Handling payments requires strict attention to security. Here are the essential security practices for M-Pesa integration:

  • Always use HTTPS: Never send payment data over unencrypted connections. Your entire website should use SSL/TLS.
  • Don't trust a callback on its own: Safaricom's callbacks carry no signature. Treat one as a hint, and confirm the payment with a status query (STK Query) before you mark an order paid. Safaricom also publishes the addresses its callbacks come from, which is worth watching.
  • Never trust the browser: Always check payment amounts and statuses on your server. A visitor can edit page code, or simply open your "thank you" page without paying.
  • Store API credentials securely: Never hardcode your Daraja API keys or payment gateway credentials in your frontend code. Use environment variables on your server.
  • Implement idempotency: Ensure that processing the same callback twice doesn't result in duplicate order fulfillment.
  • Log everything: Keep detailed logs of all payment transactions, callbacks, and errors for reconciliation and dispute resolution.
  • Regular reconciliation: Compare your transaction records with M-Pesa statements regularly to catch any discrepancies.

Common M-Pesa Integration Challenges

Based on our experience building e-commerce platforms for Kenyan businesses, here are the most common challenges and how to handle them:

  • Timeout issues: an STK prompt times out after roughly 1–3 minutes, depending on the phone, if the customer doesn't enter their PIN. Handle it gracefully and let them try again.
  • Network delays: callbacks can arrive late, and Safaricom's status query can lag behind a callback by a few minutes. Keep checking for a while instead of giving up after one try.
  • Going live process: Safaricom says Go Live approval happens within 24 working hours, but first you need a Business Administrator or Business Manager on the M-Pesa Org Portal, which needs a signed, stamped letter. Start that early.
  • Phone number validation: Ensure you validate and format phone numbers correctly (254XXXXXXXXX format). Invalid phone numbers are the most common cause of STK Push failures.
  • Insufficient balance: Handle the case where a customer doesn't have enough M-Pesa balance gracefully, with a clear error message and option to try again.

Which Integration Should You Choose?

Here's our recommendation based on business type:

  • Small shop or AI-built site, M-Pesa only: a pay button with your own keys (KenZobe Checkout) — money straight to your Till, a flat monthly price, no backend needed to start.
  • Selling on WhatsApp or Instagram without a website: M-Pesa payment links.
  • Small e-commerce store that needs cards too: PesaPal — quick to set up, multiple payment methods, minimal development needed.
  • Growing online business: Flutterwave — modern API, competitive fees, room to scale across Africa.
  • High-volume business: Direct Daraja API — lowest fees, full control, worth the development investment.
  • Marketplace platform: Flutterwave — split payment features make it ideal for multi-vendor platforms.
  • WordPress/WooCommerce site: PesaPal — ready-made plugins, easiest integration, no custom development needed.

We Handle M-Pesa Integration for You

M-Pesa integration is technical work that requires experienced developers who understand both the payment APIs and the Kenyan business context. At KenZobe Technologies, we've integrated M-Pesa into dozens of websites and applications for Kenyan businesses.

Whether you need a new e-commerce website with M-Pesa built in or want to add M-Pesa payments to your existing website, our team handles the entire process — from Safaricom registration to API integration to testing and going live. You focus on selling; we handle the technical complexity.

Contact us today for a free consultation. We'll assess your current setup, recommend the best integration approach, and give you a clear timeline and cost estimate. Most M-Pesa integrations are completed within 1–2 weeks.