UniversalEscrow
DocumentationAPI reference
Escrows

Create escrow

Creates an escrow in status CREATED.

POST

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

Authorizationstringheaderrequired

Bearer authentication with your secret API key: Bearer esc_test_<prefix>_<secret>. The key needs the escrows:write scope.

How authentication works

Headers

Idempotency-Keystring

Optional, 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/json
amountstringrequired

Amount in atomic units as a decimal string (never a float/number). USDC has 6 decimals, so 1 USDC is "1000000".

currencystringrequired

Token symbol. MVP accepts USDC only.

buyerWalletstring

Optional. Omit to let the buyer pay from any wallet; the wallet that funds becomes the buyer.

sellerWalletstring

Seller wallet address — receives the escrowed funds when the escrow is released. Give this or sellerWalletId, not both.

sellerWalletIdstring

Id 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.

externalReferencestring

Merchant-side reference (e.g. an order id), unique per organization.

descriptionstring

What the buyer is paying for. Plain text, shown on the hosted checkout. Must not be blank.

successUrlstring

Where 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.

cancelUrlstring

Where the buyer may return without paying. Same rules as successUrl. Visible to anyone holding the checkout link.

expiresAtstring

When the buyer may refund a funded escrow themselves (ADR-014), RFC 3339 UTC. Also bounds funding.

fundingDeadlinestring

When an unfunded escrow expires. Defaults to expiresAt. Must be ≤ expiresAt.

settlementModeSettlementMode

One of ESCROW, INSTANT.

metadataobject

Arbitrary merchant metadata as string keys and values. Echoed back on every read of the escrow.

Response

201 · Escrow · application/json

The created escrow, in status CREATED.

idstringrequired

Public id.

organizationIdstringrequired
statusEscrowStatusrequired
settlementModeSettlementModerequired

One of ESCROW, INSTANT.

refundedAmountstring | nullrequired

INSTANT orders: the total the seller has refunded to the buyer, from confirmed refunds only, as an atomic-unit string. Null for ESCROW orders.

refundStatestring | nullrequired

INSTANT orders: whether the seller has refunded none, part or all of the payment. Null for ESCROW orders. One of NONE, PARTIAL, FULL.

environmentstringrequired

Inherited from the creating API key. One of test, live.

chainIdnumberrequired
onChainIdstring | nullrequired

Deterministic on-chain id, knowable before the escrow exists on chain; every escrow.* event correlates on it.

contractAddressstring | nullrequired
tokenTokenrequired
amountAtomicstringrequired

Atomic-unit decimal string; 1 USDC is "1000000".

platformFeeAtomicstringrequired

Atomic-unit decimal string, snapshotted at creation.

partiesEscrowParty[]required
externalReferencestring | nullrequired

Your own reference, exactly as sent.

sellerWalletIdstring | nullrequired

The verified seller wallet (swal_…) the seller address was taken from; null when created with a raw sellerWallet.

groupIdstring | nullrequired

The milestone group this escrow belongs to, or null when it was created alone.

groupPositioninteger | nullrequired

The escrow's 1-based position within its milestone group, or null when it was created alone.

descriptionstring | nullrequired

What is being paid for, shown to the buyer.

successUrlstring | nullrequired

Where the buyer may return after paying.

cancelUrlstring | nullrequired

Where the buyer may return without paying.

metadataobjectrequired

Your own key/value pairs, exactly as sent.

expiresAtstring | nullrequired

When the buyer may refund a funded escrow themselves. RFC 3339.

fundingDeadlinestring | nullrequired

When an unfunded escrow expires. Defaults to expiresAt. RFC 3339.

fundingEvidenceFundingEvidence | nullrequired
createdAtstringrequired

RFC 3339 UTC timestamp.

updatedAtstringrequired

RFC 3339 UTC timestamp.

checkoutUrlstring

Hosted checkout page for the buyer. Absent when the deployment has no checkout base URL.

linksEscrowLinks