Portal de desarrollo
Tema

Cancel Intent Order#

Cancel an existing intent order. Obtain the signature by signing the data returned from the Get Cancel Order Sign Data endpoint with the order owner's wallet.

Request URL#

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

Request Parameters#

ParameterTypeRequiredDescription
userWalletAddressStringYesThe wallet address of the order owner.
orderUidStringYesThe unique identifier of the intent order to be cancelled.
signingSchemeStringNoSignature scheme. Default eip712.Supported values: eip712 (standard EIP-712 signature for EOA wallets), eip1271 (smart contract wallet signature. Please refer to OKX Intent SDK for contract signature verification rules and construct the corresponding signature).
signatureStringYesSignature over the signData object returned by the quote endpoint, produced according to signingScheme. When signingScheme=eip712, this is the user wallet's EIP-712 signature over signData; when signingScheme=eip1271, this is the smart contract wallet signature.

Response Parameters#

ParameterTypeDescription
orderUidStringThe unique identifier of the cancelled order. Returns null if the cancellation failed.
statusStringThe cancellation result. Possible values: success, failed.

Request Example#

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..."
}'

Response Example#

Success#

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

Failed#

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