Usage Records

Report metered usage for a subscription item and retrieve period summaries.

View as Markdown

A usage record reports the quantity consumed for a metered subscription item. VINR accumulates these records throughout the billing cycle and converts the total into a line item on the invoice when the period ends.

Illustrative content. Hand-authored to demonstrate the Standard/Advanced pattern; the production page will be generated from the VINR OpenAPI spec (roadmap item #1). Field names are representative.

The usage record objectAsk

FieldTypeDescription
idstringUnique identifier, e.g. ur_4Cw9pL.
subscription_itemstringThe si_ this record belongs to.
quantityintegerUnits consumed (or set, depending on action).
timestamptimestampUnix timestamp the usage occurred.
actionenumincrement (add to running total) or set (replace the running total).

Create a usage recordAsk

Report usage for a metered subscription item. Use action=increment (the default) to add to the running total, or action=set to replace it — useful when reporting a gauge-style metric like active seats.

List usage record summariesAsk

Returns aggregated usage totals for each billing period. Each summary contains the period boundaries and the total usage VINR will bill at period end — not the individual records themselves.

Usage records do not fire events directly. Usage is consumed when VINR finalizes the invoice at the end of the billing period — listen to invoice.created and invoice.payment_succeeded / invoice.payment_failed to track metered billing outcomes. See Events.

Was this page helpful?