Resources — Guide

Setting up M-Pesa STK Push and C2B on your own paybill

Connecting Daraja to CoreSync so subscriber payments reconcile automatically, from STK prompt to ledger entry.

Why your own paybill matters

Plenty of billing tools in this market collect on their paybill and settle to you later. That puts your cash flow inside someone else's account, adds a settlement delay, and makes your M-Pesa statement useless as a source of truth. CoreSync connects to your paybill through Safaricom's Daraja API — money lands in your account directly, and the platform only reads and matches the transactions.

You keep your float, your statement, and your relationship with Safaricom. CoreSync keeps the books in sync.

What you need before you start

The setup takes an afternoon if the paperwork is in place.

  • A registered paybill or till number in your business name
  • A Safaricom Daraja developer account with your app created (consumer key and secret)
  • Your C2B validation and confirmation URLs — CoreSync generates these for your tenant
  • For STK Push: the paybill's passkey from the Daraja portal

The two rails, and when each fires

STK Push is the prompt: a subscriber taps Pay in the portal (or a hotspot user buys access), their phone lights up, they enter a PIN, done. It carries the account reference for them, so the match is exact by construction.

C2B is the fallback that catches everyone else: the subscriber who dials the paybill directly from the SIM toolkit at 11pm. Here the account number they type is the matching key — which is why CoreSync matches by account reference first, then falls back to the registered phone number. A parent paying for a student's account still reconciles.

Match by account reference first, phone number second — the human paying is not always the human subscribing.

Idempotency: the part most setups get wrong

Safaricom retries callbacks. If your system applies a payment every time a callback arrives, a network hiccup becomes a double credit and a month-end argument. CoreSync applies each transaction exactly once — a retried callback is recognized and acknowledged without touching the wallet again. This is enforced at the application layer, per transaction ID, not left to hope.

Testing before going live

Run one real payment of a few shillings through each rail before you announce anything: one STK prompt from the portal, one direct paybill payment with the account number typed by hand, and one with the account number typed wrong. The first two should reconcile automatically; the third should land in the unmatched queue for one-click assignment — that queue is your safety net, and knowing it works is the difference between calm and panic on the first billing day.

Create accountSee pricing

Create your account

Launch your ISP on CoreSync today

Tell us who you are and we will set up your workspace, walk you through onboarding and help you import your existing subscribers.

  1. 1Create your workspace — your own subdomain, branding and paybill.
  2. 2Connect your network — routers, RADIUS and OLTs, with our engineers on the call.
  3. 3Import subscribers and go live — from your current system or a spreadsheet.