Create a grant.
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-grant request. Exactly one of metric_id or currency is required. Unknown JSON fields are rejected. When provided, expires_at must be after effective_at.
LedgerUp account identifier.
^account_[0-9a-f]{32}$"account_0194f4e3a2b77c6aa91c4f6b4db2a980"
LedgerUp metric identifier. Required when currency is omitted.
^metric_[0-9a-f]{32}$"metric_0194f4e3a2b77c6aa91c4f6b4db2a980"
Decimal amount as a string.
^-?\d+(\.\d+)?$"100.0"
Unix timestamp in seconds.
1767225600
Optional description. Maximum 2048 Unicode scalar values.
2048"Usage tracked for Acme."
Three-letter ISO 4217-style currency code. Amount is expressed in major currency units, not minor units. Required when metric_id is omitted. Stored lowercase; metric_id remains null.
^[A-Za-z]{3}$"usd"
Unix timestamp in seconds.
1767225600
Optional public.contracts identifier.
Response
Created.
LedgerUp grant identifier.
^grant_[0-9a-f]{32}$"grant_0194f4e3a2b77c6aa91c4f6b4db2a980"
Optional description. Maximum 2048 Unicode scalar values.
2048"Usage tracked for Acme."
LedgerUp account identifier.
^account_[0-9a-f]{32}$"account_0194f4e3a2b77c6aa91c4f6b4db2a980"
LedgerUp metric identifier. Null for currency grants.
^metric_[0-9a-f]{32}$"metric_0194f4e3a2b77c6aa91c4f6b4db2a980"
Three-letter lowercase currency code. Amount is expressed in major currency units, not minor units. Null for metric grants.
^[a-z]{3}$"usd"
Decimal amount serialized as a string.
^-?\d+(\.\d+)?$"100.0"
Unix timestamp in seconds.
1767225600
Unix timestamp in seconds.
1767225600
Unix timestamp in seconds.
1767225600
Unix timestamp in seconds.
1767225600
Derived grant status. Voided and archived take precedence over expiration and scheduled activation.
active, scheduled, voided, archived, expired "active"
Unix timestamp in seconds.
1767225600
Optional public.contracts identifier.
Unix timestamp in seconds.
1767225600