Skip to main content
GET
Retrieve Subscription Usage
Returns the metered usage a subscription has accrued in its current billing period, priced by the meters attached to its plan — one item per meter, with the aggregated quantity, the quantity that is actually billable after any included credits are consumed, the unit price and the resulting amount, plus a total for the period. This is a read: it does not itself trigger billing. See Usage-Based Billing for how a subscription accrues meters, credits and pricing in the first place.

Reading the response

Every quantity and amount is a JSON number.
A subscription with one metered item

When there is nothing to bill

A subscription whose plan has no meters, or that has no plan at all, returns items: [] and a zero total rather than an error.
Reporting is asynchronousPOST /subscriptions/meters/events answers 202 once the event is validated, before it is stored. A usage read that lands moments after reporting an event can still show the total from before that event — a subscription’s items stayed at the same quantity and events_count on a read taken immediately after a further event was reported on stg. Allow a short delay before relying on a read to reflect the very latest report.

Errors

Authorizations

public-api-key
string
header
default:<Your public-api-key>
required
private-secret-key
string
header
default:<Your private-secret-key>
required

Headers

X-Account-Code
string
required

The account_id found in your Yuno Dashboard (UUID).

Path Parameters

subscription_id
string
required

The unique identifier of the subscription.

Response

200

subscription_code
string
Example:

"c2094820-df10-4bd4-b7ef-dbe0d28db857"

period
object

The subscription's current billing period.

currency
string
Example:

"COP"

items
object[]

One entry per meter attached to the subscription's plan. Empty when the plan has no meters, or the subscription has no plan.

total
object

The sum of every item's amount for the period. Zero when items is empty.