Commit what a request used
Early access. Not yet turned on for every account: until it is, this answers 404 not_found. Build against it now and ask us to turn it on.
Records what the request actually used and closes the hold in one
step: one meter event per meter (identifier {hold id}:{eventName},
dated now), billed by the period’s invoice like any other usage. The
hold stops counting the moment its usage starts to, so the credit is
never counted twice. A meter you leave out committed nothing.
Less than was held releases the rest. More is accepted: the extra is
ordinary usage, and what the credit can’t cover is collected by the
invoice. A committed hold is returned as it is when you retry, so no
Idempotency-Key is needed. A hold past its expiry is refused with
409 hold_expired (send the usage as a meter event instead), and a
released one with 409 hold_settled. Needs credits:write on a
restricted key.
Authorizations
Use a Bouclay secret key (sk_test_..., sk_live_...) or restricted key
(rk_test_..., rk_live_...).
A secret key can call every endpoint. A restricted key can only call the
endpoints its scopes cover. A scope is {resource}:{access}, for example
customers:read or refunds:write, and write includes read. GET
requests need read access and everything else needs write, except
POST /subscriptions/{id}/items/{item}/preview, which only needs
subscriptions:read. A request outside the key's scopes gets 403 permission_denied naming the missing scope, and its Idempotency-Key
is not used up.
Publishable keys (pk_...) are rejected by server-side API endpoints. A
key's mode scopes what it can see and charge: a test key can never reach
a live card.
Path Parameters
Body
20