Error Codes

Canonical PAX API error catalog — 102 codes across 15 groups. All errors return the envelope {"error":{"code","message","trace_id","details?"}}. Auto-generated from packages/core/src/errors.ts on every deploy.

A subset of codes below are reserved for gated features — enterprise HMAC auth, MCP tooling, and receiver-side webhook verification — and are not returned by the standard live surface today. Endpoints that can actually return each code are listed on the per-endpoint OpenAPI page (/openapi). If you see an undocumented code in production, contact support with the trace_id.

Error response format

{
  "error": {
    "code":     "TIER_LIMIT_EXCEEDED",
    "message":  "order notional 50.00 exceeds tier max_order_usdt 10",
    "trace_id": "a98efc1d-7db7-4ee2-bba6-afe481418c11",
    "details":  { "tier": "self_serve", "cap": "10" }
  }
}

The HTTP status is bound to the code via the shared error catalog — the same code always returns the same status. Reference the trace_id when contacting support.

400 — client errors

HTTPCodeDescription
400BAD_REQUESTMalformed request body or query
400VALIDATION_FAILEDPayload did not pass schema validation
400IDEMPOTENCY_KEY_MISSINGIdempotency-Key header required on writes
400IDEMPOTENCY_KEY_MALFORMEDIdempotency-Key must match [A-Za-z0-9_-]{8,128}
409IDEMPOTENCY_BODY_MISMATCHIdempotency key reused with different body
400URN_MALFORMEDIdentifier not a canonical URN
400URN_INVALID_DOMAINIdentifier URN domain unrecognized
400URN_INVALID_SLUGIdentifier URN slug malformed
400URN_SLUG_TOO_LONGIdentifier URN slug exceeds 128 chars
400ID_MALFORMEDIdentifier not a canonical prefixed id
400ID_INVALID_KINDIdentifier prefix unrecognized

401 — authentication

HTTPCodeDescription
401AUTH_REQUIREDMissing credentials
401AUTH_INVALIDCredentials rejected
401WRONG_ENV_KEYKey's tier flag does not match the requested capability (e.g. self_serve key attempting an over-cap trade)
401TIMESTAMP_SKEWreserved · enterprise HMAC. Presented HMAC timestamp is more than 300 seconds off server clock. Standard integrations use Bearer.
401NONCE_REUSEDreserved · enterprise HMAC. Presented HMAC nonce reused within 600s TTL. Generate a fresh random nonce per request.
401SIGNATURE_INVALIDreserved · enterprise HMAC. On the current live surface any HMAC-shaped credential returns AUTH_INVALID with a directive to use Bearer.
401TOKEN_EXPIREDOAuth access token expired
401TOKEN_REVOKEDOAuth access token revoked
401TOKEN_INVALIDOAuth access token could not be verified
400PKCE_INVALIDPKCE code_verifier did not match code_challenge
400AUTH_CODE_EXPIREDOAuth authorization code has expired
400AUTH_CODE_CONSUMEDOAuth authorization code has already been used
400REDIRECT_URI_MISMATCHredirect_uri does not match the value bound at authorize time
401REFRESH_TOKEN_REUSEDRefresh token reuse detected — token family revoked

403 — authorization

HTTPCodeDescription
403SCOPE_MISSINGRequired scope not present on credential
403SCOPE_NOT_ALLOWEDRequested scope is not in the app allowed_scopes list
403STEP_UP_MFA_REQUIREDHigh-friction scope requires step-up MFA verification
403BUILDER_NOT_APPROVEDBuilder identity is not in approved status
403APP_NOT_APPROVEDApp is not in approved status
403APP_DISABLEDApp has been disabled by owner or admin
403DELEGATION_MISSINGon_behalf_of requires signed delegation grant
403DELEGATION_EXPIREDDelegation grant has expired
403JURISDICTION_BLOCKEDThis action is not permitted in this jurisdiction
403SANCTIONS_HITWallet address matches a sanctions list; registration or payout blocked
404SANDBOX_ONLYEndpoint only available in sandbox environment
404PROD_ONLYEndpoint disabled in sandbox environment

404

HTTPCodeDescription
404NOT_FOUNDResource not found (generic — route or record not present)
404MARKET_NOT_FOUNDMarket ID does not exist (specific — surfaces inside handlers that need a valid market before proceeding, e.g. subaccount transfer, MM quote creation, RFQ)

409 — conflict

HTTPCodeDescription
409ALREADY_EXISTSResource with that identifier already exists
409CONFLICTUniqueness constraint hit (e.g. same address registered on the same currency+network)
409STATE_CONFLICTRequested transition not valid from current state
409IDEMPOTENCY_IN_FLIGHTA prior request with the same key is still processing

422 — semantic

HTTPCodeDescription
422RISK_LIMIT_BREACHOrder would breach a configured risk limit
422BUILDER_FEE_ABOVE_CAPRequested builder_fee_bps exceeds apps.builder_fee_cap_bps
422MARKET_HALTEDMarket currently halted by circuit breaker
422MARKET_CLOSEDMarket is past close time
422MARKET_NOT_APPROVEDMarket template proposal is not yet approved
422MARKET_TEMPLATE_UNKNOWNTemplate id not found
422MARKET_TEMPLATE_PARAM_INVALIDTemplate param failed validation
422ORACLE_ADAPTER_UNKNOWNOracle adapter not registered
422ORACLE_DISAGREEMENTOracle adapters disagreed beyond max deviation
422RESOLUTION_LOCKEDResolution challenge window still open
422DISPUTE_ALREADY_OPENA dispute is already open on this market
422ANTI_ABUSE_BLOCKEDTrade flagged by anti-abuse rules (wash/self/related-party)
422OPERATOR_AGREEMENT_MISSINGOperator requires signed agreement before this action

