@TUSH123, For regular(MIS, CNC, NRML) positions, you need to loop through positions to square off positions by placing an order of opposite transaction type for the same number of quantities at the market.
For bo, co positions, you need to loop through orderbook and find the pending orders with parent order id and send an exit position request. For bracket order exit, the system will take care of canceling one of the orders and modifying another order to execute at the market.
For regular(MIS, CNC, NRML) positions, you need to loop through positions to square off positions by placing an order of opposite transaction type for the same number of quantities at the market.
For bo, co positions, you need to loop through orderbook and find the pending orders with parent order id and send an exit position request.
For bracket order exit, the system will take care of canceling one of the orders and modifying another order to execute at the market.
You can refer to the documentation here.