API Reference

Close Positions

Rate Limit: 3 requests per 10 seconds

Close position batch, this api is asynchronous. Returning success only means that the request is successful. The final result needs to be confirmed through websocket subscription and order query.

Request

Field nameTypeNecessaryRemarks
symListStringNTrading Pair Unique Identifier, e.g: BINANCE_PERP_BTC_USDT, OKX_PERP_BTC_USDT。
Support up to 20 pairs, separated by "," .
positionSideStringNNONE / LONG / SHORT, NONE stands for one-way mode position. When current position mode:
Two-way: NONE to close both sides.
One-way: LONG/SHORT will be ignored.
closeAllPosStringNtrue/false。default false。In false case, symList mustn't be empty.
exchangeTypeStringNOKX / BINANCE. empty to close all exchange positions. Only applies to closeAllPos = true.

Response

FieldTypeRemark
symStringTrading Pair Unique Identifier, e.g: BINANCE_PERP_BTC_USDT
orderIdStringorderId, if cannot close position, it don't have orderId
positionSideStringorder positionSide
successStringcan close or not, true/false
errorMsgStringif cannot close position, errorMsg is reason
Language