Core Concepts & API Contract
Errors & Exception Playbooks
Predictable JSON error envelopes with support-ready correlation IDs (traceId), field-level diagnostics, and deterministic recovery rules for blockchain and settlement edge cases.
Response envelopes & correlation headers
Versioned REST routes return a structured envelope echoing X-Request-Id and X-Trace-Id on HTTP headers alongside both requestId and traceId in the body:
jsonStandard API Error Envelope
{
"error": {
"type": "conflict_error",
"code": "ERR_IDEMPOTENCY_CONFLICT",
"message": "Idempotency-Key was already used with a different request payload.",
"param": "Idempotency-Key",
"details": [{ "field": "quoteId", "reason": "mismatched_payload_fingerprint" }],
"docUrl": "https://furlpay.com/docs/architecture/errors#ERR_IDEMPOTENCY_CONFLICT"
},
"requestId": "req_01936c7a-...",
"traceId": "req_01936c7a-..."
}HTTP status conventions
400— validation failed (Zod / malformed decimal string / unsupported version).401— missing/invalid API key or session;402— payment required or challenge quote issued.403— forbidden (insufficient scope, policy mandate limit exceeded, wrong environment).409— state conflict (consumed quote, entity pending KYB, maker-checker hold);422— idempotency key payload mismatch.423— account locked or cooling period;429— rate limited (honorRetry-After).451— compliance/sanctions jurisdiction restriction.502— upstream RPC/provider failure;503— rail paused or unconfigured (live outage details appear on/status).
Standard error codes
| Parameter | Type | Description |
|---|---|---|
| ERR_IDEMPOTENCY_CONFLICTrequired | 422 | Idempotency-Key reused with a different request payload. Generate a fresh UUID for distinct mutations. |
| ERR_POLICY_LIMIT_EXCEEDEDrequired | 403 | Requested amount exceeds delegated mandate cap or daily velocity ceiling. |
| ERR_QUOTE_EXPIREDrequired | 409 / 402 | Quote TTL elapsed before order creation. Request a fresh quote. |
| ERR_ENTITY_NOT_APPROVEDrequired | 409 | Counterparty entity has not completed KYB/sanctions clearance. |
| ERR_COMPLIANCE_RESTRICTED_COUNTRYrequired | 451 | Sanctions screening blocked the onboarding or payout jurisdiction. |
| amount_over_limitrequired | 403 | Amount exceeds the server-side per-transaction rail cap. |
| replay_rejectedrequired | 409 / 402 | EIP-3009 nonce or quote already consumed. Never re-sign a spent nonce. |
| invalid_signaturerequired | 400 / 402 | ECDSA / ERC-1271 / Ed25519 signature recovery failed verification. |
| rail_pausedrequired | 503 | Rail administratively paused; verify recovery on /status or /api/rails. |
| controls_unavailablerequired | 503 | Fail-closed guard refused value movement while operational controls were unreachable. |
| settlement_disarmedrequired | 503 | Production settlement prerequisites (signer, vault, RPC) are disarmed. |
| self_approval_forbiddenrequired | 403 | Maker-checker controls prohibit creators from approving their own settlement. |
| reconciliation_requiredrequired | 409 | Broadcast outcome requires on-chain verification before retry or recovery. |
Payment Exceptions & Reconciliation Playbook
| Parameter | Type | Description |
|---|---|---|
| Underpaymentrequired | On-chain < Quoted | Order pauses in AWAITING_DEPOSIT / UNDERPAID rather than confirming settlement. Integrator can either accept partial tolerance per merchant config or trigger refund orchestration back to sender. |
| Overpaymentrequired | On-chain > Quoted | Expected settlement amount posts at the locked order face value; excess funds are held in unallocated suspense for operator sweep or automated excess-return ticket. |
| Expired Quote Paid Laterequired | Past expiresAt | Late blockchain transfers arriving after quote expiry fail automatic conversion and route to operator repricing or return-to-origin queue (never silently settled at stale FX rates). |
| Chain Reorganizationrequired | Pre-finality reorg | Orders confirm strictly after corridor confirmation thresholds. Any shallow reorg moves transaction state to RECONCILIATION_REQUIRED rather than finalizing prematurely. |
Safe Retry Rule
Retry
429 after Retry-After and 502 with exponential backoff. Never blind-retry 422 ERR_IDEMPOTENCY_CONFLICT, 402 replays, or 202 pending transactions—inspect the settlement status by ID first.Did this page help?
Edit this page on GitHub