429

HTTPCodeDescription
429RATE_LIMITEDRate limit exceeded, retry after Retry-After
429TIER_LIMIT_EXCEEDEDOrder or daily notional exceeds api_key tier caps
403TIER_UPGRADE_REQUIREDThis endpoint requires a higher trust tier
429SANDBOX_KEY_DAILY_LIMITThis IP has already minted a sandbox key today
401PASSWORD_INCORRECTCurrent password does not match
422PASSWORD_TOO_WEAKNew password does not meet strength requirements

webhook subsystem

HTTPCodeDescription
400WEBHOOK_URL_INVALIDWebhook URL must be a valid https URL with no userinfo/fragment (thrown by PAX on POST /v1/webhooks)
400WEBHOOK_SECRET_INVALIDreceiver-side. Recommended code for your webhook receiver to return when it cannot decode the signing secret. Not emitted by PAX; PAX emits WEBHOOK_URL_INVALID at register time.
401WEBHOOK_TIMESTAMP_SKEWreceiver-side. Recommended code for your receiver to return when the t= value in X-PAX-Signature is outside your tolerance window. Not emitted by PAX.
401WEBHOOK_SIGNATURE_INVALIDreceiver-side. Recommended code for your receiver to return when neither v1= HMAC matches the body. See /webhook-signing.
422WEBHOOK_EVENT_UNKNOWNWebhook event_type not present in canonical catalog (thrown by PAX on POST /v1/webhooks and PATCH /v1/webhooks/{id})

subaccounts / delegation

HTTPCodeDescription
409SUBACCOUNT_LABEL_TAKENA subaccount with this label already exists
409SUBACCOUNT_HAS_BALANCECannot close subaccount with nonzero balance
409SUBACCOUNT_HAS_POSITIONSCannot close subaccount with open positions
409SUBACCOUNT_HAS_OPEN_ORDERSCannot close subaccount with open orders
403SUBACCOUNT_FROZENSubaccount is frozen
403DELEGATION_SCOPE_MISMATCHPartner API key lacks required delegation:trade scope
422DELEGATION_DAILY_CAP_EXCEEDEDDelegation daily notional cap exceeded
422BALANCE_INSUFFICIENTBalance is insufficient for this operation (e.g. subaccount transfer, order placement)

composer

HTTPCodeDescription
400TEMPLATE_SCHEMA_INVALIDTemplate params_schema is malformed
400TEMPLATE_DISPLAY_KEY_MISSINGdisplay_defaults references a key not in params_schema
409PROPOSAL_STATE_INVALIDProposal state transition not valid
422COMBO_COMPONENT_HALTEDCombo derived market has a halted component
403COMPLIANCE_GATE_BLOCKEDCompliance gate blocked market creation

liquidity/RFQ

HTTPCodeDescription
400QUOTE_EXPIRED_IN_PASTQuote expires_at_ms must be in the future
400QUOTE_SIZE_INVALIDQuote size is invalid (must be > 0)
409RFQ_NOT_OPENRFQ is not open for new quotes
422RFQ_QUOTE_OUT_OF_BOUNDSRFQ quote price outside min/max bounds
422INCENTIVE_BUDGET_EXCEEDEDIncentive budget for this period is exhausted

widget / data / MCP

HTTPCodeDescription
404MCP_TOOL_UNKNOWNreserved · MCP subsystem. MCP tool name not registered
403MCP_SCOPE_MISSINGreserved · MCP subsystem. MCP tool call missing required scope
501MCP_NOT_IMPLEMENTEDreserved · MCP subsystem. MCP tool has no upstream implementation yet
403WIDGET_ORIGIN_BLOCKEDWidget embed origin is blocked
403DATA_TIER_EXCEEDEDData query exceeds allowed tier
422DATA_RANGE_TOO_LARGE_FOR_TIERRequested range exceeds tier maximum

oracle / resolution

HTTPCodeDescription
502ORACLE_ADAPTER_ERROROracle adapter fetch failed
403ORACLE_BOND_INSUFFICIENTOracle provider bond below configured minimum
422RESOLUTION_EVIDENCE_MISSINGResolution requires evidence and none was attached
409RESOLUTION_CHALLENGE_OPENCannot finalize while a challenge window is open

marketplace

HTTPCodeDescription
403LISTING_NOT_APPROVEDMarketplace listing has not been approved
409BOUNTY_ALREADY_CLAIMEDBounty has already been claimed

500 — / 502 / 503 / 504

HTTPCodeDescription
500INTERNAL_ERRORAn internal error occurred
502UPSTREAM_ERRORUpstream service returned an error
504UPSTREAM_TIMEOUTUpstream service timeout
503SERVICE_UNAVAILABLENamed subsystem is currently gated off (e.g. payouts kill-switch on for a scope), with a human-readable reason in the message
503MAINTENANCEService temporarily in maintenance

Canonical source

This table is generated from packages/core/src/errors.ts. To propose a new code, PR that file; do not edit this HTML directly. See OpenAPI spec for which codes each endpoint can return.