Skip to main content
POST
Hold credit for a request

Authorizations

Authorization
string
header
required

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

Idempotency-Key
string
required

Required for POST and PATCH requests. Replays identical method + path + body requests and rejects mismatched re-use.

Required string length: 1 - 255

Path Parameters

customer
string
required

Body

application/json
usage
object[]
required
Required array length: 1 - 20 elements
currency
string
Example:

"NGN"

expiresIn
integer
default:3600

Seconds until the hold expires if not committed or released.

Required range: 60 <= x <= 604800
reference
string | null

Your own id for the request, for your records.

Maximum string length: 255
Example:

"req_8f2a"

customData
object | null

Response

Credit hold response.

data
object
required

Usage reserved against a customer's prepaid credit before a request, then committed or released.

meta
object
required