Skip to content
Console
On this page

Usage events

A Usage Event is rated usage, immutable: what a settled reservation or a direct record produced.

A Usage Event is rated usage, immutable: what a settled reservation or a direct record produced.

Service Sylphx Money · Resource type money.sylphx.com/UsageEvent · Name pattern orgs/{org}/projects/{project}/envs/{env}/usage_events/{usage_event} · Shape record

Fields

FieldTypeWhat it is
namestringorgs/{org}/projects/{project}/envs/{env}/usage_events/{usage_event}.
uidstringuevt_<cell><ulid>; never reused. Output only.
metaResourceMetaResource metadata.
subjectSubjectWho used it. Required.
subject_proofstringAs on UsageReservation. Required.
actor_proofstringAs on UsageReservation.
meterstringThe meter's lookup key. Required.
quantityint64How much, in the meter's base unit. Required.
occurred_timetimestampWhen the work happened. Required.
amount_nanostringThe rated amount, nano-minor, a decimal string. Output only.
usage_reservationstringThe reservation it settled, when it did. Output only.
lateboolSettled after the reservation expired; the usage is still recorded. Output only.

Methods

Every method of the collection, in the registry's order, with the scope it needs. The full request, response and examples are one link away.

MethodCallWhat it does
POSTcreateRecords usage directly, only for a meter the merchant marked reservation-optional.
POSTbatch_ingestRecords a batch of already-incurred usage from the merchant's own servers (Stripe's meter-event model): the caller is a key of the merchant's own org holding the exact grant billing:metering:ingest, which no wildcard covers, and each event names its subject with no subject proof. Each event is keyed by its project, meter, meter version and event id: a replay is a no-op (duplicate), and the same key with different content is a conflict and never counted. One result per event, in request order.
GETlistLists usage events, newest first.
POSTcheck_standingReads a subject's standing: active, past due or suspended, whether a payment method is on file, headroom and the threshold.

create

Records usage directly, only for a meter the merchant marked reservation-optional.

POST https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/usage_events · scope billing:metering:write · effect write · Request, response and examples

batch_ingest

Records a batch of already-incurred usage from the merchant's own servers (Stripe's meter-event model): the caller is a key of the merchant's own org holding the exact grant billing:metering:ingest, which no wildcard covers, and each event names its subject with no subject proof. Each event is keyed by its project, meter, meter version and event id: a replay is a no-op (duplicate), and the same key with different content is a conflict and never counted. One result per event, in request order.

POST https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/usage_events:batchIngest · scope billing:metering:ingest · effect write · Request, response and examples

list

Lists usage events, newest first.

GET https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/usage_events · scope billing:read · effect read · paginated · Request, response and examples

check_standing

Reads a subject's standing: active, past due or suspended, whether a payment method is on file, headroom and the threshold.

POST https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/usage_events:checkStanding · scope billing:read · effect read · Request, response and examples