Hold credit for a request
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.
Reserves the usage a request is expected to use against the
customer’s prepaid credit, before you do the work. Use it to stop a
customer exactly when their credit runs out: if the credit can’t
cover the hold, it is refused with 402 insufficient_credit, saying
what is available and what the hold needed, and nothing is
reserved. A hold that would go past a spending cap that stops
billing (behavior: cap) is refused with 409 spending_cap_reached:
that usage would never be billed.
The hold is priced as usage, on top of the usage you have already
sent this period and every other open hold, the way the period’s
invoice will price it: tiers, the subscription’s discount, VAT, and
which credit pays first. amount is what it takes from the credit.
Two holds placed at the same moment never share the same credit.
Holds work on meters that sum their values (meter_not_summed
otherwise), billed by one of the customer’s active subscriptions
(meter_not_billed). When the meters are billed in two currencies,
pass currency. When the work ends, commit what it used or release
the hold. A hold that is neither expires after expiresIn seconds
and its credit is free again. 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.
Headers
Required for POST and PATCH requests. Replays identical method + path + body requests and rejects mismatched re-use.
1 - 255Path Parameters
Body
1 - 20 elements"NGN"
Seconds until the hold expires if not committed or released.
60 <= x <= 604800Your own id for the request, for your records.
255"req_8f2a"