Trade

Limit Close Position

This endpoint supports the closing of orders in USDT futures via Limit sell.

HTTP Request

POST /v1/trade/close-position

NOTE

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

Request Parameters

ParameterRequiredTypeComments
exitPricetruenumberexit price for the position
idtruenumberid of the position
sizetruenumbersize of the position
coinfalsestringValues:
  • BTCUSDT, ETHUSDT, SOLUSDT, XRPUSDT 1000PEPEUSDT, WLDUSDT, DOGEUSDT,
  • STPTUSDT, SUIUSDT, ADAUSDT, ARBUSDT, XLMUSDT, HIVEUSDT, ONDOUSDT

Response Parameters

ParameterTypeComments
statusCodenumber200
resultstringSuccess
messagestringOrder Placed successfully!
ParameterTypeComments
statusCodenumber404
resultstringNot Found
messagestringPosition not found!

INFO

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

Request Example

POST /v1/trade/close-position HTTP/1.1
Host: api.okxai.net
X-OKXAI-SIGN: XXXXX
X-OKXAI-API-KEY: XXXXX
Content-Type: application/json
 
{
  "exitPrice": 50000.00, 
  "id": 456, 
  "size": 0.5, 
  "coin": "BTCUSDT", 
}

Response Example

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

On this page