M-Pesa collection and reconciliation
Payment arrives, the system works out whose it was, and access opens — without anyone reading an SMS.
Two ways money reaches you
Both run through Safaricom's Daraja API, and they give your subscribers very different experiences.
- STK Push — your system sends the request and a prompt appears on the subscriber's phone. They approve the amount. No Paybill number to find, no account reference to mistype. For hotspot sales at a login page this is effectively the only method that converts.
- Paybill or Till — the subscriber pays and enters their account number as the reference. Safaricom posts a callback, which is matched to the subscriber and their package updated. It works, and it depends on them typing the reference correctly.
What happens when the callback lands
The sequence is fixed and nobody touches it: the callback arrives, the payment is matched to a subscriber by account reference or by the phone number that paid, the subscription is extended, and the router is updated so a suspended customer is back online. A receipt goes out by SMS.
The parts that go wrong, and what happens then
Mobile money is not a reliable network and a billing system is mostly judged on its bad days.
- Safaricom unreachable — payments that cannot be confirmed immediately are held and resolved rather than dropped, so a customer who paid during an outage is not left off.
- Duplicate callbacks — Safaricom can deliver the same confirmation twice. These are detected, so one payment never renews a subscription twice.
- Wrong account reference — payments that match no subscriber are surfaced for a human rather than silently discarded.
- Pending results — a pending status is not a failure. Transactions are followed up until Safaricom returns a verdict, and that verdict is stored.
Beyond M-Pesa
Kenyan ISPs can also collect through PayHero and Paystack. In Uganda, collection runs on MTN Mobile Money and Airtel Money, billed in Ugandan shillings rather than converted from a dollar price.
What happens on expiry
The other half of the loop: suspension when a subscription lapses, restoration when it is paid.
ReadWhat Jasiyo costs
KSh 25 per PPPoE customer, 3% of hotspot revenue, KSh 1,000 minimum.
ReadConnecting Daraja
The setup guide, step by step, including the credentials Safaricom asks for.
ReadCommon questions
Do I need my own Daraja credentials?
How fast is a customer reconnected after paying?
What if a customer pays the wrong amount?
Does it work with a bank Paybill rather than Safaricom's?
See it on your own network
Seven days free, on the MikroTik routers you already run, with your own customers.
