Skip to main content
POST
Query revenue analytics

Authorizations

x-api-key
string
header
required

Enter your API key in the format x-api-key <api-key>*

Body

application/json

Revenue analytics request

start_time
string<date-time>
required

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

allocation_policy
enum<string>
Available options:
billed,
amortized
currency
string
customer_ids
string[]

Filters restrict the rows before aggregation.

end_time
string<date-time>
granularity
enum<string>
Available options:
day,
period,
total
group_by
string[]

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_adjustments
boolean

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_ids
string[]
price_ids
string[]
status
enum<string>
Available options:
PROVISIONAL,
FINAL
subscription_ids
string[]

Response

OK

contains_allocated
boolean

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.

query
object
rows
object[]