Technology

Can I integrate my website with M-Pesa? Yes, here is how

Can I integrate my website with M-Pesa? Yes, here is how

Key takeaways

  • Yes. Any business with an M-Pesa Paybill or Till number can accept payments directly on its website.
  • The integration uses Safaricom's Daraja API; STK Push sends a payment prompt to the customer's phone.
  • You need a registered business, a Paybill or Till, a Daraja account and a secure (HTTPS) website.
  • Payments are confirmed automatically, so orders and bookings update without manual checks.
In this guide
  1. Who can integrate M-Pesa on a website?
  2. What you need
  3. How M-Pesa website payments work (STK Push)
  4. Which websites can have M-Pesa?
  5. Benefits of M-Pesa integration
  6. Can I also accept cards and PayPal?
  7. Get it done by Permalink
  8. M-Pesa integration options compared

Short answer: yes, you can integrate your website with M-Pesa. Kenyan customers prefer paying with M-Pesa, and a website that accepts it directly sells more and chases fewer payments. Here is what you need, how it works and what it costs to set up.

Who can integrate M-Pesa on a website?

Any registered business with an M-Pesa Paybill or Buy Goods (Till) number: online shops, schools, hospitals, hotels, tour operators, landlords, churches, SACCOs and service businesses. A personal M-Pesa number cannot be used for automated website payments.

What you need

  1. A registered business and KRA PIN.
  2. An M-Pesa Paybill or Till number from Safaricom.
  3. An account on the Safaricom Daraja developer portal and go-live approval.
  4. A secure website with an SSL certificate (HTTPS).
  5. A developer or agency to connect your website to Daraja.

How M-Pesa website payments work (STK Push)

  1. The customer chooses M-Pesa at checkout and enters their phone number.
  2. Your website asks Safaricom to send a payment prompt.
  3. The customer enters their M-Pesa PIN on their phone.
  4. Safaricom confirms the payment to your website within seconds.
  5. The order, booking or invoice is marked as paid and a receipt is sent automatically.

Which websites can have M-Pesa?

  • WordPress and WooCommerce shops.
  • Custom websites and web apps (PHP, Laravel, Node.js and others).
  • Booking systems for hotels, tours and events.
  • School, hospital, property and SACCO systems.
  • Mobile apps.

Benefits of M-Pesa integration

  • Faster checkout and fewer abandoned orders.
  • No manual checking of M-Pesa messages.
  • Automatic receipts and accurate records.
  • Payments reconcile with your accounts and eTIMS invoices.

Ready to accept M-Pesa on your website?

Add M-Pesa to my website Request a free quote

Can I also accept cards and PayPal?

Yes. Many businesses combine M-Pesa with card payments and PayPal so local and international customers can all pay. Read more in our guide on sending and receiving money globally from Kenya, and our earlier technical overview of M-Pesa integration for websites.

We integrate M-Pesa into new and existing websites, online shops and business systems, and test every payment before go-live. See our web design and development service or request a quote.

M-Pesa integration options compared

OptionHow it worksBest for
STK Push (Lipa na M-Pesa Online)Customer enters phone number, gets a PIN promptOnline shops, bookings, school fees
C2B (Paybill / Till confirmation)Customer pays from the M-Pesa menu; site receives confirmationInvoices and account payments
B2CBusiness sends money to customersRefunds, payouts, commissions
Payment gateway pluginA third-party gateway handles M-Pesa and cardsQuick setup with cards too

Frequently asked questions

Can I use my personal M-Pesa number on my website?

Not for automated payments. Daraja integrations need a business Paybill or Till number.

Does M-Pesa integration work with WordPress and WooCommerce?

Yes. It can be added through a plugin or a custom integration that confirms payments automatically.

How long does M-Pesa integration take?

Once your Paybill or Till and Daraja go-live approval are ready, a standard integration usually takes a few days.

Is M-Pesa integration secure?

Yes, when done properly: payments happen on the customer's phone with their PIN, and your site only receives the confirmation over HTTPS.

Share this guide: WhatsApp LinkedIn Facebook X
Permalink Business Ltd.
Permalink Business Ltd.

A Nairobi IT company helping Kenyan businesses grow with websites, software, marketing, networking and security. Our guides are written from real client projects.

← Back to all articles
Keep learning

Related guides

> lets_build()

Ready to put this into practice?

Book a free consultation and we’ll recommend the right next step for your business.

Join free AI Training for WebsitesChat with us