Close All Positions
- POST
/capi/v2/order/closePositions
Weight(IP): 40, Weight(UID): 50
Request parameters
| Parameter | Type | Required? | Description |
|---|---|---|---|
| symbol | String | No | Trading pair. If not provided, all positions will be closed at market price |
Request example
curl -X POST "https://api-contract.weex.com/capi/v2/order/closePositions" \
-H "ACCESS-KEY:*******" \
-H "ACCESS-SIGN:*" \
-H "ACCESS-PASSPHRASE:*" \
-H "ACCESS-TIMESTAMP:1659076670000" \
-H "locale:zh-CN" \
-H "Content-Type: application/json" \
-d '{"symbol": "cmt_btcusdt"}'
Response parameters
| Parameter | Type | Description |
|---|---|---|
| positionId | Long | Position ID |
| success | Boolean | Whether the position was successfully closed |
| successOrderId | Long | Order ID if successful (0 if failed) |
| errorMessage | String | Error message if the close position failed |
Response example
[
{
"positionId": 690800371848708186,
"successOrderId": 696023766399976282,
"errorMessage": "",
"success": true
}
]