
Updated October 2026. M-Pesa payment integration lets customers pay on your website with a prompt on their phone instead of sending money to a till and texting you the code. There are two main routes in Kenya: a payment gateway such as Paystack, which bundles M-Pesa with cards, or a direct connection to Safaricom’s Daraja API.
Who this guide is for: Online shops, membership sites, schools, clinics and service businesses in Kenya that want customers to pay on the website.
Contents
Option 1: Paystack
Paystack operates in Kenya and accepts M-Pesa, cards and other methods through one checkout. It has WordPress and WooCommerce plugins, handles recurring billing for subscriptions and memberships, and settles to your bank account. You pay a fee per transaction; check Paystack’s current Kenya pricing page before you budget.
Option 2: Safaricom Daraja (STK Push)
Daraja is Safaricom’s developer platform. Its M-Pesa Express (STK Push) API sends a payment prompt to the customer’s phone. You need a Paybill or Till number, a Daraja app, and a server that can receive Safaricom’s callback to confirm payment. It suits businesses that only need M-Pesa and want money straight into their Paybill.
Which to choose
| Need | Better fit |
|---|---|
| Cards and M-Pesa in one checkout | Paystack |
| Monthly memberships | Paystack (built-in plans) |
| M-Pesa only, money to your Paybill | Daraja |
| Fastest setup on WooCommerce | Paystack plugin |
Setup checklist
- Business registration documents and a bank account or Paybill ready for verification.
- Test mode first: run payments, failures and refunds end to end.
- Confirm payments on the server, from the gateway’s webhook or Safaricom’s callback, never from the browser alone.
- Send a receipt by email or SMS straight away.
- Log every transaction ID so you can reconcile against statements.
Memberships and paywalls
For a monthly pass, tie the paid plan to a user account, unlock content on confirmed payment, and remind members before renewal. Make cancelling easy; it reduces disputes.
Key terms in M-Pesa payment integration
- STK Push
- A payment prompt sent to the customer's phone, approved with their M-Pesa PIN.
- Daraja
- Safaricom's developer platform for M-Pesa APIs.
- Callback URL
- The address on your server where Safaricom or the gateway reports the payment result.
- Webhook
- An automatic message from a payment gateway to your server when something happens.
- Paybill and Till
- M-Pesa business numbers for receiving payments.
- Reconciliation
- Matching payments received against orders and statements.
Questions to ask before you hire help with M-Pesa payment integration
- Which payment methods will customers see?
- How is payment confirmed on the server?
- What happens when an M-Pesa prompt times out?
- How are refunds handled?
- Who can see payment data and logs?
M-Pesa payment integration: mistakes to avoid
- Trusting the browser's success page instead of a server-side confirmation.
- Launching without testing timeouts and failures.
- No receipt after payment.
- Hiding fees until the final step.
- No log of transaction IDs.
How to measure success
Track payment success rate, failed and abandoned payments, time to confirm and support requests about payments, weekly from the gateway dashboard and your logs.
What is different in Kenya
M-Pesa is the payment method most Kenyan customers expect, so a checkout that only accepts cards loses buyers. Customers are also used to confirming payment with a code, so show a clear on-screen confirmation and send an SMS or email receipt. If you sell to customers abroad, offering card payments alongside M-Pesa matters, and foreign cards may be declined more often, so offer an alternative.
Costs to plan for
Budget for gateway transaction fees, developer time for integration and testing, and ongoing time to reconcile payments. Check each provider's current published fees, as they change.
M-Pesa payment integration: a 30-day starter plan
- Week 1: choose the route and complete gateway or Daraja verification.
- Week 2: build the checkout in test mode and run every scenario.
- Week 3: add receipts, retry options and transaction logs.
- Week 4: go live with a small group of customers, then open to all.
Summary
This guide to M-Pesa payment integration covered: Option 1: Paystack; Option 2: Safaricom Daraja (STK Push); Which to choose; Setup checklist; Memberships and paywalls. Work through them in order, measure as you go, and keep every fact tied to an official or first-hand source.
Sources
- Paystack Kenya (accessed October 2026)
- Safaricom Daraja (accessed October 2026)
Need this done for you? See our conversion services.
Frequently asked questions
Can I accept M-Pesa on WordPress?
Yes. Use a gateway plugin such as Paystack for WooCommerce, or a Daraja STK Push integration built for your site.
Do I need a Paybill for Paystack?
No. Paystack collects M-Pesa payments for you and settles to your bank account. You need a Paybill or Till for Daraja.
Is STK Push secure?
Yes. The customer approves with their M-Pesa PIN on their own phone; your site never sees the PIN.
How long does Daraja go-live approval take?
It depends on Safaricom's review of your application; start the process early.
Can I accept payments in US dollars?
Card payments through a gateway can support other currencies depending on your account; M-Pesa is in shillings.
What happens if a customer pays but the site does not update?
Your server should check the transaction status with the gateway or Safaricom and update the order; logs make this easy to resolve.
Can I test M-Pesa payments without real money?
Daraja offers a sandbox, and Paystack offers a test mode.
Do I need a developer?
Gateway plugins can be installed without code; Daraja integrations usually need a developer.
Can I accept recurring M-Pesa payments?
Gateways can run subscription plans; customers usually approve each M-Pesa charge.
Related
Want help with this?
Tell us about your business in a few lines. We reply within one working day.
Prefer WhatsApp? +254 790 939 404 · We reply within one working day.