Accepting M-Pesa on a website is not as simple as pasting a paybill number. Done properly, it is smooth. Done carelessly, customers get charged and orders vanish.
What you need
A Safaricom Daraja account with API credentials, a paybill or till, and a website that can send a payment request and receive the result. For a business, a Lipa na M-Pesa Online (STK push) setup gives the cleanest customer experience.
The part most people get wrong
The order must only be marked paid when Safaricom confirms it through a callback, not when the PIN prompt is sent. Without a reliable callback handler, money leaves the customer's account and the order never updates.
Test with real money first
Always run real low-value transactions before launch and confirm every one reconciles correctly. This is the step that separates a payment flow that works from one that quietly loses sales.

Written by
Founder and lead developer at Ken Designers, the Nairobi studio behind websites, online stores, apps and POS systems for 300+ businesses. Best Software Developer of the Year 2026 (Digitally Fit Awards by KEOnline).
Ask Ken on WhatsApp


