Queue a usage event for creation.
Authorizations
LedgerUp API Key.
Headers
Optional. Duplicate keys within the same company namespace and route return 409. Non-empty idempotency key for deduplicating write requests on the same route.
"6f31c20e-725c-4be8-96f4-835042f67602"
Body
- Option 1
- Option 2
Create-event request. Exactly one of metric_id or currency is required. Unknown JSON fields are rejected.
LedgerUp metric identifier. Required when currency is null.
^metric_[0-9a-f]{32}$"metric_0194f4e3a2b77c6aa91c4f6b4db2a980"
Decimal quantity as a string.
^-?\d+(\.\d+)?$"1250.5"
LedgerUp account identifier.
^account_[0-9a-f]{32}$"account_0194f4e3a2b77c6aa91c4f6b4db2a980"
Must be within five years before or after the current time.
1767225600
Three-letter ISO 4217-style currency code. Quantity is expressed in major currency units, not minor units. Required when metric_id is omitted. Stored lowercase and also used as metric_id.
^[A-Za-z]{3}$"usd"
Arbitrary JSON object or value. If omitted on write endpoints, the service stores an empty object.
Response
Accepted and queued.
LedgerUp event identifier.
^event_[0-9a-f]{32}$"event_0194f4e3a2b77c6aa91c4f6b4db2a980"
LedgerUp metric identifier, or the lowercase three-letter currency code for currency usage events.
^(metric_[0-9a-f]{32}|[a-z]{3})$"metric_0194f4e3a2b77c6aa91c4f6b4db2a980"
Three-letter lowercase currency code. Quantity is expressed in major currency units, not minor units. Null for metric usage events.
^[a-z]{3}$"usd"
Decimal quantity serialized as a string.
^-?\d+(\.\d+)?$"1250.5"
LedgerUp account identifier.
^account_[0-9a-f]{32}$"account_0194f4e3a2b77c6aa91c4f6b4db2a980"
Unix timestamp in seconds.
1767225600
Arbitrary JSON object or value. If omitted on write endpoints, the service stores an empty object.
Unix timestamp in seconds.
1767225600
ClickHouse insertion timestamp. Null in the initial 202 response while the event is queued.
1767225600