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
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" }
}
}codeis the precise, stable value.typeis a coarse family from the HTTP status (authentication_error,authorization_error,rate_limit_error,api_error,invalid_request).detailsis machine-readable:fieldsfor validation errors,reasonfor the cases below,retryAfterSecondson a 429.requestIdidentifies the request in our logs and in your dashboard's request log. Quote it when you ask for help.
Error codes
| code | HTTP | Meaning | What to do |
|---|---|---|---|
| authentication_required | 401 | No 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_scope | 403 | The 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_failed | 422 | The 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_found | 404 | The 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_state | 409 | The 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_reuse | 409 | The 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_failed | 422 | A 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_exceeded | 429 | Your rate-limit bucket is empty. | Wait Retry-After seconds, then retry. |
| service_unavailable | 503 | A platform service is briefly unavailable. | Retry with backoff, with the same Idempotency-Key. |
| not_implemented | 501 | The 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:
| reason | Meaning | What to do |
|---|---|---|
| funding_window_closed | The 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_mismatch | You locked the buyer with buyerWallet and another wallet tried to pay. | Pay from the locked wallet, or recreate the escrow without it. |
| funding_submitted | The buyer cannot change: a funding transaction has already been sent. | The wallet that paid is the buyer. Wait for escrow.funded. |
| buyer_unbound | A funding hash was registered for an escrow with no buyer yet. | Request a funding-intent naming the wallet first. |
| signature_mismatch | A 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 / _expired | The seller verification link was already used, or is past its expiry. | Request a new link. |
What is safe to retry
- Retry network errors, timeouts,
429and503— with the sameIdempotency-Key, so a request that did succeed is replayed instead of repeated. - Do not retry unchanged any
4xxother than429: 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:
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
| Symptom | Cause | Fix |
|---|---|---|
| The buyer paid but the order stays open | The 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 events | The 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 arriving | Repeated failures disabled the endpoint. | Fix the handler, then re-enable the endpoint in the dashboard. |
| Registering a webhook fails with 422 about the address | The 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 appear | The 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 cancelled | The 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_REQUIRED | A 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 approval | The buyer switched wallets mid-payment. Only one funding can succeed. | Nothing to repair; the approval is harmless and the wallet can reset it. |