Batch Close Positions

Permission

  • Primary API Key: TRADE, batch close positions of main portfolio
  • Sub-Portfolio API Key: TRADE, batch close positions of current portfolio

Need to cancel all open orders before calling this endpoint to batch close existing positions.

Rate Limit

  • 3 requests per 10 seconds


Request

NameTypeMandatoryDescription
symStringNTrading pair unique identifier , separated by ','
example: BINANCE_PERP_BTC_USDT, OKX_PERP_BTC_USDT.
symList can't be empty if closeAllPos=false.
positionSideStringNNONE / LONG / SHORT. Unable to close positions if NONE passed , when the account mode is two-ways (BOTH) mode.
closeAllPosStringNtrue / false. default false. true to ignore symList and close all open positions in specific exchange
exchangeTypeStringNOKX / BINANCE

List# Response

Field nameTypeRemarks
symStringTrading pair unique identifier ,
example: BINANCE_PERP_BTC_USDT, OKX_PERP_BTC_USDT
positionSideStringNONE / LONG / SHORT
orderIdStringorder id to close the current sym
successStringtrue / false. where it is able to issue an order to close the current sym
errorMsgStringerror message if unable to issue an order to close the current sym
Language