Zinen Technologies logo
A customer paying with a smartphone over a card reader
Automation & Integrations

M-Pesa Daraja API Integration: STK Push, Paybill and Automatic Reconciliation

28 October 2026 · 5 min read · By Zinen Technologies

M-Pesa integration means payments are recorded when they happen, not found later on a statement. Here are the main Daraja building blocks.

From statements to callbacks

Many businesses still reconcile M-Pesa by scrolling through statements. With Safaricom's Daraja APIs, your system is notified of each payment as it happens and can record it, match it and issue a receipt. That is what an M-Pesa integration delivers.

STK push

With STK push (M-Pesa Express), your system sends a payment prompt to the customer's phone. They enter their PIN and your system receives the result by callback. It suits checkout, invoices and portals because the customer does not have to type a Paybill number or account reference.

Paybill and Till payments (C2B)

For customer-initiated payments, you register validation and confirmation URLs so Safaricom notifies your server of each payment. The account reference, such as an invoice or member number, tells you what to credit. Unmatched or mistyped references need a review queue.

Payouts (B2C)

Business-to-customer payments let you send money to phones: refunds, commissions, wages or farmer payments. They need approval controls inside your system and the right permissions on your account.

Questions developers and finance teams ask

Do I need a Paybill or a Till? It depends on your business. Paybill uses account references and suits invoicing, while a Till suits retail. Safaricom can advise on eligibility.

Why did a customer's payment not appear? Common causes are delayed callbacks, wrong references and network issues. Status queries and a review queue handle these.

Can the system refund a customer? Through B2C or reversals, with approval controls.

Mistakes to avoid

Trusting callbacks without verifying them. Not handling duplicate callbacks. Ignoring partial payments and overpayments. Keeping credentials in source code. Testing only the happy path in the sandbox. Each causes real problems once money flows.

Mobile money beyond Kenya

Uganda, Tanzania, Rwanda, Ghana and other countries run mobile money through different operators and APIs, such as MTN MoMo and Airtel Money. The design of the integration, callbacks, matching and receipts, carries over, but the API details differ. If you need mobile money outside Kenya, tell us the operator and country so we can check API access.

Go-live and edge cases

Going live needs your own shortcode and Safaricom's approval. Real payments bring duplicates, delayed callbacks, partial payments and overpayments, so status queries and review queues matter. Callbacks must use HTTPS and be verified. Pair this with bank integration for a complete picture.

To integrate M-Pesa with your website, ERP or app, talk to Zinen Technologies.

Visual context

The systems and environments discussed in this guide

M-Pesa Daraja API Integration: STK Push, Paybill and Automatic Reconciliation — A customer paying with a smartphone over a card reader
A customer paying with a smartphone over a card reader
M-Pesa Daraja API Integration: STK Push, Paybill and Automatic Reconciliation — A man holding a bank card while using a laptop for an online payment
A man holding a bank card while using a laptop for an online payment
M-Pesa Daraja API Integration: STK Push, Paybill and Automatic Reconciliation — A workflow diagram mapping a business process step by step
A workflow diagram mapping a business process step by step
#M-Pesa Daraja#STK push#Paybill integration#B2C#payment reconciliation

Ready to put this into practice?

Book a free demo and we'll show you exactly how this fits your business.