API reference

Query Settlement Status#

Query settlement status by on-chain transaction hash. Applicable to exact (syncSettle=false) asynchronous polling scenarios and status tracking after aggr_deferred compressed on-chain submission.

Request URL: GET /api/v6/pay/x402/settle/status

Request Parameters#

ParameterTypeRequiredDescription
txHashStringYesOn-chain transaction hash (Query parameter)

Response Parameters#

ParameterTypeDescription
successBooleanWhether the query succeeded (false when txHash does not exist)
errorReasonStringMachine-readable failure reason (returned on failure)
errorMessageStringHuman-readable failure description (returned on failure)
payerStringPayer wallet address
transactionStringOn-chain transaction hash
networkStringCAIP-2 chain identifier
statusStringCurrent settlement status

status Values#

statusMeaning
pendingProcessing, not yet finalized
successOn-chain transaction succeeded
failedOn-chain transaction failed

Request Example#

Bash
curl --location --request GET 'https://web3.okx.com/api/v6/pay/x402/settle/status?txHash=0x4f46ed8eac92ddbccfb56a88ff827db3616c7beb191adabbeeded901340bd7d5' \
--header 'OK-ACCESS-KEY: 37c541a1-****-****-****-10fe7a038418' \
--header 'OK-ACCESS-SIGN: leaV********3uw=' \
--header 'OK-ACCESS-PASSPHRASE: 1****6' \
--header 'OK-ACCESS-TIMESTAMP: 2023-10-18T12:21:41.274Z'

Response Example -- Query Succeeded#

Json
{
  "code": "0",
  "msg": "success",
  "data": {
    "success": true,
    "errorReason": null,
    "errorMessage": null,
    "payer": "0xcb30ed083ad246b126a3aa1f414b44346e83e67d",
    "transaction": "0x4f46ed8eac92ddbccfb56a88ff827db3616c7beb191adabbeeded901340bd7d5",
    "network": "eip155:196",
    "status": "success"
  }
}

Response Example -- Transaction Not Found#

Json
{
  "code": "0",
  "msg": "success",
  "data": {
    "success": false,
    "errorReason": "not_found",
    "errorMessage": "Transaction not found for txHash: 0xabc123...",
    "payer": null,
    "transaction": null,
    "network": null,
    "status": null
  }
}