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
| Field | Type | What it is |
|---|---|---|
name | string | orgs/{org}/projects/{project}/envs/{env}/usage_events/{usage_event}. |
uid | string | uevt_<cell><ulid>; never reused. Output only. |
meta | ResourceMeta | Resource metadata. |
subject | Subject | Who used it. Required. |
subject_proof | string | As on UsageReservation. Required. |
actor_proof | string | As on UsageReservation. |
meter | string | The meter's lookup key. Required. |
quantity | int64 | How much, in the meter's base unit. Required. |
occurred_time | timestamp | When the work happened. Required. |
amount_nano | string | The rated amount, nano-minor, a decimal string. Output only. |
usage_reservation | string | The reservation it settled, when it did. Output only. |
late | bool | Settled 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.
| Method | Call | What it does |
|---|---|---|
POST | create | Records usage directly, only for a meter the merchant marked reservation-optional. |
POST | 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. |
GET | list | Lists usage events, newest first. |
POST | check_standing | Reads 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