Get Invoice Stats
Finance dashboard summary — accrual basis (what has been invoiced, not yet collected).
Sections returned:
-
pipeline — count of invoice requests at each lifecycle stage:
awaiting_upload(finance must act),invoice_uploaded(sent to client),paid,partially_paid,unpaid,written_off,cancelled,new_today. -
collection — AR health indicators:
collection_rate_pct(% of requests fully paid),ar_outstanding(KES owed right now),avg_dso_days(average days from invoice issue to payment — benchmark 30–60 days),overdue_count/overdue_amount(past due_date and still open),bad_debt_ratio_pct(written-off / total invoiced — target < 1%). -
invoiced — accrual totals for the period and year-to-date. Use alongside
GET /payments/stats(cash basis) to see the gap. -
aging — open AR split into four buckets by days outstanding:
0_30_days,31_60_days,61_90_days,90_plus_days. Each hascount(number of invoice requests) andamount(KES outstanding). Colour-code for the UI: 0–30 green, 31–60 amber, 61–90 red, 90+ critical. -
by_category — AR outstanding, total invoiced, and collection rate broken down by campaign category (Direct, Agency, Digital, Government). Use for a bar chart or table showing which segment is slowest to pay.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Reporting window. One of the preset windows below, or custom (requires date_from and date_to):
- today — current day only
- week — Monday of the current week to today
- mtd — Month To Date: 1st of this month to today
- qtd — Quarter To Date: 1st of this quarter to today (e.g. Apr 1 in Q2)
- ytd — Year To Date: Jan 1 to today
- rolling_30 — last 30 calendar days, regardless of month boundaries
- rolling_60 — last 60 calendar days
- rolling_90 — last 90 calendar days (standard treasury lookback)
- custom — supply
date_from=YYYY-MM-DD&date_to=YYYY-MM-DD
Start date for period='custom' (YYYY-MM-DD).
End date for period='custom' (YYYY-MM-DD).
Response
Successful Response
