取消意图订单#

取消一笔已提交的意图订单。调用本接口前,需先通过获取取消订单签名数据接口获取 signData,使用订单持有者的钱包对其进行签名,再将签名结果作为 signature 参数传入。

请求地址#

POST
https://web3.okx.com/api/v6/dex/aggregator/intent/cancel-order

请求参数#

参数类型必传描述
userWalletAddressString下单者钱包地址。
orderUidString需要取消的意图订单唯一标识。
signatureString使用订单持有者钱包对获取取消订单签名数据接口返回的 signData 进行 EIP-712 签名后的结果。

响应参数#

参数类型描述
orderUidString已取消订单的唯一标识。取消失败时返回 null
statusString取消操作结果。可选值:success(成功)、failed(失败)。

请求示例#

shell
curl --location --request POST 'https://web3.okx.com/api/v6/dex/aggregator/intent/cancel-order' \
--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' \
--header 'Content-Type: application/json' \
--data-raw '{
  "userWalletAddress": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4",
  "orderUid": "0xfa2506196276f31c6bf7f4a2f02f3bd5ad80ed91354441ce4d5f28c87021e64c5b38da6a701c568545dcfcb03fcb875f56beddc469bbd743",
  "signature": "0x1234567890abcdef..."
}'

响应示例#

成功#

json
{
    "code": "0",
    "data": [
        {
            "orderUid": "0xfa2506196276f31c6bf7f4a2f02f3bd5ad80ed91354441ce4d5f28c87021e64c5b38da6a701c568545dcfcb03fcb875f56beddc469bbd743",
            "status": "success"
        }
    ],
    "msg": ""
}

失败#

json
{
    "code": "0",
    "data": [
        {
            "orderUid": null,
            "status": "failed"
        }
    ],
    "msg": ""
}