How to Accept M-PESA Payments on a Website in Kenya
Fact-checked on
A Kenyan website can accept M-PESA through manual payment instructions, a payment gateway or direct integration with Safaricom’s Daraja APIs. Choose a route that fits your order volume, website platform and ability to support it.
What you need
Have the appropriate merchant account or approved payment-provider account, your business onboarding documents and a clear way to match each payment to an order. Confirm charges and settlement terms with the provider you choose.
Choose a payment route
| Route | How it works | What to plan for |
|---|---|---|
| Manual Till or Paybill instructions | Display the business payment details and ask the customer to supply an order/payment reference | Staff must reconcile payment against merchant records before fulfilment |
| Payment gateway | An approved provider handles checkout and offers an API or supported plugin | Merchant approval, transaction charges, settlement, supported payment methods and maintenance |
| Direct Daraja integration | Your developer integrates the appropriate Safaricom API services | Production approval, secure backend processing, callbacks, reconciliation and ongoing support |
Pesapal, for example, publishes official integration documentation and extensions. Website payment integration is not restricted to WordPress: check the provider’s current documentation for your exact platform and version.
Set up and test
- Decide how orders will be identified and what happens when payment is delayed, cancelled or unsuccessful.
- Complete merchant onboarding using the provider’s official channels.
- Use the supported integration or develop against the official API documentation. Keep secret credentials on the server.
- Test successful, failed, duplicate and delayed transactions in the supported test environment.
- Confirm the payment’s status, amount and order reference through trusted provider records before marking an order paid.
- Move to production only after approval and successful tests. Reconcile receipts and settlements and document your refund process.
A customer’s name, phone number or screenshot alone does not prove payment. An initiated M-PESA prompt is also different from a completed transaction.
Tip: Ask who will maintain the integration when the website or provider changes. An abandoned plugin can create costly checkout problems.
