Trade

Cancel Order

IMPORTANT

  • You must specify id to cancel the order.

HTTP Request

POST /v1/trade/cancel-order

NOTE

Don't include trailing slash / at the end of the endpoint. Doing so can result in a “not found” error.

Request Parameters

ParameterRequiredTypeComments
idtruenumberid of the position

INFO

The ack of cancel order request indicates that the request is successfully accepted. Please use websocket order stream to confirm the order status.

Response Parameters

ParameterTypeComments
statusCodenumber200
resultstringSuccess
messagestringOrder canceled successfully
ParameterTypeComments
statusCodenumber400
resultstringBad Request
messagestringInvalid Input!

Request Example

POST /v1/trade/cancel-order HTTP/1.1
Host: api.okxai.net
X-OKXAI-SIGN: XXXXX
X-OKXAI-API-KEY: XXXXX
Content-Type: application/json
 
{
  "id": 456
}

Response Example

{
  "statusCode": 200,
  "result": "Success",
  "message": "Order canceled successfully!",
}

On this page