UniversalEscrow
DocumentationAPI reference

Errors and limits

Every error has the same shape and a stable code to branch on. Never branch on the message: it is written for people and may change.

The error format

Every error response
HTTP/1.1 409 Conflict

{
  "error": {
    "type": "invalid_request",
    "code": "escrow_invalid_state",
    "message": "The escrow cannot be released from its current state.",
    "requestId": "req_01…",
    "details": { "currentState": "CREATED", "requiredState": "FUNDED" }
  }
}
  • code is the precise, stable value. type is a coarse family from the HTTP status (authentication_error, authorization_error, rate_limit_error, api_error, invalid_request).
  • details is machine-readable: fields for validation errors, reason for the cases below, retryAfterSeconds on a 429.
  • requestId identifies the request in our logs and in your dashboard's request log. Quote it when you ask for help.

Error codes

codeHTTPMeaningWhat to do
authentication_required401No API key, a malformed or revoked one, or a dashboard session where a key is required.Check the Authorization: Bearer header and the key.
insufficient_scope403The key lacks the scope for this call; details.requiredScope names it.Create a key with that scope. Scopes cannot be added to a key.
validation_failed422The body or query is invalid; details.fields names each field (for groups, members.1.amount).Fix the request. Retrying it unchanged never succeeds.
resource_not_found404The id does not exist, or belongs to another organization or environment. The two are deliberately indistinguishable.Check the id and that the key is the right environment.
escrow_invalid_state409The action is not valid in the escrow's current status; details says which. Also a reused externalReference.Read the escrow first; act only once its state allows it.
idempotency_key_reuse409The same Idempotency-Key was sent with a different body.Resend the exact original body, or use a new key for a new request.
transaction_verification_failed422A registered transaction hash does not match what was expected (chain, contract, sender, amount, confirmations…).Check you registered the right hash from the right wallet.
rate_limit_exceeded429Your rate-limit bucket is empty.Wait Retry-After seconds, then retry.
service_unavailable503A platform service is briefly unavailable.Retry with backoff, with the same Idempotency-Key.
not_implemented501The route exists but the capability behind it is not available on this deployment.Do not retry.

details.reason values

Some refusals share a code and are told apart by details.reason:

reasonMeaningWhat to do
funding_window_closedThe fundingDeadline has passed; the escrow can no longer be funded, even if it does not show EXPIRED yet.Create a new escrow with a new deadline.
buyer_wallet_mismatchYou locked the buyer with buyerWallet and another wallet tried to pay.Pay from the locked wallet, or recreate the escrow without it.
funding_submittedThe buyer cannot change: a funding transaction has already been sent.The wallet that paid is the buyer. Wait for escrow.funded.
buyer_unboundA funding hash was registered for an escrow with no buyer yet.Request a funding-intent naming the wallet first.
signature_mismatchA seller wallet verification was signed by another wallet, or by a smart-contract wallet.Sign again with the connected wallet; contract wallets cannot verify yet.
verification_link_used / _expiredThe seller verification link was already used, or is past its expiry.Request a new link.

What is safe to retry

  • Retry network errors, timeouts, 429 and 503 — with the same Idempotency-Key, so a request that did succeed is replayed instead of repeated.
  • Do not retry unchanged any 4xx other than 429: the request itself has to change, or the escrow's state has to.
  • Idempotency keys are optional on every create and prepare call, 8–255 characters when sent. Use one derived from your own ids (order_4471_110000000) rather than a random value, so a retry after a crash sends the same key.

Rate limits

Each API key has its own token bucket, so another merchant's traffic can never use up yours. Most calls cost 1 token. A few heavy ones cost 10: creating an escrow, creating a milestone group (one charge for up to 20 members), every *-intent and *-transactions call, opening a dispute and sending a webhook test event. Every response tells you where you stand:

Response headers
X-RateLimit-Limit:      <your bucket capacity>
X-RateLimit-Remaining:  <tokens left after this request>
X-RateLimit-Reset:      <unix seconds when your bucket is next full>

HTTP 429  (when empty)
Retry-After: <seconds until your next token>

On a 429, wait Retry-After seconds and retry once; back off further on repeated refusals. A refused request created nothing. Poll escrow status every 5 seconds or slower, and prefer webhooks to polling.

Troubleshooting

SymptomCauseFix
The buyer paid but the order stays openThe webhook failed, is not subscribed to escrow.funded, or your amount/reference/environment check refused it.Check the webhook events page and your logs; your status poll should also settle it.
Your webhook answers 400 to genuine eventsThe body was parsed and re-serialised before verifying, the secret is wrong, or your clock is more than 5 minutes off.Verify over the raw bytes; re-check the secret; sync the clock. See Webhooks.
Events stopped arrivingRepeated failures disabled the endpoint.Fix the handler, then re-enable the endpoint in the dashboard.
Registering a webhook fails with 422 about the addressThe URL points at a private or loopback address. We refuse those for security.Use a public HTTPS URL; for local development, a tunnel.
Checkout says “Different wallet”The escrow was created with buyerWallet and another account is connected.Connect the locked wallet, or recreate the escrow without buyerWallet.
The Pay with crypto button does not appearThe data-escrow-checkout value is not an escrow id (often null from a failed create).Check the browser console and your create call. See the button guide.
The button page never gets funded or cancelledThe page is not on the origin of the escrow's successUrl, or it sends Cross-Origin-Opener-Policy: same-origin.Put successUrl on the same origin; relax the header.
An escrow is RECONCILIATION_REQUIREDA payment landed close to the deadline and was seen after the escrow expired.Our staff reconcile it. Do not mark the order paid; use a longer deadline.
A wallet shows a leftover USDC approvalThe buyer switched wallets mid-payment. Only one funding can succeed.Nothing to repair; the approval is harmless and the wallet can reset it.

Next