Skip to main content

Close Positions

Flash close positions at market price for a specific symbol or all positions.

HTTP Request

POST /api/v1/future/order/close-positions

Request Parameters

ParameterTypeRequiredDescription
symbolstringNoTrading pair symbol (if omitted, closes all positions)
holdSidestringNoPosition side to close: "LONG" or "SHORT" (if omitted, closes both)

Request Example

Close Specific Position

curl -X POST "https://open-api.bydoxe.com/api/v1/future/order/close-positions" \
-H "ACCESS-KEY: your-api-key" \
-H "ACCESS-SIGN: your-signature" \
-H "ACCESS-PASSPHRASE: your-passphrase" \
-H "ACCESS-TIMESTAMP: 1659076670000" \
-H "Content-Type: application/json" \
-d '{
"symbol": "BTCUSDT",
"holdSide": "LONG"
}'

Close All Positions

curl -X POST "https://open-api.bydoxe.com/api/v1/future/order/close-positions" \
-H "ACCESS-KEY: your-api-key" \
-H "ACCESS-SIGN: your-signature" \
-H "ACCESS-PASSPHRASE: your-passphrase" \
-H "ACCESS-TIMESTAMP: 1659076670000" \
-H "Content-Type: application/json" \
-d '{}'

Response Parameters

ParameterTypeDescription
codestringResponse code
msgstringResponse message
requestTimenumberRequest timestamp in milliseconds
dataobjectFlash close result
> successListarrayArray of successfully closed positions
>> orderIdstringClosing order ID
>> clientOidstringClient order ID
>> symbolstringTrading pair symbol
> failureListarrayArray of failed closures

Response Example

Success Response

{
"code": "00000",
"msg": "success",
"requestTime": 1763459280000,
"data": {
"successList": [
{
"orderId": "fu-123456789",
"clientOid": "flash-close-001",
"symbol": "BTCUSDT"
}
],
"failureList": []
}
}

Error Codes

No specific errors - returns success with empty lists if no positions