API Reference

Reports

Query revenue totals, aging buckets, and per-client analytics from the Rebill API. Covers revenue, outstanding, and client revenue report endpoints with response schemas.

The reports endpoints give you aggregated analytics about your revenue, outstanding invoices, and per-client performance. All amounts are returned in cents.

Revenue report

GET /report/revenue

Returns revenue earned from paid invoices within a date range, broken down by period.

Query parameterRequiredDescription
fromYesStart date in ISO 8601 format (e.g. 2026-01-01)
toYesEnd date in ISO 8601 format (e.g. 2026-03-31)
periodNoGrouping: monthly (default) or weekly
include_invoicesNoSet to true to include individual invoice records in the response
curl "https://rebill-api-896466068278.africa-south1.run.app/report/revenue?from=2026-01-01&to=2026-03-31&period=monthly" \
  -H "Authorization: Bearer sk_your_secret_key"

Response:

{
  "total_revenue": 450000,
  "invoice_count": 9,
  "average_invoice": 50000,
  "revenue_by_currency": {
    "ZAR": 450000
  },
  "period_breakdown": [
    {
      "period": "2026-01",
      "label": "Jan 2026",
      "revenue": 150000,
      "count": 3,
      "amounts": { "ZAR": 150000 }
    }
  ]
}
Response fieldTypeDescription
total_revenueintegerTotal revenue in cents (primary currency)
invoice_countintegerNumber of paid invoices
average_invoiceintegerAverage invoice value in cents
revenue_by_currencyobjectRevenue broken down by currency code
period_breakdownarrayRevenue grouped by period (month or week)
invoicesarrayIndividual paid invoices (only if include_invoices=true)

Outstanding (aging) report

GET /report/outstanding

Returns outstanding invoice balances grouped into aging buckets: current (not yet due), 1โ€“30 days overdue, 31โ€“60 days, 61โ€“90 days, and 90+ days overdue.

curl https://rebill-api-896466068278.africa-south1.run.app/report/outstanding \
  -H "Authorization: Bearer sk_your_secret_key"

Response:

{
  "total_outstanding": 320000,
  "buckets": [
    { "label": "Current",    "days": "0",    "amount": 150000, "count": 3 },
    { "label": "1-30 days",  "days": "1-30", "amount": 80000,  "count": 2 },
    { "label": "31-60 days", "days": "31-60","amount": 60000,  "count": 1 },
    { "label": "61-90 days", "days": "61-90","amount": 30000,  "count": 1 },
    { "label": "90+ days",   "days": "90+",  "amount": 0,      "count": 0 }
  ]
}

Client revenue report

GET /report/clients

Returns a breakdown of revenue earned per client, sorted by total revenue descending.

curl https://rebill-api-896466068278.africa-south1.run.app/report/clients \
  -H "Authorization: Bearer sk_your_secret_key"

Response:

{
  "clients": [
    {
      "client_id": "xyz789",
      "client_name": "Acme Corp",
      "total_revenue": 250000,
      "invoice_count": 5
    }
  ]
}

Expense report

GET /report/expenses

Returns expense totals broken down by category and by period, with an optional profit summary comparing expenses against invoiced revenue.

Query parameterRequiredTypeDescription
fromYesdateStart of range (YYYY-MM-DD)
toYesdateEnd of range (YYYY-MM-DD)
periodNostringmonthly (default), quarterly, or yearly
include_profitNobooleanInclude a profit summary comparing revenue against expenses
curl "https://rebill-api-896466068278.africa-south1.run.app/report/expenses?from=2026-01-01&to=2026-03-31&period=monthly&include_profit=true" \
  -H "Authorization: Bearer sk_your_secret_key"

Response:

{
  "total_expenses": 185000,
  "expense_count": 12,
  "by_category": [
    {
      "category_id": "cat-001",
      "category_name": "Travel & Transport",
      "total": 75000,
      "count": 5
    }
  ],
  "period_breakdown": [
    {
      "period": "2026-01",
      "label": "Jan 2026",
      "total": 62000,
      "count": 4
    }
  ],
  "profit_summary": {
    "revenue": 450000,
    "expenses": 185000,
    "net_profit": 265000
  }
}

The profit_summary field is only present when include_profit=true. Revenue is calculated from invoices issued within the date range.

Was this article helpful?