Valta Docs

Escrow API

See Escrow for the state machine (pending → funded → released | disputed) and the release-vs-dispute exclusivity guarantee this API implements.

All four calls require authentication — an API key (x-api-key: vlt_live_...) or a logged-in dashboard session — and all accept the same Idempotency-Key header described in Payout Intents.

POST /escrow/create

Opens a pending escrow. No funds move.

FieldRequiredDescription
fromWalletIdyesThe bot_wallet id funds will be debited from. You must own this wallet.
toWalletIdyesThe bot_wallet id funds will be credited to on release.
amountyesAmount, in the wallet's currency.
conditionsnoFree-form JSON describing release conditions (not enforced by Valta — informational).
bash
curl https://valta.co/api/v1/escrow/create \
  -H 'x-api-key: vlt_live_...' \
  -H 'Content-Type: application/json' \
  -d '{"fromWalletId": 42, "toWalletId": 91, "amount": 500}'
json
{
  "success": true,
  "escrow": { "id": 7, "fromWalletId": 42, "toWalletId": 91, "amount": 500, "status": "pending", "conditions": {} }
}

POST /escrow/fund

pending → funded. Debits fromWalletId. Requires the caller to own the source wallet.

bash
curl https://valta.co/api/v1/escrow/fund \
  -H 'x-api-key: vlt_live_...' \
  -H 'Content-Type: application/json' \
  -d '{"escrowId": 7}'
json
{ "success": true, "escrowId": 7, "status": "funded", "intentId": "int_..." }

POST /escrow/release

funded → released. Credits toWalletId. Either party to the escrow may call this.

bash
curl https://valta.co/api/v1/escrow/release \
  -H 'x-api-key: vlt_live_...' \
  -H 'Content-Type: application/json' \
  -d '{"escrowId": 7}'

POST /escrow/dispute

funded → disputed. No funds move. Either party may call this.

FieldRequiredDescription
escrowIdyes
reasonnoRecorded as dispute_reason on the escrow.
bash
curl https://valta.co/api/v1/escrow/dispute \
  -H 'x-api-key: vlt_live_...' \
  -H 'Content-Type: application/json' \
  -d '{"escrowId": 7, "reason": "Delivery not received"}'

Errors

StatusMeaning
401Missing or invalid auth.
403Authenticated, but either not a party to the wallet(s)/escrow involved, or your workspace role doesn't allow it — create/fund need Owner or Admin (wallet.fund_agent), release/dispute need Manager and above (wallet.move). Viewers can't call any of these.
404Escrow or wallet not found.
400Wrong state for this call (e.g. releasing a pending, not-yet-funded escrow), or insufficient balance to fund.
409The escrow was already resolved — either a genuine dedup replay ("replayed": true in the body), or it lost a real release-vs-dispute race (see Escrow).

SDK equivalent

Not yet built. Use the curl calls above directly until packages/valta-sdk adds an escrow resource.