How to accept M-Pesa payments on your website
JMSURF PAY guide · updated 23 November 2026
Customers in Kenya expect to pay with M-Pesa. Asking them to leave your website, open the M-Pesa menu, type a paybill and an account number, and then send you the confirmation SMS loses sales and creates work. With an STK push prompt they just enter their PIN. This guide shows five ways to accept M-Pesa payments on a website with JMSURF PAY, from no code at all to a full API integration, and how to pick one.
Five ways, from simplest to most flexible
| Option | Code needed | Best for |
|---|---|---|
| Payment link | None | Invoices, WhatsApp and social media sales, a link on any page |
| Payment button | One line of HTML | Any website, landing page or blog that sells a few items |
| WooCommerce plugin | None (install a plugin) | WordPress shops |
| Shopify connector | None (connect an app) | Shopify stores |
| REST API | Yes | Custom websites, apps and systems |
What the customer sees
- 1Enter the number. At checkout the customer types their M-Pesa number (or it is already on the order).
- 2Get the prompt. An M-Pesa prompt appears on their phone with the amount.
- 3Enter the PIN. They enter their M-Pesa PIN. The money goes from their M-Pesa to your till, paybill or bank.
- 4Done. Your website learns the result in seconds by webhook, marks the order paid and shows a thank-you page.
If the prompt does not reach the phone (phone off, poor network), the customer is told in one plain sentence and can try again or use another number. If you turn on paybill confirmations, they can also pay from the M-Pesa menu with a reference shown on the page, and the payment is matched automatically.
Set up in four steps
- 1Create an account. Sign up free at app.jmsurfpay.co.ke.
- 2Verify your business. Upload your documents under Verification. Most businesses are verified within minutes.
- 3Add your payment channel. The till, paybill or bank account the money should go to.
- 4Pick an option above. Share a link, paste the button, install the plugin or call the API.
Tips for more completed payments
- Ask for the phone number on the same page as the order total, and accept any format (07…, 01…, +254…).
- Show the amount and your business name clearly before the prompt is sent.
- Tell customers to keep their phone unlocked and nearby; the prompt expires after a short time.
- Use a clear reference (order or invoice number) so payments are easy to find in reports.
- Turn on SMS payment alerts so your team knows about every payment at once.
Start on the Free plan: 1 payment channel, up to KES 50,000 a month, test keys included. Questions? WhatsApp +254 712 504 593.