← Back

Merchant guide

Kenya M-Pesa for online merchants

M-Pesa is the default way Kenyans pay, and most online merchants in Kenya add it at checkout. You can accept it through Safaricom's Daraja API or through a local payment aggregator that handles the integration for you.

Why M-Pesa is the default rail in Kenya

If you sell to Kenyan customers, M-Pesa is not optional. It is the mobile money service run by Safaricom with tens of millions of active users, and it is how most people already pay for goods, bills, and transfers. Offering M-Pesa at checkout means the buyer pays from the app they trust, with no card needed. For an online merchant this lifts conversion, because a large part of the market simply does not default to cards. M-Pesa works through a phone number and a PIN, so the buyer experience is familiar and fast. The merchant side is handled through Safaricom's Daraja developer platform, which exposes the payment APIs.

  • M-Pesa has tens of millions of active users in Kenya.
  • Most Kenyan buyers expect M-Pesa at checkout.
  • No card is required; payment is by phone number and PIN.
  • Merchant integration uses Safaricom's Daraja API.

STK Push and the online checkout flow

The main online flow is called M-PESA Express, also known widely as STK Push or Lipa na M-Pesa Online. At checkout the customer enters their phone number. Your system calls the Daraja API, and Safaricom pushes a payment prompt to the customer's phone. The customer enters their M-Pesa PIN to approve. Safaricom then sends a callback to your server confirming success or failure, often in seconds. This is far better than asking the customer to manually send money and forward a receipt, because the system updates the order automatically. For online stores, STK Push is the standard pattern. A second flow, C2B, is used when the customer initiates payment to your Paybill or Till with a reference number, which suits bills and fees.

  • STK Push sends a prompt to the customer's phone at checkout.
  • Customer approves with their M-Pesa PIN.
  • A callback updates your order status in seconds.
  • C2B with a reference suits bills, fees, and offline payments.

Till number vs Paybill

To accept M-Pesa you need a business number. A Till number (Buy Goods) fits retail and ecommerce where the amount is set at checkout. A Paybill (shortcode) fits fee-style payments where the customer also enters a reference, such as school fees or rent. If you opened a till recently you are likely on Till 2.0, which supports both Buy Goods and Pochi La Biashara accounting flows. Choose based on how your customer pays: dynamic amount at a shop or app means Till; fixed bill with a reference means Paybill. Both are obtained from Safaricom with business documents such as a registration certificate, KRA PIN, and a bank account in the business name.

  • Till (Buy Goods) for retail and dynamic checkout amounts.
  • Paybill for reference-based bills and fees.
  • Till 2.0 supports both Buy Goods and Pochi flows.
  • Both need business registration, KRA PIN, and a business bank account.

Direct API vs no-code aggregator

You can integrate M-Pesa two ways. The direct way is through the Daraja API: a developer registers an app, gets API credentials, tests in the sandbox, and goes live. This gives you full control and no middleman fee on top of Safaricom's rate. The no-code way is through a Kenyan payment aggregator such as Pesapal, IntaSend, or iPay, which already built the M-Pesa integration and gives you a plugin or hosted checkout. For a WordPress or Shopify store, the aggregator plugin is the fastest route and needs no developer. For a custom app, direct API is cleaner. Either way, keep your API credentials on your server, use HTTPS callback URLs, and reconcile daily.

  • Direct Daraja API: full control, needs a developer.
  • Aggregator plugin: fastest for WordPress or Shopify, no code.
  • Aggregators add their own fee on top of Safaricom's rate.
  • Always keep credentials server-side and use HTTPS callbacks.

Fees, settlement and float

Safaricom does not usually charge for the API itself, but it takes a transaction fee on incoming payments, commonly around 0.5% to 1.5% with a cap, and B2C sends (refunds, payouts) carry their own per-transaction fees. Published rates change and higher-volume merchants can sometimes negotiate, so confirm the current schedule with your Safaricom account manager. Funds sit in your Till or Paybill and you sweep them to your bank, which may carry a withdrawal fee. Public pricing is only a first filter. Actual pricing changes with country, industry, volume, settlement currency, integration method and contract terms. Confirm against the provider's official pricing page or a written quote before you go live.If you use an aggregator, add the aggregator's fee to Safaricom's fee to get your true cost. Watch your float if you do B2C payouts, because a low balance will fail mid-flow.

  • Incoming M-Pesa fees commonly run about 0.5% to 1.5% with a cap.
  • B2C sends (refunds, payouts) have separate per-transaction fees.
  • Sweeping to a bank may add a withdrawal fee.
  • Aggregator use means Safaricom fee plus aggregator fee.

Go-live checklist for merchants

Start by getting your Till or Paybill and registering on the Daraja portal. Test STK Push in the sandbox with fake currency until callbacks and order updates work. Then request production credentials and submit your business documents. If you use an aggregator, test their plugin in staging first. On go-live, reconcile the first week of M-Pesa settlements by hand against your orders, and confirm the callback URL is reachable over HTTPS. Finally, track your real all-in cost including any aggregator fee and bank sweep, because the headline number is rarely your true cost.

  • Get Till or Paybill and register on Daraja.
  • Test STK Push in the sandbox before production.
  • Reconcile first-week settlements manually.
  • Track true cost including aggregator and sweep fees.

Questions merchants ask

Do I need a developer to accept M-Pesa online?

Not always. A Kenyan payment aggregator with a WordPress or Shopify plugin lets you add M-Pesa with no coding. A custom app or full control needs a developer using the Daraja API.

What is the difference between Till and Paybill?

A Till (Buy Goods) is for retail and checkout amounts set at the point of sale. A Paybill is for payments with a reference number, such as fees or bills. Pick based on how the customer pays.

How fast is settlement with M-Pesa?

Payment confirmation is near instant via callback. The money sits in your Till or Paybill and you sweep it to your bank, which follows Safaricom's withdrawal timeline and may carry a fee.

Can a foreign company use M-Pesa directly?

Direct M-Pesa merchant use expects a Kenyan business with registration, KRA PIN, and a business bank account. Foreign sellers usually collect through a local aggregator or PSP instead.

Public sources