Record Metered Usage
Report a usage event against a subscription so metered charges are added to the next invoice.
POST /subscription/usage to report metered consumption against a subscription. Usage-based billing lets you charge a variable amount on top of the plan’s flat fee — for example a base subscription plus a per-request or per-gigabyte charge.
How metered charges reach an invoice
- You define a meter (e.g.
api_requests) with an aggregation mode, and price it on a plan. - Throughout the billing period you call
POST /subscription/usagefor each usage event. - At renewal, Therius aggregates that period’s events per the meter’s aggregation mode, subtracts the plan’s included units, applies the pricing scheme, and adds the result to the invoice as its own line item.
occurredAt timestamp.
Send an optional Idempotency-Key header when your reporting job may retry — a replay with the same (meterCode, Idempotency-Key) pair returns the original event with duplicate: true instead of recording a second one.
Authorizations
Your secret API key: Bearer prv_production_xxx (production) or Bearer prv_sandbox_xxx (sandbox).
Headers
Optional. A replay with the same (meterCode, Idempotency-Key) pair returns the original event instead of recording a second one. Use it when your reporting job may retry.
Body
UUID of the subscription the usage is attributed to.
The code of a usage meter belonging to your merchant account, e.g. api_requests.
"api_requests"
Non-negative quantity for this event, in the meter's units.
500
Your merchant account identifier.
Optional RFC 3339 timestamp of when the usage occurred. Defaults to the time the request is received. Determines which billing period the event falls into.
Response
Event recorded, or the original event on an idempotent replay.
UUID of the usage event.
The meter the event was recorded against.
The recorded quantity.
Timestamp the event was attributed to (the billing-period key).
true when this response is an idempotent replay of a previously recorded event.

