Unable to place Exit order from API for CNC orders

I have placed CNC order from API, now i want to exit on same day from API.

When i place request it from api -

data = {
    "id":"NSE:ABCAPITAL-EQ-CNC"
}

response = fyers.exit_positions(data=data)
print(response)

I get response - {'code': 201, 'message': 'Exit request has been sent. Kindly refresh your positions to check the status.', 's': 'ok'}


But if i check in web portal i get rejected message - Sell Overnight/Invest orders only be placed if it is available in the holdings. Check for pending orders or missing eDIS authorisation.

Note : I have enabled DDPI

If i have taken some position to carry for next day selecting CNC order, but if i want to close it today itself from API, how to achieve it?

2 replies