Blog › Business

Accepting Mobile Money on a Website in Tanzania

How to accept M-Pesa, Mixx by Yas, Airtel Money and HaloPesa on your website in Tanzania: the options, what you need to sign up, how the checkout works.

By · · 7 min read

Accepting Mobile Money on a Website in Tanzania

If you sell anything online in Tanzania, mobile money isn't optional. Many of your customers don't have a card that works online, but almost all of them have M-Pesa, Mixx by Yas (formerly Tigo Pesa), Airtel Money or HaloPesa on their phone.

I run usetemplates.store from Zanzibar, and customers in Tanzania can pay for templates with mobile money in TZS. Setting that up taught me a lot, so this is the practical guide I wish I'd had: the ways to accept mobile money on a website, what you need, how the checkout flow works and the details that save you support headaches.

This is general information from my own experience, not legal, tax or financial advice. Payment rules and provider terms change, so confirm the current details with any provider you choose.

The three ways to accept mobile money online

1. Lipa Namba with manual confirmation

Every major network lets a business register a merchant number (Lipa Namba). Customers pay it from their phone's mobile money menu, and you see the payment in your merchant account or SMS.

On a website, this looks like: "Pay TZS 45,000 to Lipa Namba 123456, then enter your transaction ID below." Someone on your team checks each payment by hand.

Good for: very small volumes, testing demand, businesses that already confirm orders by phone or WhatsApp. Downsides: slow for the customer, manual work for you, easy to make mistakes, nothing happens automatically after payment.

2. A payment aggregator (most common)

An aggregator connects to several mobile networks and gives you one API. Your website sends the amount and the customer's phone number; the aggregator sends a payment prompt to the right network and tells your server when the money arrives.

Providers that offer this in Tanzania include Selcom, AzamPay, ClickPesa, Pesapal and Snippe, and international gateways such as Flutterwave and dLocal also list Tanzanian mobile money. Each one supports a slightly different set of networks and features, so check their documentation rather than any comparison article (including this one).

Good for: most online shops, booking sites and digital products. Downsides: a per-transaction fee, and you need to pass their business verification.

3. Direct integration with each operator

Operators offer their own APIs. Vodacom Tanzania, for example, opened its M-Pesa API to developers in 2020. Going direct means a separate contract, integration and settlement for every network.

Good for: large businesses with high volume and a development team. Downsides: much more work, and you'll still need several integrations to cover all your customers.

For most small and medium businesses, an aggregator is the sensible choice.

What you'll typically need to sign up

Each provider sets its own requirements, but the same documents come up again and again for merchant accounts in Tanzania:

  • Certificate of registration (BRELA) for a company or business name
  • TIN certificate from the Tanzania Revenue Authority
  • Business licence
  • ID for the owners or directors (NIDA ID or passport)
  • A business bank account or mobile money account to receive settlements
  • A physical business address
  • Signed terms, and sometimes a description of what you sell and a website link

Ask each provider for their exact KYC list before you start building. It's the step that takes the longest, and you can't take real payments until it's done.

It's also worth checking that a provider is properly licensed. Payment systems in Tanzania are overseen by the Bank of Tanzania, so ask the provider about their licence or the licensed partner they operate through.

How a mobile money checkout works

Whichever aggregator you choose, the flow is almost always the same. In Tanzania it's usually called a USSD push: the payment request appears on the customer's phone without them dialling anything.

  1. Customer chooses mobile money at checkout and enters their phone number. Many checkouts also ask for the network.
  2. Your server creates the payment by calling the provider's API with the amount in TZS, the phone number and your order reference. This must happen on your server, because it uses your secret API key.
  3. The customer's phone shows a prompt with your business name and the amount. They enter their mobile money PIN.
  4. The provider notifies your server with a webhook (an HTTP request to a URL you choose) when the payment succeeds or fails.
  5. Your server checks and fulfils the order: verify the webhook is genuine, confirm the amount and reference match, mark the order paid, send the receipt.
  6. The checkout page updates to show success, usually by checking your server for the order status every few seconds.

Technical details that matter

