How to Accept M-Pesa Payments on Your Website or App
Step-by-step guide to integrating M-Pesa STK Push and payment APIs into your e-commerce site, mobile app, or business system.
M-Pesa processes over KES 30 billion daily in Kenya. If your business does not accept M-Pesa online payments, you are leaving money on the table.
Understanding M-Pesa Payment Methods
STK Push: The customer enters their M-Pesa PIN on their phone after receiving a prompt. Best for checkout flows.
Paybill: A business paybill number where customers send money. Good for invoicing.
Till Number: For in-person retail payments at a physical location.
Integration Options
Hugo Pay API: Our managed API handles all the complexity. You get a single endpoint for M-Pesa, cards, and Airtel Money with a 99.99% uptime SLA.
Direct Safaricom API: For developers who want full control, Safaricom offers a Daraja API — but you handle token management, callbacks, and security yourself.
Best Practices
- Always confirm payment status via webhooks, not just the initial response
- Implement retry logic for failed STK Push attempts
- Store transaction receipts for reconciliation
- Test thoroughly in sandbox before going live
Getting Started
The fastest path is the Hugo Pay API sandbox. Sign up, get your API keys, and start testing in minutes.
