Skip to content

KeNIC-accredited .KE registrar

Payments · How-to guide

How to add M-Pesa Paybill to your website without coding

Three practical ways to accept M-Pesa Paybill or Till payments online, from a simple payment instruction to an automatic STK Push checkout, with the costs and trade-offs of each.

By John KariukiPublished Updated 8 min read

Customer paying with her smartphone at a shop checkout counter

The short answer

  • Simplest: show your Paybill, an account number (use the order number) and the amount, then confirm payments by hand.
  • Automatic, no code: a gateway plugin such as Pesapal or IntaSend sends an M-Pesa prompt to the customer and marks the order as paid.
  • Lowest cost at volume: connect your own Paybill through Safaricom’s Daraja API (needs a developer).
  • For websites, a Paybill beats a Till because the account number links each payment to an order.

If your customers already pay you by M-Pesa in the shop, they will expect to do the same on your website. The good news is that you can add M-Pesa Paybill (or a Buy Goods Till) to almost any website without writing code. The right method depends on how many orders you handle and whether you need payments to confirm automatically.

This guide walks through the three practical options, from a simple payment instruction to a full STK Push checkout, with the costs, trade-offs and mistakes we see most often when building M-Pesa checkouts for Kenyan businesses.

First: do you need a Paybill or a Till?

Both are Lipa na M-PESA products from Safaricom, and both work online. The difference is how customers identify themselves when they pay.

Paybill (business number)Buy Goods Till
How customers payBusiness number + account number + amountTill number + amount
Best forInvoices, orders, school fees, subscriptions: anything you need to match to a customer or orderSimple retail sales where you don't need a reference
Matching payments to ordersEasy, because the order number can be the account numberHarder; you match by amount, name or time
Who can applyRegistered businesses and organisations (a 6-month short-term Paybill exists for specific projects)Businesses, including small traders

Safaricom says Paybill applications are made through the M-PESA for Business portal, that the documents needed depend on your business category, and that processing takes up to 24 hours once all documents are in. For a website, a Paybill is usually the better choice, because the account number lets you tie each payment to an order.

Avoid using a personal "Send Money" number for business. It mixes personal and business funds, gives you no proper statements for KRA, and looks less trustworthy to customers checking out on a website.

Method 1: Show your Paybill details on the website (simplest)

The quickest option is to display your payment details and let customers pay from their phone. No plugin or developer is needed.

  1. Add a clear "How to pay" block on your checkout, invoice or contact page: business number, account number and exact amount.
  2. Tell customers what to use as the account number. On an online store, use the order number so every payment is traceable.
  3. In WooCommerce, you can rename the built-in Direct bank transfer method to "Pay with M-Pesa Paybill" and put your instructions in its description. Orders are created as On hold until you confirm the money arrived.
  4. Confirm payments from the SMS notifications or the M-PESA organisation portal, then mark each order as paid.

Good for: service businesses, invoices, and shops with a handful of orders a day. Downside: every payment is checked by hand, and customers can enter the wrong amount or account number.

Method 2: Use a payment gateway plugin (automatic, no code)

If you run an online store, a payment gateway is the most popular no-code route. The customer enters their phone number at checkout, receives an M-Pesa prompt on their phone (an STK Push), enters their PIN, and the order updates to Paid automatically.

Customer paying with her smartphone at a shop checkout counter
With a gateway or STK Push, the customer approves the payment on their phone and the order confirms itself.

Kenyan gateways with ready-made WooCommerce plugins include:

  • Pesapal: a free WooCommerce plugin connected to a Pesapal business account. Pesapal’s own setup guide covers installing the plugin, adding your API credentials and testing in sandbox mode. Pesapal appears in the Central Bank of Kenya's directory of authorised payment service providers.
  • IntaSend: a free plugin that adds M-Pesa and card payments. IntaSend’s plugin page describes the same steps: install, add API keys, test, go live.
  • Plugins on WordPress.org: several community plugins are listed under the M-PESA tag. Check when each was last updated and whether it supports your WooCommerce version before relying on it.

Typical setup takes an afternoon:

  1. Open a merchant account with the gateway and complete their business verification.
  2. Install and activate their plugin under Plugins → Add New.
  3. Paste your API keys under WooCommerce → Settings → Payments.
  4. Place a test order in sandbox mode, then switch to live and run one real, small transaction.

