Skip to content

Nairobi · East Africa

Case study · Retail & Distribution

Cutting Order-to-Cash by 15 Days for an FMCG Distributor

How we automated ordering, M-Pesa reconciliation and KRA eTIMS invoicing for a distributor serving 1,200 retail outlets across Kenya.

Client
FMCG distributor (name withheld under NDA)
Location
Nairobi, Nakuru & Eldoret, Kenya
Duration
20 weeks
Services
Business Automation, Software Development, Systems Integration, Managed IT
Point-of-sale terminal on a retail shop counter

-15 days

Days sales outstanding

94%

Payments auto-reconciled

100%

Invoices eTIMS-validated

-68%

Order entry errors

Challenge

Orders arrived on paper and WhatsApp, M-Pesa payments were matched to invoices by hand in Excel, and the business had to become eTIMS-compliant without slowing deliveries.

Solution

An offline-first field sales app, Daraja C2B and STK Push payments with automatic invoice matching, eTIMS e-invoicing, credit checks and dispatch planning, all feeding live dashboards.

Impact

Days sales outstanding fell from 41 to 26, 94% of payments now reconcile automatically, and every invoice is eTIMS-validated at the point of issue.

About the client

The client is a privately owned fast-moving consumer goods distributor holding regional rights for several household, beverage and personal-care brands. It operates three depots in Nairobi, Nakuru and Eldoret and serves roughly 1,200 active retail outlets, from supermarkets to small dukas and wholesalers in peri-urban markets.

The business employs around 180 staff, including 46 field sales representatives and a fleet of 28 delivery vehicles. Finance and back-office work is centralised at the Nairobi head office, which runs a mid-market accounting ERP that had been in place for almost a decade.

The challenge

Growth had outpaced the processes behind it. Sales reps wrote orders in carbon books or sent photos over WhatsApp, and six clerks keyed them into the ERP the following morning. Roughly one order in nine needed correcting because of wrong SKUs, unit-of-measure mix-ups or duplicated lines.

Collections were the bigger problem. Around 70% of customer payments came in through the company's M-Pesa paybill, but customers rarely used the invoice number as the account reference. Four finance staff spent most of each day exporting paybill statements and matching them to invoices in Excel, typically two to three days behind. At month end, about KES 18 million sat as unapplied cash. Credit limits were therefore based on stale balances, and reps kept supplying outlets that were already overdue.

On top of this, the client needed every sales invoice transmitted through KRA eTIMS. The existing ERP had no native integration, and the interim workaround of re-entering invoices on a separate device was not sustainable at roughly 650 invoices a day.

Objectives

  1. Capture orders digitally at the outlet, including in areas with poor mobile coverage.
  2. Reconcile M-Pesa payments against open invoices automatically and in near real time.
  3. Achieve full KRA eTIMS compliance without adding steps at the depot.
  4. Enforce credit limits at order time using live balances.
  5. Give management a single, current view of sales, collections and deliveries.

Our approach

Discovery & audit

We spent two weeks riding along with sales reps, sitting with depot dispatchers and shadowing the finance team. We mapped the full order-to-cash flow, sampled three months of paybill transactions and found that only 31% carried a usable invoice reference. That single figure shaped much of the design. We also documented the ERP's data model and confirmed which records could be written to safely through its API.

Design

Rather than replace the ERP, we kept it as the system of record for stock and the general ledger and built an integration layer around it. Key design decisions were:

  • Offline-first mobile ordering, so reps could take orders and sync later in areas with patchy coverage.
  • A matching engine that uses several signals (payer phone number, outlet account, amount, invoice age) rather than relying on the payment reference alone.
  • STK Push at the point of delivery, so drivers could request payment against a specific invoice and remove ambiguity at source.
  • Personal data handling aligned with the Kenya Data Protection Act 2019, including masked customer phone numbers in reports and role-based access to payment data.

Deployment

We rolled out depot by depot, starting with Eldoret, the smallest. Each depot ran the new process in parallel with the old one for a week before cutover. Go-lives were scheduled for the second week of the month to stay clear of month-end closing, and the Nairobi depot went live after the December trading peak rather than during it.

Solution architecture

ComponentRole
Field sales app (Flutter, SQLite)Offline order capture, outlet history, credit status refreshed on every sync
Integration API (NestJS, PostgreSQL)Orders, pricing, credit rules and two-way sync with the ERP
M-Pesa Daraja C2B and STK PushPaybill confirmation callbacks and driver-initiated payment requests
Reconciliation engineScores each receipt against open invoices and auto-applies above a confidence threshold
KRA eTIMS (OSCU) integrationSigns and transmits invoices, stores control numbers and QR codes for printing
Dispatch moduleGroups approved orders into routes by depot, vehicle capacity and delivery day
Power BI dashboardsSales, DSO, collections, exceptions and route performance

Customer paying for an order by scanning a QR code on a phoneManagement dashboards combine ERP, M-Pesa and dispatch data into a single daily view.

Credit checks run on the server at sync time. If an outlet is over its limit or has invoices older than 45 days, the order is held for approval by the regional manager, who can release it from their phone.

Implementation timeline

PhaseWeeksKey deliverables
Discovery & process mapping1–2Current-state map, payment data analysis, ERP integration assessment
Design & prototyping3–5Solution design, app prototype tested with eight reps, initial matching rules
Build & integration6–13Mobile app, integration API, Daraja and eTIMS integration, dashboards
Pilot (Eldoret depot)14–15Parallel run, rule tuning, STK Push training for drivers
Rollout (Nakuru, then Nairobi)16–19Phased cutover, finance team training, exception workflow
Handover to managed support20Runbooks, SLA monitoring, hypercare close-out

Results

MetricBeforeAfterChange
Days sales outstanding41 days26 days-15 days
Payments reconciled automatically0%94%+94 pts
Invoices eTIMS-validated at issueManual re-entry100%Fully automated
Order entry error rate11%3.5%-68%
Unapplied cash at month end~KES 18m< KES 2m-89%

The four finance staff who previously did manual matching now clear the exception queue in under an hour a day and have moved into credit control and customer follow-up. Because balances are current, credit holds now reflect reality, and the share of invoices more than 60 days overdue fell by more than half over the first two quarters.

What made the difference

  • Fixing the data at source. STK Push at delivery did more to improve reconciliation than any matching rule, because the payment arrives already linked to an invoice.
  • Designing for the field, not the office. Offline-first sync and a three-tap reorder flow for regular outlets won over reps who had been sceptical of earlier tools.
  • Keeping the ERP. Integrating rather than replacing reduced risk and kept the finance team on familiar ground.
  • Depot-by-depot rollout. Each go-live improved the next, and no depot lost a trading day during cutover.

What's next

TechBytes now supports the platform under a managed services agreement covering application monitoring, Daraja and eTIMS integration health, and a quarterly review of matching rules. The next phase adds a self-service ordering portal for larger wholesale customers and demand forecasting based on outlet order history, to improve stock positioning across the three depots.

Talk to an engineer

Ready to make IT the predictable part of your business?

Tell us what you're planning. A solutions engineer will scope it and send a fixed-price proposal in USD.

Chat on WhatsApp

Prefer a call? +254 711 974 716

WhatsApp