Error Codes#

API Error Handling#

CodeHTTP StatusMessage
0200Success
50011429Rate limit triggered. Please refer to the API documentation and control request frequency accordingly
50014400Parameter {param0} cannot be empty
50026500System error. Please try again later
50103401Request header "OK-ACCESS-KEY" cannot be empty
50104401Request header "OK-ACCESS-PASSPHRASE" cannot be empty
50105401Request header "OK-ACCESS-PASSPHRASE" is incorrect
50106401Request header "OK-ACCESS-SIGN" cannot be empty
50107401Request header "OK-ACCESS-TIMESTAMP" cannot be empty
50111401Invalid OK-ACCESS-KEY
50112401Invalid OK-ACCESS-TIMESTAMP
50113401Invalid signature
51000400Parameter {param0} is invalid

Payment Error Handling#

Error MessageMeaningTroubleshooting
Empty / null responseRequest missing PAYMENT-SIGNATURE or X-PAYMENT headerInclude PAYMENT-SIGNATURE or X-PAYMENT in the request after signing
invalid payment headerPAYMENT-SIGNATURE content is invalidCheck for truncation / character set issues / multiple base64 encodings
param_mismatchRequired fields missing, address / nonce format invalid, or other parameter issuesVerify that parameters in the signature match the response
toAddr mismatchPay-to address does not match the recipient address in the response, or recipient address is the zero addressRecipient address must match exactly and must not be 0x0000…
amount mismatchSigned amount does not match the amount in the responseAlign the amount with the response; the value in EIP-3009 must equal the amount in the response
unsupported_chainThe chainIndex resolved from network is not supportedCurrently only X Layer (eip155:196) is supported
payer_blockedauthorization.from has triggered a business risk control ruleContact OKX business team / submit a risk control appeal
risk_addresspayer or payTo has triggered a compliance risk control rule (blacklist / sanctioned address)This address cannot be used for x402; switch to a different address
resource mismatchThe interface URL at signing time ≠ the current request URLAlways use the current request URL when signing; do not reuse payloads from other URLs
no matching payment optionThe payment token does not match the token required by the endpointSign using the token specified in the response
invalid_signatureSignature format is invalid (length, r/s range, low s, v value); deferred: Ed25519 verification failedUse the OKXEvmSigner provided by OKX; do not manually construct EIP-712; tampered value/from cannot be verified
not_yet_validvalidAfter > nowCheck system clock
expiredIn exact mode, validBefore <= now (no 60s grace period currently)Check system clock
invalid signature, nonce_usedThe EIP-3009 nonce has already been consumed on-chainDo not replay; generate a fresh 32-byte random nonce and re-sign
insufficient_balanceAddress balance is insufficient to cover the cost of this callTop up the balance or reduce concurrent payments
onchain_errorOn-chain multicall RPC call failed / sub-call returned failureUsually caused by node instability; retry the request
payment processingDuplicate request with the same signature within the cache windowDo not resubmit the same signature within the cache window