Why the workflow comes before the database
Data models built from an org chart or a feature list end up fighting the business. Start with how work actually moves.
CodeWave Engineering
Read ArticleEach Daraja flow solves a different problem and creates different reconciliation work. A practical guide to matching the flow to the business process.
CodeWave Engineering
Engineering team
Published
Most Kenyan business systems will take M-Pesa. The harder question is how. The Daraja API offers several ways to receive money, and the choice shapes everything downstream: what the customer does, what staff see, and how much reconciliation the finance team inherits.
STK Push sends a payment prompt to the customer's phone for a specific amount. The system initiates it, so it already knows who is paying and for what. PayBill (C2B) has the customer pay a business number with an account reference they type themselves. Till ("Buy Goods") is a business number without an account reference — simplest for the customer, least information for the system.
With STK Push, the system created the request, so a confirmation callback can be matched automatically to an invoice or order. With PayBill, matching depends on the customer typing the right account reference — a source of endless "unallocated payments". With Till, there is no reference at all; matching relies on amount, time and a staff member confirming who paid.
A useful rule: the less the system knows before the money moves, the more work a human does after it.
Callbacks arrive late, twice, or not at all. Customers cancel prompts. Networks drop mid-transaction. A production integration needs idempotent callback handling, a status query for anything left pending, and a reconciliation job that compares the ledger to the Daraja statement — before the first customer pays, not after the first dispute.
Written by
CodeWave Engineering · Engineering team
Engineers at CodeWave Systems who design, build and support business software in Kenya. About the team
Keep reading
Data models built from an org chart or a feature list end up fighting the business. Start with how work actually moves.
CodeWave Engineering
Read ArticleShared tables, schema per tenant or database per tenant — the trade-offs in cost, safety and operations, explained without the hype.
CodeWave Engineering
Read ArticleApproval workflows are the easiest process to automate and the easiest to get wrong. What to keep, what to remove and what to record.
CodeWave Engineering
Read ArticleStart a project
Tell us how it runs today. We will come back with questions, then a clear proposal.