Close a position
DELETEπ Trading
Submits a closing order (LIMIT or MARKET) against an existing position identified by positionId.
Request Parametersβ
| Name | Type | Required | Description |
|---|---|---|---|
| symbol | String | Yes | Market symbol of the position to close (e.g. BTC-PERP). |
| positionId | String | Yes | Identifier of the position to close. |
| orderType | String | Yes | Order type used to close the position (LIMIT or MARKET). |
| orderPrice | Double | No | Limit price for the closing order. Required when orderType == LIMIT. |
| postOnly | Boolean | No | If true, the closing order will only be placed as a maker; otherwise it is cancelled. |
| timeInForce | String | No | Time-in-force for the closing order. Defaults to GTC when omitted. β FOK Β· GTC Β· IOC Β· HALFSEC Β· HALFMIN Β· FIVEMIN Β· HOUR Β· TWELVEHOUR Β· DAY Β· WEEK Β· MONTH |
| clOrderId | String | No | Optional client-assigned order id echoed back in the response. |
Response Contentβ
| Name | Type | Description |
|---|---|---|
| status | Integer | Status code of the closing order. |
| type | Integer | Event type code of the closing order response. |
| symbol | String | Market symbol of the closing order (e.g. BTC-PERP). |
| postOnly | Boolean | Whether the closing order is post-only. |
| orderSide | String | Side of the closing order (opposite to the position direction). β BUY Β· SELL |
| orderId | String | Server-assigned order id of the closing order. |
| clOrderID | String | Client-assigned order id echoed back, if provided in the request. |
| timestamp | Long | Server timestamp of the response, in milliseconds since epoch. |
| price | Double | Requested limit price of the closing order (0 for market orders). |
| avgFilledPrice | Double | Average fill price achieved so far. |
| message | String | Human-readable message describing the result. |
| originalOrderSize | Long | Original order size at submission, in contracts. |
| currentOrderSize | Long | Current remaining size on the order book, in contracts. |
| filledSize | Long | Size filled by the most recent fill event, in contracts. |
| totalFilledSize | Long | Total size filled since order submission, in contracts. |
| remainingSize | Long | Size still outstanding on the order, in contracts. |
| positionMode | String | Position mode of the closed position (ONE_WAY or HEDGE). |
| positionDirection | String | Position direction of the closed position (LONG or SHORT). |
| positionId | String | Identifier of the position being closed. |
| timeInForce | String | Time-in-force applied to the closing order (e.g. GTC, IOC, FOK). |
example
DELETE
https://api.btse.com/futures/api/v3/trade/positionsRequest (default)
{
"symbol": "BTC-PERP",
"positionId": "BTC-PERP-USDT",
"orderType": "MARKET"
}
Response (default)
{
"status": 4,
"type": 0,
"symbol": "BTC-PERP",
"postOnly": false,
"orderSide": "SELL",
"orderId": "46769934-50af-4693-a0c3-ed32812a7650",
"clOrderID": "",
"timestamp": 1784882345177,
"price": 60003,
"avgFilledPrice": 60003,
"message": null,
"originalOrderSize": 6,
"currentOrderSize": 6,
"filledSize": 6,
"totalFilledSize": 6,
"remainingSize": 0,
"positionMode": "ONE_WAY",
"positionDirection": null,
"positionId": "BTC-PERP-USDT",
"timeInForce": "GTC"
}