Things to check before you choose: the transaction fee, how quickly money is settled to your bank, whether the money goes to the gateway first or to your own Paybill, and whether card payments are included. These change, so read each provider's current pricing page rather than relying on figures quoted in blogs.

Method 3: Connect your own Paybill through the Daraja API

Safaricom's Daraja developer portal lets a website talk to M-Pesa directly. With M-Pesa Express (STK Push), your site sends the payment prompt to the customer's phone, and Safaricom calls your website back to confirm the result. Money goes straight into your Paybill or Till with no middleman.

Clothing shop owner typing on a laptop at the shop counter with clothes racks behind him
A direct Daraja integration sends payments straight to your own Paybill or Till.

This is not a no-code option. It needs a developer to set up the app on Daraja, handle callbacks securely, test in the sandbox and request go-live approval for your shortcode. It is the right choice when you want the lowest per-transaction cost at volume, payments landing in your own account, or M-Pesa built into a custom system such as a booking platform, school portal or POS.

Which method should you choose?

MethodConfirms automatically?Where the money landsBest for
1. Paybill instructionsNo, you confirm by handYour Paybill/TillLow order volumes, services, invoices
2. Gateway pluginYesUsually the gateway, then your bankMost online stores; also need card payments
3. Daraja APIYesYour Paybill/Till directlyGrowing stores and custom systems

How to make an M-Pesa checkout customers trust

  • Accept both phone formats. Customers type 07…, 01… or 2547…; your checkout should handle all of them.
  • Say what happens next. A short line such as "Check your phone and enter your M-Pesa PIN" stops people closing the page too early.
  • Offer a fallback. If the prompt times out, show the Paybill and order number so the customer can still pay manually.
  • Send a confirmation. Email or SMS the order details and M-Pesa code once payment is confirmed.
  • Test on a real phone over mobile data, not just on office Wi-Fi.

If customers are paying online, your website also needs the right legal pages and records. Our guide to accepting online payments legally in Kenya covers registration, data protection and eTIMS.

Common mistakes to avoid

  • Using a personal M-Pesa line instead of a business Paybill or Till.
  • Not telling customers which account number to use, so payments can't be matched.
  • Going live without a sandbox test and one small real payment.
  • Installing an abandoned plugin that breaks after a WooCommerce update.
  • Forgetting to plan for refunds and failed payments.

Next steps

Start with Method 1 if you only need to accept a few payments; move to a gateway or Daraja once manual checking slows you down. If you would rather not deal with API keys and callbacks, we build M-Pesa checkouts for WooCommerce and custom systems as part of our ecommerce website design work, including STK Push, Paybill and Till payments with automatic order confirmation. For a broader view of features, see M-Pesa integration for ecommerce websites.

Frequently asked questions

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

You can, but it is not recommended. A business Paybill or Till separates business income, gives you proper statements and looks more trustworthy at checkout.

How long does it take to get a Paybill?

Safaricom says applications are processed within 24 hours once all required documents are submitted through the M-PESA for Business portal. The documents depend on your business category.

Do I need a Paybill to use a payment gateway plugin?

Not always. Many gateways collect payments into their own merchant account and settle to your bank. Check with the provider, because some also support connecting your own Paybill or Till.

What does it cost to accept M-Pesa online?

Safaricom charges business tariffs on Paybill and Till transactions, and gateways add their own fees. Both change from time to time, so check Safaricom’s current tariffs and the gateway’s pricing page before you decide.

Can M-Pesa be added to a website that is not WordPress?

Yes. Paybill instructions work on any site, many gateways offer hosted checkout links, and a developer can connect any platform to the Daraja API.

Sources

Facts checked on 4 November 2026. Prices and rules change; confirm current details with the provider or regulator.

About the author. John Kariuki is the founder of Kenya Website Designers in Nairobi. He builds business websites, online stores with M-Pesa payments and custom web systems, and manages domains and hosting for Kenyan businesses.

Free quote

Add M-Pesa to your website

Tell us your platform and how you get paid today. We reply within 24 hours with the best M-Pesa option and a fixed written quote.