Create escrow
Creates an escrow in status CREATED.
https://testnet.universal-escrow.xyz/v1/escrows
No prerequisites. description (optional, 1-500 characters) is shown to the buyer on the hosted checkout. successUrl and cancelUrl (optional) are where the buyer may return afterwards: absolute URLs without a username or password, https for a live key (http is also accepted for a test key), otherwise 422 validation_failed naming the field; the hosted pages offer them only as links the buyer clicks, carrying escrow_id and nothing else, and arriving at one is not proof of payment — wait for the escrow.funded webhook. The response carries links (checkout, release, sellerRefund, buyerRefund) when the deployment has a hosted checkout. buyerWallet is optional: omit it for a "pay from any wallet" escrow, whose buyer is bound when the payer requests funding calldata; supply it to lock the buyer at creation. fundingDeadline (optional, must not be later than expiresAt, defaults to expiresAt) is the payment window: funding cannot be started after it (409 funding_window_closed). expiresAt is the refund lock: the moment the buyer may refund themselves. settlementMode (optional, default ESCROW) chooses how the order settles: ESCROW holds the payment until the buyer releases it; INSTANT (ADR-040) pays the seller and the fee in the buyer's payment transaction and ends in PAID with no release, dispute or buyer refund — for goods delivered at payment. INSTANT with expiresAt is 422 validation_failed (details.reason expires_at_not_allowed_for_instant), and on a deployment still running escrow contract v1 it is 422 with instant_settlement_unavailable. The mode cannot be changed later. The platform fee is computed and snapshotted at creation (100bps, truncated) — any platformFee in the body is ignored. Supports Idempotency-Key (optional; 8-255 characters when sent, otherwise 422 validation_failed): the same key with the same body replays the original response; the same key with a different body is a conflict.
Authorizations
AuthorizationstringheaderrequiredBearer authentication with your secret API key: Bearer esc_test_<prefix>_<secret>. The key needs the escrows:write scope.
Headers
Idempotency-KeystringOptional, 8–255 characters. The same key with the same body replays the original response instead of acting twice; with a different body it is a conflict.
Body
application/jsonamountstringrequiredAmount in atomic units as a decimal string (never a float/number). USDC has 6 decimals, so 1 USDC is "1000000".
currencystringrequiredToken symbol. MVP accepts USDC only.
buyerWalletstringOptional. Omit to let the buyer pay from any wallet; the wallet that funds becomes the buyer.
sellerWalletstringSeller wallet address — receives the escrowed funds when the escrow is released. Give this or sellerWalletId, not both.
sellerWalletIdstringId of a verified seller wallet (swal_…, from POST /v1/seller-wallet-verifications). The seller is the address the seller proved they control. Give this or sellerWallet, not both.
externalReferencestringMerchant-side reference (e.g. an order id), unique per organization.
descriptionstringWhat the buyer is paying for. Plain text, shown on the hosted checkout. Must not be blank.
successUrlstringWhere the buyer may return after paying. Absolute URL, no username or password; https for a live key, http or https for a test key. Offered on the hosted success page as a link carrying only escrow_id. Arriving at it is not proof of payment. Visible to anyone holding the checkout link.
cancelUrlstringWhere the buyer may return without paying. Same rules as successUrl. Visible to anyone holding the checkout link.
expiresAtstringWhen the buyer may refund a funded escrow themselves (ADR-014), RFC 3339 UTC. Also bounds funding.
fundingDeadlinestringWhen an unfunded escrow expires. Defaults to expiresAt. Must be ≤ expiresAt.
settlementModeSettlementModeOne of ESCROW, INSTANT.
metadataobjectArbitrary merchant metadata as string keys and values. Echoed back on every read of the escrow.
Response
201 · Escrow · application/jsonThe created escrow, in status CREATED.
idstringrequiredPublic id.
organizationIdstringrequiredstatusEscrowStatusrequiredsettlementModeSettlementModerequiredOne of ESCROW, INSTANT.
refundedAmountstring | nullrequiredINSTANT orders: the total the seller has refunded to the buyer, from confirmed refunds only, as an atomic-unit string. Null for ESCROW orders.
refundStatestring | nullrequiredINSTANT orders: whether the seller has refunded none, part or all of the payment. Null for ESCROW orders. One of NONE, PARTIAL, FULL.
environmentstringrequiredInherited from the creating API key. One of test, live.
chainIdnumberrequiredonChainIdstring | nullrequiredDeterministic on-chain id, knowable before the escrow exists on chain; every escrow.* event correlates on it.
contractAddressstring | nullrequiredtokenTokenrequiredamountAtomicstringrequiredAtomic-unit decimal string; 1 USDC is "1000000".
platformFeeAtomicstringrequiredAtomic-unit decimal string, snapshotted at creation.
partiesEscrowParty[]requiredexternalReferencestring | nullrequiredYour own reference, exactly as sent.
sellerWalletIdstring | nullrequiredThe verified seller wallet (swal_…) the seller address was taken from; null when created with a raw sellerWallet.
groupIdstring | nullrequiredThe milestone group this escrow belongs to, or null when it was created alone.
groupPositioninteger | nullrequiredThe escrow's 1-based position within its milestone group, or null when it was created alone.
descriptionstring | nullrequiredWhat is being paid for, shown to the buyer.
successUrlstring | nullrequiredWhere the buyer may return after paying.
cancelUrlstring | nullrequiredWhere the buyer may return without paying.
metadataobjectrequiredYour own key/value pairs, exactly as sent.
expiresAtstring | nullrequiredWhen the buyer may refund a funded escrow themselves. RFC 3339.
fundingDeadlinestring | nullrequiredWhen an unfunded escrow expires. Defaults to expiresAt. RFC 3339.
fundingEvidenceFundingEvidence | nullrequiredcreatedAtstringrequiredRFC 3339 UTC timestamp.
updatedAtstringrequiredRFC 3339 UTC timestamp.
checkoutUrlstringHosted checkout page for the buyer. Absent when the deployment has no checkout base URL.
linksEscrowLinks