Skip to Content
API ReferenceTradingPositionsExit Positions by Filters

Exit Positions by Filters

This API allows you to exit open positions that match a segment, side and product type.

USE CASE

Close every position of a chosen segment, side and product type in one request.

Details

  • segment, side and productType are all mandatory, and each takes a list. Example: segment [10,12], side [1,-1], productType ["INTRADAY","CNC"].
  • segment values: 10 (Capital Market), 11 (Equity Derivatives), 12 (Currency Derivatives), 20 (Commodity Derivatives).
  • side values: 1 (buy side) and -1 (sell side). Pass both to cover both sides.
  • productType values: "INTRADAY", "CNC", "MARGIN" or "ALL".
  • This uses the same DELETE /api/v3/positions endpoint as Exit Position. To exit specific positions by id, use Exit Position by ID.
  • Rate limits differ between the Standard and Prime plans. See Plans & rate limits.

Request Attributes

AttributeData TypeDescription
segment*[ int ]
  • Mandatory
  • In the API , to close your position for a specific segment, you need to use the "segment" parameter with one of the following possible values: 10(Capital Market),11(Equity Derivatives),12(Currency Derivatives),20(Commodity Derivatives). Eg: [10,12]
side*[ int]
  • Mandatory
  • In the API , to close your position for a specific side, you need to use the "side" parameter with one of the following possible values: 1(Buy side),-1(Sell side). Eg: [1,-1]
productType*[ string ]
  • Mandatory
  • In the API , to close your position for a specific orderType, you need to use the "productType" parameter with one of the following possible values: "INTRADAY","CNC","MARGIN","ALL". Eg: ["INTRADAY","CNC"]

Response Attributes

AttributeData TypeDescription
sstringRequest status - ok / error
codeintCode identifying the specific response
messagestringMessage clarifying the request status, e.g. "The position is closed."
Last updated on