Skip to main content
POST
Record a usage event

Authorizations

Authorization
string
header
required

Your account's secret key: Authorization: Bearer sk_test_… or sk_live_…. Server-side only.

Headers

Idempotency-Key
string

A unique key per operation (a UUID works). Retrying with the same key returns the original response.

Body

application/json
meter
string
required

Meter key (for example tokens).

productId
string<uuid>

The meter's product.

customerId
string

The enrollment ID or the customer's externalId. The enrollment must belong to the given product.

value
string | null

Quantity, as a decimal string. Defaults to 1.

eventId
string

Your id for this event. Together with the same timestamp, a resend with the same eventId is not counted again.

timestamp
string<date-time> | null

When the usage happened. Without it, the arrival time is used, and a resend becomes a new event.

metadata
object

Your own free-form JSON data.

Response

Event accepted. duplicate: true means it was already recorded and was not counted again.

Result of recording usage. accepted means the event was recorded now; duplicate, that it had already been recorded.