Sparkle Online Solutions
← Back to Blog

How to Accept M-Pesa Payments on Your Website

By Sparkle Online Solutions4 December 2026
How to Accept M-Pesa Payments on Your Website

By the Sparkle Online Solutions team, Nakuru, Kenya · Last updated 4 December 2026 · 6 min read

Short answer: you can either show your Paybill or Till number and confirm payments manually, connect directly to Safaricom's M-Pesa API (Daraja) for automatic STK push prompts, or use a payment gateway such as Paystack, Pesapal or Flutterwave that supports M-Pesa and cards together.

Option 1: Show your Paybill or Till number

How to accept M-Pesa on your website
  • How it works: customers pay on their phone and send you the confirmation message.
  • Good for: small volumes, deposits, services booked over WhatsApp.
  • Downside: you check every payment by hand, and mistakes and fake confirmation messages are a risk.

Option 2: M-Pesa Daraja API (STK push)

  • How it works: the customer enters their number on your site, gets a PIN prompt on their phone, and your site is told automatically when they've paid.
  • Needs: a Paybill or Till number, Safaricom Daraja API access, and a developer to build and secure the integration.
  • Good for: shops, schools, SACCOs and any business that wants automatic confirmation.

Option 3: A payment gateway

  • How it works: the gateway handles M-Pesa, cards and sometimes bank payments in one checkout, then settles to your bank account.
  • Needs: a business account with the gateway (usually with your business registration documents).
  • Good for: selling to both Kenyan and international customers. Gateways charge a percentage per transaction.

Security essentials

  • Never confirm an order based on an SMS screenshot alone. Check your M-Pesa statement or use automatic confirmation.
  • Your site must use https.
  • Prices should be set on your server, not in a link the customer could edit.

Frequently asked questions

Can a small business accept M-Pesa on its website?

Yes. Even a one-page website can show a Till number, and automatic STK push can be added later.

What do I need for M-Pesa API integration?

A Paybill or Till number, Safaricom Daraja API credentials and a developer to build the integration securely.

Which is cheaper: Daraja or a payment gateway?

Daraja usually has lower per-transaction costs but needs development work. Gateways are faster to set up and also take cards, but charge a fee per transaction.

Want us to handle it?

We build websites with M-Pesa built in. Our Business package includes M-Pesa and card checkout, and our own site takes M-Pesa payments. See our quick-start packages: a one-page website for KES 9,900, domain and hosting for a year for KES 10,000, or a website check-up for KES 10,000. Pay by M-Pesa and we start the same day, or WhatsApp us on 0796 111 469 with your question.

Ready to grow your business online?

Get a Free Quote
Get My Project Estimate