Trade

Cancel TPSL

This endpoint supports the canceling of take profit and stop loss (TP/SL).

HTTP Request

POST /v1/trade/cancel-tpsl

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
tpPricefalsenumbertake profit price of the position
slPricefalsenumberstop loss price of the position

Response Parameters

ParameterTypeComments
statusCodenumber200
resultstringSuccess
messagestringTPSL canceled successfully!
ParameterTypeComments
statusCodenumber404
resultstringNot Found
messagestringPosition not found!

INFO

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

Request Example

POST /v1/trade/cancel-tpsl 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": "TPSL canceled successfully!",
}

On this page