If you or your developer are building this, these are the parts that cause the most trouble:

  • Never trust the browser. The order is paid when your server receives and verifies the webhook, not when the checkout page says so.
  • Verify webhook signatures. Providers sign their webhooks with a secret. Check it, or anyone could tell your server an order is paid.
  • Use idempotency. Customers double-tap buttons and networks retry requests. Send an idempotency key (Snippe's API, for example, supports an Idempotency-Key header) and make your webhook handler safe to run twice.
  • Handle timeouts. Prompts expire if the customer doesn't respond. If no webhook arrives after a few minutes, ask the provider for the payment status once before giving up.
  • Validate phone numbers. Accept the formats people actually type (0712 345 678, 712345678, +255 712 345 678) and normalise them to the international format the API expects.
  • Use whole-shilling amounts. Round TZS to clean numbers, and show the exact amount before the customer confirms.

Checkout design tips

Mobile money checkouts fail in different ways from card checkouts. A few small things in your design help a lot:

  • Say what will happen. "A payment prompt will appear on your phone. Enter your PIN to pay." Many people have never paid a website this way.
  • Show the network logos so customers recognise their provider immediately.
  • Keep the page open. Tell the customer to keep the checkout page open while they confirm, and show a clear waiting state.
  • Plan for "money left my account but the order didn't confirm". Tell customers not to pay again, and ask for the transaction ID from their SMS so you can match it manually.
  • Show the price in TZS. If you price in another currency, convert at checkout and show the TZS amount clearly.

How I set it up on usetemplates.store

To make this concrete, here is the setup on this store, described as it is, not as a recommendation for every business.

Card payments worldwide go through a card processor in USD. For customers in Tanzania, checkout shows an extra option, Lipa kwa simu, handled by Snippe, a Tanzanian payment provider. The customer enters their phone number and chooses M-Pesa, Mixx by Yas, Airtel Money or HaloPesa; a prompt appears on their phone; they enter their PIN; and the page confirms automatically when the payment arrives. The full customer-facing flow is on the payments page in our docs.

A few choices I made that you may want to copy:

  • Only show mobile money where it works. The option appears only for visitors in Tanzania, and the server also checks that the phone number is a Tanzanian mobile number.
  • The server calculates the amount. The TZS total is worked out on the server from the day's exchange rate, so nobody can change it in the browser.
  • A clear fallback. If a payment goes through but the order doesn't confirm, the customer emails the transaction ID and we match it.

On the developer side, Snippe's documentation describes the same pattern as above: create a payment through its API, the customer receives a USSD push to authorise it, and a webhook tells you when it's complete. Its docs list Airtel Money, M-Pesa, Mixx by Yas and Halotel's HaloPesa. Check its site for current pricing and KYC requirements, and compare it with the other providers listed earlier; I'm not affiliated with any of them.

Connecting mobile money to a website template

Our templates are front-end only: carts and checkouts work in the browser with demo data, and you connect them to the payment provider of your choice. With mobile money that means adding a small server function (on Vercel, Netlify, Cloudflare or your own server) that holds your API key, creates the payment and receives the webhook.

Templates with a cart and checkout flow already built make a good starting point:

  • Noodle Ko (based on a concept by Paras Chauhan): online ordering with a build-your-own bowl, promo codes, a cart and a checkout tracker.
  • MediSwift (based on a design by Shuvo): online pharmacy with search, prescription upload, cart, checkout and order tracking.
  • Olive & Ash (from a design by Ahmad Faizien for OnPoint Studio): a burger house with a cart, deals and table bookings.

You'll find more in the Restaurants & food category. Each has a full live preview, so you can click through the cart and checkout before deciding.

A simple plan to get started

  1. Decide on your approach. For most businesses: an aggregator.
  2. Shortlist two or three providers and ask each for their networks, fees, settlement times and KYC list.
  3. Prepare your documents while you wait for replies.
  4. Build against the sandbox if the provider has one, or with very small real amounts if not.
  5. Test every network your customers use, plus the failure cases: wrong PIN, timeout, cancelled prompt.
  6. Write your support message for payments that go through but don't confirm.
  7. Launch, then watch the first real orders closely.

Mobile money takes a little more care than a card form, but for Tanzanian customers it's the checkout that feels natural. Background reading on how merchant payments have grown here: the IFC's report on the evolution of the mobile money payment market in Tanzania is worth a read.

Yuso

Frequently asked questions

Can I accept M-Pesa on my website without a registered business?

Most payment aggregators and operator merchant accounts ask for business documents such as a certificate of registration, a TIN and a business licence, plus ID for the owners. Requirements differ by provider, so ask each one for their current KYC list before you build anything.

Do I need a separate integration for each mobile network?

Only if you integrate with each operator directly. A payment aggregator gives you one API that sends the payment prompt to the customer's network, whichever it is, and one webhook to tell you when it's paid.

How does the customer actually pay?

They enter their phone number and choose their network at checkout. A payment prompt (a USSD push) appears on their phone showing the amount, they enter their mobile money PIN, and your server is notified when the payment completes.

What happens if the payment prompt doesn't arrive?

Common causes are a wrong number, no signal, a prompt that timed out or an insufficient balance. Let the customer retry from checkout, and tell them not to pay twice if money left their account; ask for the transaction ID from their SMS so you can match it.

Templates in this article

Related articles