Ontwikkelaarsportaal

Query Payment Order#

Look up an order by its platform order ID or merchant order ID. Use the same API key that created it.

POST
/api/v6/pay/onchainos-payment/query

The query endpoint accepts either order ID and requires the same API key as the create request.

Request Parameters#

FieldTypeRequiredDescription
paymentIntentIdStringOne of the two fieldsPlatform order ID returned by the create endpoint. Maximum 32 characters.
merchantPaymentIdStringOne of the two fieldsMerchant order ID. Maximum 64 characters.

Provide exactly one of these fields.

Request Example by Platform Order ID#

bash
curl --request POST 'https://web3.okx.com/api/v6/pay/onchainos-payment/query' \
  --header "OK-ACCESS-KEY: ${OK_ACCESS_KEY}" \
  --header "OK-ACCESS-SIGN: ${OK_ACCESS_SIGN}" \
  --header "OK-ACCESS-PASSPHRASE: ${OK_ACCESS_PASSPHRASE}" \
  --header "OK-ACCESS-TIMESTAMP: ${OK_ACCESS_TIMESTAMP}" \
  --header 'Content-Type: application/json' \
  --data-raw '{"paymentIntentId":"2026110600000123456789012345678901"}'

Request Body by Merchant Order ID#

json
{
  "merchantPaymentId": "order_20261106_0001"
}

Response Parameters#

The response includes these fields in data.

FieldTypeDescription
merchantPaymentIdStringMerchant order ID.
paymentIntentIdStringPlatform payment order ID.
statusStringCurrent order status. See Payment Flow for status definitions.
toStringRecipient address.
txHashString / nullPayment transaction hash. It is null until available. A hash can be available before settlement.
fiatAmountStringReference fiat amount provided when the order was created.
fiatCurrencyStringReference fiat currency provided when the order was created.
paymentTokenObject / nullToken and amount actually paid. Usually null while payment is pending or processing.
expiresAtStringOrder expiration in ISO 8601 UTC format.
merchantDisplayNameString / nullOptional merchant display name from order creation. Null if omitted.
qrContentString / nullOKX Pay QR code content is unavailable.

When paymentToken is present, it contains these fields.

FieldTypeDescription
chainIdStringPayment network's chain ID, currently "196".
tokenSymbolStringToken symbol.
tokenAddressStringToken contract address.
tokenDecimalIntegerNumber of token decimals.
tokenAmountStringAmount actually paid, in the token's smallest unit.

Save the checkout URL and order details returned by the create endpoint. The query response excludes checkoutUrl and the full quote list.

Pending Payment Response#

json
{
  "code": 0,
  "msg": "",
  "data": {
    "merchantPaymentId": "order_20261106_0001",
    "paymentIntentId": "2026110600000123456789012345678901",
    "status": "pending",
    "to": "0x1111111111111111111111111111111111111111",
    "txHash": null,
    "fiatAmount": "10.00",
    "fiatCurrency": "USD",
    "paymentToken": null,
    "expiresAt": "2026-11-06T04:30:00Z",
    "merchantDisplayName": null
  }
}

Settled Payment Response#

json
{
  "code": 0,
  "msg": "",
  "data": {
    "merchantPaymentId": "order_20261106_0001",
    "paymentIntentId": "2026110600000123456789012345678901",
    "status": "settled",
    "to": "0x1111111111111111111111111111111111111111",
    "txHash": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
    "fiatAmount": "10.00",
    "fiatCurrency": "USD",
    "paymentToken": {
      "chainId": "196",
      "tokenSymbol": "USDC",
      "tokenAddress": "0xb6ceceab302e2e4948951ee7843fc24e92933061",
      "tokenDecimal": 6,
      "tokenAmount": "10000000"
    },
    "expiresAt": "2026-11-06T04:30:00Z",
    "merchantDisplayName": null,
    "qrContent": null
  }
}

The order IDs, addresses, transaction hash, and timestamps are example values.