Sweep funds into a reserve account
Creates a reserve account (if it doesn’t yet exist) for the
(template, counterparty_ref, currency) triple and books a
balanced transaction that debits the source account and credits
the reserve. Reserves model holdbacks, escrow, FX holds, and any
other case where unrestricted funds need to be earmarked for a
named counterparty.
Listing and balance reads use the standard /v1/accounts
surface (?kind=reserve&counterparty_ref=<x>). The platform
does NOT auto-release on expires_at; that’s customer policy.
Authorizations
Same flow; ledger:write is required for any mutation.
Headers
Required on writes. Stable identifier you choose. The same key
always returns the same transaction, forever. Can also be supplied as
idempotency_key in the request body. Header wins.
Allowed character set: A-Z, a-z, 0-9, _, :, ., -.
Max 255 bytes. Replays of an accepted key return the original
response with header Idempotent-Replayed: true so callers can
tell a replay from a freshly-committed result.
1 - 255^[A-Za-z0-9_:.\-]+$"pi_acme_1234_capture"
Body
Account whose balance is debited to fund the reserve.
"payable:acme"
Name of a registered account_template whose
accounting_type matches the reserve's intended sign
(typically liability with balance_non_negative: true).
"merchant_payable"
Opaque customer-defined identifier of the counterparty the reserve is held for.
"acme"
Currency of the sweep. Must equal the source account's currency.
"USDC"
Amount in minor units to sweep into the reserve. Accepts a decimal string (recommended) or an integer on write.
^\d+$"500000"
Informational only. Persisted in transaction metadata so a
customer-side scheduler can find expired reserves and POST
/release; the platform does NOT auto-release.
Optional body alternative to the Idempotency-Key header. Header wins.
Response
Reserve sweep booked
Discriminator naming the shape of this resource (e.g. account, transaction).
reserve_op_result "account"
"reserve:merchant_payable:acme:usdc"
Reserve posted balance after this op, in minor units, as a decimal string. Parse with a big-integer or decimal type, never a JS number.
^-?\d+$"500000"
Alias of balance; preserved for symmetry with the decision-doc contract. Decimal string of minor units.
^-?\d+$"500000"