Analytics

Query revenue analytics

Aggregates revenue_facts by the requested dimensions at day/period/total granularity. allocation_policy places whole-period charges on their booked day (billed) or spreads them across the period (amortized); include_adjustments breaks out true-up/overage/revert amounts as labeled rows. Requires the tenant's revenue analytics setting.

post/analytics/revenue

Request body

allocation_policy'billed' | 'amortized'
currencystring
customer_idsstring[]

Filters restrict the rows before aggregation.

end_timestring date-time
granularity'day' | 'period' | 'total'
group_bystring[]

GroupBy dimensions: revenue_source, source (the event source recorded in meter_usage; requires customer_ids or subscription_ids), customer_id, subscription_id, price_id, meter_id, currency. revenue_source is always applied — every row says what kind of revenue it is — and requested dimensions are added on top.

include_adjustmentsboolean

IncludeAdjustments breaks the non-obvious components — commitment true-ups, overage and revert (contra) rows — out as their own rows, each labeled with its kind in adjustment_type. Off, they fold into their parent buckets (true-up/overage into usage, reverts into their own source) so visible rows read as plain usage/fixed. Totals are identical either way.

meter_idsstring[]
price_idsstring[]
start_timestring date-time required

StartTime/EndTime bound the day range (inclusive days derived in UTC). EndTime is optional and defaults to now.

status'PROVISIONAL' | 'FINAL'
subscription_idsstring[]

Response

OK

contains_allocatedboolean

ContainsAllocated is true when any bucket includes whole-period amounts spread across days (amortized) or booked on a single day (billed) — i.e. the day view carries period-shaped charges, not only true daily accruals.

Changes

Changed in 7 of the 149 revisions of this API.26