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.bitget.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. In one-way position mode(buy or sell): This field should be left blank. Will be ignored if filled in.
2. In hedge-mode position(open or close): 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: Long position; short: Short position
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": "xxx",
"errorCode": "xxxx"
}
]
},
"msg": "success",
"requestTime": 1627293504612
}

Response Parameters

ParameterTypeDescription
successListList<Object>The collection of successfully closed orders
>orderIdStringOrder ID
>clientOidStringCustomize order ID
failureListList<Object>The collection of unsuccessfully closed orders
The close order may fail when the pair is in delivery or in risk control handling
>orderIdStringOrder ID
>clientOidStringCustomize order ID
>errorMsgStringFailure reason
>errorCodeStringFailure code

How was your Reading Experience with us?