Get headline billing metrics
const url = 'http://localhost:8080/v1/analytics/overview?period=7d';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'http://localhost:8080/v1/analytics/overview?period=7d' \ --header 'Authorization: Bearer <token>'Returns the dashboard’s headline metrics for a rolling window that ends now, with values for the window before it where a comparison makes sense.
Money is in cents of the tenant’s default currency (USD when none
is set), named in currency. Invoices and plans in other
currencies are left out. MRR (monthly recurring revenue) counts
plan base fees only: base amount times quantity, with yearly
plans divided by 12. Usage charges are not included. Data from
test clocks is left out.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”The window. Any other value is treated as 30d. 12m is 365 days.
Responses
Section titled “Responses”Headline metrics.
“The window” is the requested period, ending now. “The previous
window” is the one of equal length before it. Money is in cents of
currency.
object
The tenant’s default currency. Every money field uses it, except credit_balance_by_currency and outstanding_by_currency, which carry their own.
MRR of active subscriptions now.
MRR at the start of the window, rebuilt from item change history.
mrr times 12.
mrr_prev times 12.
What paid the invoices paid in the window (payment plus customer credit applied). A credit note that lowered an invoice before it was paid is not counted.
revenue for the previous window.
Amount due on finalized invoices whose payment has not succeeded, in currency only.
Amount due on the invoices open_invoices counts, one entry per
currency. currency comes first, then the largest amount. Empty
when nothing is owed.
object
Average total of invoices paid in the window.
Customers’ credit balances added up per currency, currency first, then largest. A currency whose balance is zero is left out. Customers on a test clock are not counted.
object
Customer records with status active. Includes customers with
no subscription or only canceled ones; live_customers counts
the customers you bill.
Customers created in the window.
Customers with at least one active or trialing subscription now.
live_customers at the start of the window, rebuilt from
subscription start and cancel times.
Subscriptions with status active.
Subscriptions with status trialing.
Invoices paid in the window.
Open invoices created in the window whose payment failed. A voided or written-off invoice is not counted. All currencies.
failed_payments for the previous window.
Finalized invoices whose payment has not succeeded. All currencies.
Dunning runs (automatic payment retries) still in progress.
Issued credit notes whose refund failed, has an unknown result, has been pending for more than 72 hours, or has not started an hour after issue.
Usage events with a timestamp in the window.
Subscriptions canceled in the window, divided by subscriptions active at its start. 0 when none were active.
Churned MRR divided by mrr_prev. 0 when mrr_prev is 0.
Net revenue retention: (mrr_prev + expansion - contraction -
churned) divided by mrr_prev. Can be above 1. 0 when
mrr_prev is 0.
Dunning runs opened in the window that a payment closed (resolution is payment_recovered and the invoice has amount_paid_cents above 0), divided by all runs opened in the window. A run closed by a void, a write-off, or a credit note or customer credit that left nothing due is not recovered. 0 when none were opened.
MRR change in cents. churned and contraction are positive
amounts. net = new + expansion - contraction - churned.
object
Example
{ "period": "7d"}