How to accept M-Pesa payments on your website in Kenya
Updated 10 November 2026
The short answer: you need a business M-Pesa number (a paybill or a Buy Goods till), Safaricom's permission to connect it to your website (the Daraja API keys), and a website or shop that sends the payment prompt and checks every payment before it marks an order as paid. Soko Sensei does the last part for you, and connecting M-Pesa is free.
Paybill, Buy Goods till or personal number?
- Paybill: customers enter your business number and an account number, for example an order number. Good when you want to match each payment to an order or a customer.
- Buy Goods till: customers enter your till number only. Simple, and common for shops.
- Personal M-Pesa number: fine for sending money to friends, but it can't be connected to a website. There is no way for your shop to send a payment prompt from it or to check payments automatically, so every order has to be checked by hand.
Both a paybill and a till work for online payments. If you only have a personal number, Safaricom can help you get a till or a paybill for your business.
Two ways customers can pay
- A payment prompt on their phone (STK push). The customer types their number at checkout, a prompt pops up on their phone, and they enter their M-Pesa PIN. This is the quickest way to pay, and the order is marked paid on its own.
- Paying your paybill or till directly. The customer pays from the M-Pesa menu as usual, and the payment is matched to their order, for example by the order number they entered as the account number.
A good online shop offers the prompt first and still accepts direct payments, because some customers prefer the M-Pesa menu.
What you need from Safaricom
To connect your paybill or till to a website, Safaricom gives you a set of keys through its developer portal, called Daraja. Think of them as a password that lets your shop ask M-Pesa for payments and check them.
- You apply for the keys with your business details and your paybill or till number.
- Safaricom usually asks for documents such as your business registration and the details of whoever runs the account. Requirements change, so Safaricom will tell you exactly what they need for your business.
- How long it takes varies; it can be a few days or a few weeks. We help you fill in the forms and test a payment before you go live.
What it costs
- Safaricom's charges: Safaricom charges its usual M-Pesa transaction fees on payments to your paybill or till. These are set and published by Safaricom and paid to them, not to us.
- Soko Sensei: connecting M-Pesa is free. You pay the monthly subscription (KES 1,599 a month, free to set up), with no extra fee per payment.
- Your money: payments go straight into your own paybill or till. We never hold your money.
How to stop fake M-Pesa messages
Fake payment messages and edited screenshots are a common trick. The safe way is to never mark an order paid because of an SMS or a screenshot. Instead, your shop should check every payment with Safaricom.
With Soko Sensei, an order is only marked paid after M-Pesa confirms the payment to your account, and each payment can only be used once, so the same receipt can't be used twice.
Taking card payments too
Some customers, especially those abroad, prefer to pay by card. With a Pesapal account, customers can pay by card or mobile money on a secure Pesapal page, and the money goes to your Pesapal account. Pesapal charges its own fees; connecting it to Soko Sensei is free.
How to do it with Soko Sensei
- Talk to us and tell us what you sell.
- We open your account and help you add your products and services.
- Connect your paybill or till: we help you get your Daraja keys and add them to your account.
- Test a payment, then go live. Add Pesapal any time if you want cards.
Read more about the online store, the POS for your counter, or see how to get started.
Questions about M-Pesa payments
More answers in our FAQs.
Can I use my personal M-Pesa number for my online shop?
Not for automatic payments. A personal number can't send payment prompts or confirm payments to a website. You need a paybill or a Buy Goods till, which Safaricom can help you get.
Paybill or till: which is better for online payments?
Both work. A paybill lets customers enter an account number, such as an order number, which helps match payments. A till is simpler for customers. Many shops start with the one they already have.
How long does it take to get the Daraja API keys?
It varies, from a few days to a few weeks, depending on Safaricom and your documents. We help you with the forms and test a payment with you before you go live.
Does Soko Sensei charge a fee per M-Pesa payment?
No. Connecting M-Pesa is free and there is no fee per payment from us. Safaricom charges its usual transaction fees.
How do I know a payment is real?
Don't rely on SMS messages or screenshots. Soko Sensei only marks an order paid after M-Pesa confirms the payment to your account, and each payment can only be used once.
Can customers pay by card as well?
Yes, with a Pesapal account. Customers pay on a secure Pesapal page by card or mobile money, and the money goes to your Pesapal account.
Talk to us
Tell us about your business and we'll show you how Soko Sensei would work for you. No commitment.