M-Pesa collection and reconciliation

    Payment arrives, the system works out whose it was, and access opens — without anyone reading an SMS.

    ✓ STK Push and Paybill✓ Safaricom Daraja API✓ Duplicate detection✓ Retries on failure

    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.

    Common questions

    Do I need my own Daraja credentials?
    You can use your own Paybill or Till with your own Daraja API access, which most established ISPs prefer. If you do not have Daraja access yet, you can still collect while you apply — that is usually the blocker for a new operator, and it should not stop you selling.
    How fast is a customer reconnected after paying?
    Seconds, once Safaricom's callback arrives. The delay is almost never in the billing system — it is how quickly Daraja posts the confirmation, which is normally immediate and occasionally slow when Safaricom is under load.
    What if a customer pays the wrong amount?
    The payment is recorded against them and the shortfall is visible rather than being silently ignored or silently accepted. Part payments do not quietly extend a full month.
    Does it work with a bank Paybill rather than Safaricom's?
    Yes. Collection can route to a bank Paybill, which matters if you would rather settle into a bank account than an M-Pesa wallet.

    See it on your own network

    Seven days free, on the MikroTik routers you already run, with your own customers.