Report Usage Event
Reports one usage event (value, occurred_at) for an active subscription against a meter, idempotent on event_id.
403 PRODUCT_NOT_ENABLED.X-Idempotency-Key header. Yuno resolves the meter from event_name, validates the event synchronously and stores it against the subscription_id. ACTIVE, TRIALING and PAST_DUE subscriptions accept usage — PAUSED, CANCELED and COMPLETED are rejected with 400 SUBSCRIPTION_NOT_ACTIVE and nothing is counted. Usage is aggregated per subscription and billing cycle according to the meter’s aggregation, and any usage beyond the included credits is billed on the subscription’s renewal charge.
event_id is your idempotency keyGenerate a unique event_id for every event (a UUID or your own event/request id) and reuse it on retries. A replay returns the same response as the first call — including the original value, even if the retry carried a different one (the retry’s value is discarded) — and the usage is never counted twice. event_id is unique per account and required: a request without it is rejected with 400. This is the mechanism that protects billing; X-Idempotency-Key is accepted (optional, as on the rest of the Yuno API) but is not required and is not what dedupes usage.occurred_at defaults to the time Yuno receives the event (returned as received_at). You can backdate up to 35 days; older values are rejected with 400. Which billing cycle an event lands in is decided by occurred_at, not by when it was received.event_name (or an archived meter) is a 400 METER_NOT_FOUND; an unknown subscription_id is a 400 SUBSCRIPTION_NOT_FOUND. The event carries no country or account_id — both are resolved from the subscription.Authorizations
Headers
The account_id found in your Yuno Dashboard (UUID). Required — omitting it returns 400 BAD_REQUEST ("Invalid x-account-code header.").
Body
The unique identifier of the subscription the usage is attributed to (MAX 64; MIN 36). Must exist in your account (400 SUBSCRIPTION_NOT_FOUND) and be ACTIVE, TRIALING or PAST_DUE (400 SUBSCRIPTION_NOT_ACTIVE). Usage is metered per subscription and billed on that subscription's renewal.