Events

Queue a usage event for creation.

post/v2/events

Headers

Idempotency-Keystring

Non-empty idempotency key for deduplicating write requests on the same route.

Example:6f31c20e-725c-4be8-96f4-835042f67602

Optional. Duplicate keys within the same company namespace and route return 409.

Request body

OR

Example request

{
  "metric_id": "metric_0194f4e3a2b77c6aa91c4f6b4db2a980",
  "currency": "usd",
  "quantity": "1250.5",
  "account_id": "account_0194f4e3a2b77c6aa91c4f6b4db2a980",
  "occurred_at": 1767225600
}

Response

Accepted and queued.

idstring required

LedgerUp event identifier.

metric_idstring required

LedgerUp metric identifier, or the lowercase three-letter currency code for currency usage events.

currencystring nullable required

Three-letter lowercase currency code. Quantity is expressed in major currency units, not minor units. Null for metric usage events.

quantitystring required

Decimal quantity serialized as a string.

account_idstring required

LedgerUp account identifier.

occurred_atinteger required

Unix timestamp in seconds.

{"stackTrail":"components:schemas:Properties","oasType":"schema","type":"unknown","description":"Arbitrary JSON object or value. If omitted on write endpoints, the service stores an empty object."}
accepted_atinteger required

Unix timestamp in seconds.

created_atinteger required

Unix timestamp in seconds.

Example response

{
  "id": "event_0194f4e3a2b77c6aa91c4f6b4db2a980",
  "metric_id": "metric_0194f4e3a2b77c6aa91c4f6b4db2a980",
  "currency": "usd",
  "quantity": "1250.5",
  "account_id": "account_0194f4e3a2b77c6aa91c4f6b4db2a980",
  "occurred_at": 1767225600,
  "accepted_at": 1767225600,
  "created_at": 1767225600
}

Changes