Skip to Content
Errors and retries

Errors and retries

Versioned error bodies have this shape:

{ "apiVersion": "1", "error": "external_prepare_failed", "code": "intent_session_expired", "message": "Safe human-readable text", "path": "optional.field.path" }

error is the stable failure family. code is the stable detail where one is defined; clients must tolerate new detail codes. Several authentication and transport failures return only apiVersion and error, so treat code, message and path as optional. message, when present, is safe to render; do not parse it.

Retry rules

ConditionRequired behavior
Timeout or unexpected 5xx on a mutating endpointRetry the identical bytes with the same idempotency key
429 external_rate_limitedHonor the RateLimit-* headers and retry later
Expired quote or non-executable committed planCreate a new quote with a new idempotency key
User rejection in the walletStop; do not retry silently
New or additive execution evidenceSend the new body with a new idempotency key
Same evidence is being retriedReuse the original body and idempotency key

Never reuse an idempotency key for a different body or resource. Treat an unknown error or code as non-success and preserve it for diagnostics.

Authentication and transport

HTTPerrorAction
400external_idempotency_key_requiredSupply a valid key on the mutating request
401external_auth_headers_requiredFix missing partner authentication headers
401external_auth_timestamp_invalidSend a decimal Unix timestamp in milliseconds
401external_auth_timestamp_expiredCorrect clock skew and sign a fresh request
401external_auth_signature_invalidVerify canonical bytes, secret and protected headers
401external_auth_version_mismatchUse the authentication version configured for the partner
401external_auth_nonce_invalid / external_auth_request_invalidRebuild the canonical v2 request correctly
403external_partner_not_allowedContact Sweep; the partner id is unknown or disabled
409external_auth_nonce_conflictUse a new nonce for the new canonical request
429external_rate_limitedBack off according to rate-limit headers
503external_auth_replay_unavailableRetry later; replay protection failed closed

Unexpected endpoint failures use external_quote_failed, external_prepare_failed, external_submit_failed or external_status_failed. Retry an identical mutating request with the same idempotency key.

Quote

Request validation returns 400 invalid_intent_request. Common codes: invalid_sources, invalid_source, duplicate_source, invalid_chain_id, invalid_address, invalid_wallet_address, invalid_recipient_address, invalid_source_amount, invalid_decimals, invalid_usd_value, invalid_target, invalid_allowed_provider, invalid_callback_url, invalid_slippage_bps, invalid_allow_partial, invalid_max_wait_ms, invalid_idempotency_key.

Invalid allocation returns 400 invalid_intent_allocation with no_targets or no_sources.

Route failures are not HTTP errors. A quote may return HTTP 200 with failedSources[].reasonCode equal to no_allowed_provider, provider_unavailable, route_unavailable, same_chain_unsupported, provider_timeout or app_fee_exceeds_provider_cap. This set may grow; the quote’s quoteStatus and coverageMode remain authoritative.

Prepare

HTTPcode under external_prepare_failedAction
400callback_url_not_allowedUse the exact callback URL configured for the partner
404intent_session_not_foundCheck partner/session identity; otherwise start a new quote
409intent_session_expiredStart a new quote
409intent_session_not_preparableDo not prepare a non-ready quote
409idempotency_key_conflictDo not rebind a prepare key to another session
409quote_not_executableStart a new quote
409prepared_payload_mismatchStart a new quote; the executable plan did not match the commitment
502allowance_unavailableRetry the identical request; re-quote if the quote expires

Submitted evidence

HTTPcode under external_submit_failedAction
400invalid_submissionFix the evidence shape, bounds or hash format
400invalid_wallet_authorizationRe-prepare if needed and collect a valid signature from the executing wallet
400contract_wallet_unsupportedUse an EOA/EIP-7702 wallet; ERC-1271 is outside v1
404execution_attempt_not_foundCheck partner/attempt identity
409execution_attempt_expiredStop reporting; the evidence deadline passed without accepted evidence
409submit_in_progressRetry the identical request with the same key
409idempotency_key_conflictDo not reuse a key across attempts
409source_tx_hash_conflictStop and reconcile ownership of the transaction evidence
409bundle_id_conflictStop and reconcile the wallet bundle for that chain
500attempt_snapshot_invalidPreserve evidence and escalate to Sweep

Status

404 external_status_failed with execution_attempt_not_found when the attempt does not exist for the partner.

Last updated on