Adding M-Pesa STK Push Billing to Your Clinic
Billing & Payments · 5 min read · Updated 2026-06-26
Cash handling is slow, error-prone, and a reconciliation headache at the end of every day. For Kenyan clinics, M-Pesa STK push is the single biggest upgrade you can make to billing: the patient pays from their phone, the payment is confirmed in seconds, and the receipt is automatic. Here is how it works and what it takes to set up.
What "STK push" actually means
STK push (SIM Toolkit push) is the prompt that appears on a customer's phone asking them to enter their M-Pesa PIN to confirm a payment. Instead of the patient manually entering a paybill, an account number, and an amount, and getting any of them wrong, your system sends the exact amount to their number, and they just approve it.
The flow is:
- Cashier enters the bill in the system and the patient's phone number
- The system triggers an STK push to that number
- The patient sees the amount and enters their M-Pesa PIN
- M-Pesa confirms the payment back to your system in real time
- The receipt is generated automatically and the bill is marked paid
Why it beats manual paybill
- No wrong amounts. The amount is fixed by the system, not typed by the patient.
- No "did it go through?" limbo. Confirmation comes back automatically; the cashier sees paid/failed immediately.
- No manual reconciliation. Every payment is already matched to a bill, so end-of-day reconciliation is mostly done.
- Faster queues. The whole exchange takes seconds.
What you need to set it up
- An M-Pesa business shortcode (paybill or till) for your facility
- API credentials from Safaricom Daraja for that shortcode
- A billing system that supports STK push and handles the confirmation callback
The callback is the part people underestimate: your system has to receive Safaricom's confirmation and update the bill. Without that, you are back to checking SMS manually.
Handling the real-world edge cases
- Patient cancels or times out the bill stays unpaid; the cashier can retry or take cash.
- Split payments part cash, part M-Pesa is common; your system should support it.
- Wrong number the push goes to the number entered, so confirm it at the counter.
How AfyaConnect does M-Pesa billing
AfyaConnect has STK push built into the billing and pharmacy POS modules. The cashier enters the bill, triggers the push, and the confirmation callback marks the bill paid and prints the receipt automatically. Split payments combining cash and M-Pesa are supported, and receipts can be shared over WhatsApp. Because payments are matched to bills automatically, daily reconciliation stops being a chore.
Want cashless collections without building Daraja integration yourself? Register your facility and M-Pesa billing works out of the box.