Skip to navigation

Revenue report

Totals for a period by revenue state: recognized (confirmed charges), pending (outcome charges inside their confirmation window), reversible (confirmed but still inside the reversal horizon), reversed, deferred (unused paid credits at cost basis) and breakage (paid credits that expired). Prepaid credits are valued at the cost basis of their grants. These are operating figures for your finance team; confirm accounting treatment with your adviser.

by_line_type splits recognized by the type of invoice line that billed it: usage, outcome, overage (units past a rate’s included_quantity) and minimum_commitment (the shortfall to a commitment, which is a floor and never a ceiling). All four are always listed, with 0 for a type that billed nothing. Send group_by to also get periods: the same figures for each day, week or month of the range, oldest first.

Authentication

AuthorizationBearer

A secret key (rl_sk_test_..., rl_sk_live_...) or a restricted key with limited scopes (rl_rk_test_..., rl_rk_live_...). A restricted key can carry agent: true and an expires_at, and is what a coding agent should hold. Keys end in a checksum so secret scanners can recognize them. People create, roll and revoke keys in the dashboard; GET /v1/api_keys lists them, masked.

Query parameters

period_startdatetimeRequired
Start of the period, inclusive.
period_enddatetimeRequired
End of the period, exclusive.
currencystringRequired
Report in this currency. Charges in other currencies are left out.
group_byenumOptional

Also return periods, one per day, week or month, in UTC (a week starts on Monday). Leave it out for the totals alone.

Allowed values:

Response

The revenue report.
object"revenue_report"
currencystring
period_startdatetime
period_enddatetime
recognizedinteger
Charges confirmed in the period, less reversals in the period.
pendinginteger
Outcome charges still pending or disputed at period end. Not revenue yet.
reversibleinteger
Confirmed charges still inside their reversal horizon at period end.
reversedinteger
Charges reversed during the period.
deferredinteger
Unused paid credits at period end, at cost basis.
breakageinteger
Paid credits that expired unused during the period, at cost basis.
by_line_typelist of objects

recognized split by invoice line type. Always one entry for each of usage, outcome, overage and minimum_commitment. They add up to recognized.

by_outcome_definitionlist of objects
policy_versionstring

The version of the rules that produced these figures. The same version means the same rules; a changed rule is a new version, so two reports can be compared when they carry the same one.

generated_atdatetime
livemodeboolean
group_byenumOptional

Present when the request sent group_by.

Allowed values:
periodslist of objectsOptional

Present when the request sent group_by. The same figures for each bucket, oldest first.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
429
Too Many Requests Error
500
Internal Server Error