Skip to main content

Close a position

Submits a closing order (LIMIT or MARKET) against an existing position identified by positionId.

Request Parameters​

NameTypeRequiredDescription
symbolStringYesMarket symbol of the position to close (e.g. BTC-PERP).
positionIdStringYesIdentifier of the position to close.
orderTypeStringYesOrder type used to close the position (LIMIT or MARKET).
orderPriceDoubleNoLimit price for the closing order. Required when orderType == LIMIT.
postOnlyBooleanNoIf true, the closing order will only be placed as a maker; otherwise it is cancelled.
timeInForceStringNoTime-in-force for the closing order. Defaults to GTC when omitted. β€” FOK Β· GTC Β· IOC Β· HALFSEC Β· HALFMIN Β· FIVEMIN Β· HOUR Β· TWELVEHOUR Β· DAY Β· WEEK Β· MONTH
clOrderIdStringNoOptional client-assigned order id echoed back in the response.

Response Content​

NameTypeDescription
statusIntegerStatus code of the closing order.
typeIntegerEvent type code of the closing order response.
symbolStringMarket symbol of the closing order (e.g. BTC-PERP).
postOnlyBooleanWhether the closing order is post-only.
orderSideStringSide of the closing order (opposite to the position direction). β€” BUY Β· SELL
orderIdStringServer-assigned order id of the closing order.
clOrderIDStringClient-assigned order id echoed back, if provided in the request.
timestampLongServer timestamp of the response, in milliseconds since epoch.
priceDoubleRequested limit price of the closing order (0 for market orders).
avgFilledPriceDoubleAverage fill price achieved so far.
messageStringHuman-readable message describing the result.
originalOrderSizeLongOriginal order size at submission, in contracts.
currentOrderSizeLongCurrent remaining size on the order book, in contracts.
filledSizeLongSize filled by the most recent fill event, in contracts.
totalFilledSizeLongTotal size filled since order submission, in contracts.
remainingSizeLongSize still outstanding on the order, in contracts.
positionModeStringPosition mode of the closed position (ONE_WAY or HEDGE).
positionDirectionStringPosition direction of the closed position (LONG or SHORT).
positionIdStringIdentifier of the position being closed.
timeInForceStringTime-in-force applied to the closing order (e.g. GTC, IOC, FOK).
example
DELETEhttps://api.btse.com/futures/api/v3/trade/positions

Request (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"
}