Skip to main content

Flash Close Position

Frequency limit: 1 time/1s (User ID)

Description

close position at market price

HTTP Request

  • POST /api/v2/mix/order/close-positions
Request Example
curl -X POST "https://api.cointr.com/api/v2/mix/order/close-positions" \
-H "ACCESS-KEY:your apiKey" \
-H "ACCESS-SIGN:*" \
-H "ACCESS-PASSPHRASE:*" \
-H "ACCESS-TIMESTAMP:1659076670000" \
-H "locale:zh-CN" \
-H "Content-Type: application/json" \
-d '{"symbol": "BTCUSDT","productType":"usdt-futures","holdSide": "long"}'

Request Parameters

ParameterTypeRequiredDescription
symbolStringNoTrading pair
holdSideStringOptionalPosition direction
1. Buy or sell (one-way position) mode: May be left blank. Will be ignored if filled in.
2. In open and close mode (hedge mode position): All positions will be closed if the field is left blank; Positions of the specified direction will be closed is the field is filled in.
Long; Short
productTypeStringYesProduct type
USDT-FUTURES USDT professional futures
COIN-FUTURES Mixed futures
USDC-FUTURES USDC professional futures
SUSDT-FUTURES USDT professional futures demo
SCOIN-FUTURES Mixed futures demo
SUSDC-FUTURES USDC professional futures demo
Response Example
{
"code": "00000",
"data": {
"successList": [
{
"orderId": "123",
"clientOid": "xxxxx"
}
],
"failureList": [
{
"orderId": "1234",
"clientOid": "321",
"errorMsg": "clientOrderId duplicate ",
"errorCode": "43118"
}
]
},
"msg": "success",
"requestTime": 1627293504612
}

Response Parameters

ParameterTypeDescription
successListList<Object>The collection of successfully cancelled orders.
>orderIdStringOrder ID
>clientOidStringCustomize order ID
failureListList<Object>The collection of unsuccessfully cancelled orders.
>orderIdStringOrder ID
>clientOidStringCustomize order ID
>errorMsgStringFailure reason
>errorCodeStringFailure code