There is a single fact about Kenyan e-commerce that overrides every other consideration when you are building an online store: if your website does not accept M-Pesa, you are excluding the majority of your potential customers before they even get to the checkout.
94%
of digital payments in Kenya are processed through M-Pesa. No other payment method comes close.
This is not a preference. It is infrastructure. M-Pesa is how Kenyans pay for everything from matatu fare to university fees to government services. When a Kenyan consumer lands on your online store and does not see the M-Pesa option at checkout, the instinctive response is not to find another payment method. It is to leave and find a store that does accept it.
I have built e-commerce platforms that process hundreds of M-Pesa transactions weekly. Here is everything a Kenyan business owner needs to understand before launching an online store.
How M-Pesa Integration Actually Works
M-Pesa payments on websites are processed through the Safaricom Daraja API. Daraja is the developer gateway that Safaricom built to allow businesses to programmatically send and receive M-Pesa payments. It is powerful, well documented, and reliable. It is also not trivial to set up correctly.
The two primary payment flows
- ◆STK Push (Lipa Na M-Pesa Online): This is the preferred method for e-commerce. The customer enters their phone number on your website, clicks pay, and immediately receives a push notification on their phone prompting them to enter their M-Pesa PIN. The payment is completed without the customer leaving your website. The conversion rate for STK Push is significantly higher than manual payments because the friction is minimal.
- ◆Paybill or Till Number: The customer manually initiates a payment from their M-Pesa menu, enters your Paybill number and account number, and sends the payment. Your site then needs to listen for the payment confirmation via a callback URL. This method works but introduces friction and increases the chances of payment errors.
For any serious e-commerce platform, STK Push is the correct implementation. The difference in conversion rates between a well implemented STK Push checkout and a manual Paybill checkout is significant.
What You Need Before You Can Go Live
The Safaricom onboarding process has specific requirements that many businesses discover too late in the project timeline. Understanding these early prevents delays.
- ◆A registered Kenyan business. Safaricom requires a certificate of incorporation or business registration. Sole proprietors can register through the Huduma Centre.
- ◆A Safaricom Business Till or Paybill number. If you do not already have one, the application takes five to ten business days to process.
- ◆A live, HTTPS website. Safaricom will not approve a Daraja integration for a website that is not yet deployed and accessible publicly.
- ◆Daraja API credentials. Once your business account is verified, you apply for API credentials through the Safaricom developer portal.
- ◆A callback URL on your server. This is the endpoint on your website that receives payment confirmation from Safaricom. It must be publicly accessible and secure.
“Plan six to eight weeks for the full Safaricom onboarding process if you are starting from scratch. Build this into your launch timeline.”
The Technical Implementation: What Your Developer Needs to Build
I am going to give you the non technical version of what a proper M-Pesa integration requires, so that you can have an informed conversation with any developer you work with.
- ◆Access token generation: The Daraja API requires an access token for every request. Your server needs to generate and cache this token automatically.
- ◆STK Push initiation: When the customer clicks Pay, your server sends a request to Daraja with the customer phone number, amount, and your Paybill details.
- ◆Callback handler: Safaricom sends a confirmation or failure message to your callback URL within seconds of the customer confirming payment. Your server must process this and update the order status.
- ◆Order management: The payment confirmation must be linked to the correct order in your database so that fulfilment can begin automatically.
- ◆Error handling: M-Pesa payments can fail for many reasons — insufficient funds, wrong PIN, network timeout. Your checkout must handle these gracefully and communicate clearly to the customer.
Common Mistakes That Kill Kenyan E-Commerce Conversions
- ◆No M-Pesa at all. Still the most common and most damaging mistake.
- ◆Manual payment instructions only. Asking customers to send money and share a screenshot adds friction that loses sales.
- ◆No payment confirmation feedback. If the customer pays and the website does not immediately confirm receipt, they call your phone, email you, and sometimes charge back. Instant order confirmation emails and SMS are essential.
- ◆Accepting only card payments. Card penetration in Kenya is low. A checkout that only offers Visa and Mastercard is optimised for the minority of your potential customers.
- ◆No refund process. M-Pesa refunds are manual. Having a clear, published refund policy builds the trust needed for first time buyers to complete a purchase.
Beyond M-Pesa: Building a Complete Kenyan Payment Stack
M-Pesa is the foundation, but a mature Kenyan e-commerce platform should also consider additional payment options for specific customer segments.
- ◆Airtel Money: Airtel is the second largest mobile money network in Kenya. For businesses with rural customer bases, Airtel Money integration captures customers who are not on Safaricom.
- ◆Card payments via Pesapal or Flutterwave: Corporate clients and international shoppers prefer card payments. A payment gateway like Pesapal handles both M-Pesa and card in a single integration.
- ◆Bank transfer for high value orders: For orders above KSh 150,000 where M-Pesa transaction limits apply, bank transfer instructions should be available.
The Business Case for Getting This Right
Mkulima Sharp, one of the platforms we built, went from zero to hundreds of weekly M-Pesa transactions within the first month of launch. The technical integration took two weeks to build and test. The revenue it unlocked was immediate and compounding.
Getting M-Pesa integration right is not a nice to have for a Kenyan e-commerce business. It is the difference between a business that works and a website that does not.
Ready to act on this?