Skip to main content
POST
Sweep funds into a reserve account

Authorizations

Authorization
string
header
required

Same flow; ledger:write is required for any mutation.

Headers

Idempotency-Key
string

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.

Required string length: 1 - 255
Pattern: ^[A-Za-z0-9_:.\-]+$
Example:

"pi_acme_1234_capture"

Body

application/json
source_account_id
string
required

Account whose balance is debited to fund the reserve.

Example:

"payable:acme"

template
string
required

Name of a registered account_template whose accounting_type matches the reserve's intended sign (typically liability with balance_non_negative: true).

Example:

"merchant_payable"

counterparty_ref
string
required

Opaque customer-defined identifier of the counterparty the reserve is held for.

Example:

"acme"

currency
string
required

Currency of the sweep. Must equal the source account's currency.

Example:

"USDC"

amount
required

Amount in minor units to sweep into the reserve. Accepts a decimal string (recommended) or an integer on write.

Pattern: ^\d+$
Example:

"500000"

expires_at
string<date-time> | null

Informational only. Persisted in transaction metadata so a customer-side scheduler can find expired reserves and POST /release; the platform does NOT auto-release.

idempotency_key
string

Optional body alternative to the Idempotency-Key header. Header wins.

metadata
object

Response

Reserve sweep booked

object
enum<string>
required

Discriminator naming the shape of this resource (e.g. account, transaction).

Available options:
reserve_op_result
Example:

"account"

reserve_account_id
string
required
Example:

"reserve:merchant_payable:acme:usdc"

transaction_id
string<uuid>
required
balance
string
required

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.

Pattern: ^-?\d+$
Example:

"500000"

remaining_balance
string

Alias of balance; preserved for symmetry with the decision-doc contract. Decimal string of minor units.

Pattern: ^-?\d+$
Example:

"500000"