Exiting order using multiple order id

I am currently developing an algorithm using the FYERS Python API to manage multiple orders. According to the documentation, in order to exit these multiple orders, I need to provide a list of dictionaries. However, when I attempted to use this approach, I received an error message stating 'Looks like you have no open positions.' where no positions were exited. To troubleshoot the issue, I tried passing a list of order IDs as a single dictionary key named 'id', It works now. I am unsure whether the documentation is incorrect or if I made a mistake in my implementation. I have attached the code snippet below for reference. Any insights or suggestions to resolve this would be greatly appreciated.

# In documentation

fyers.exit_positions(data=[{"id": "NSE:ITC-EQ-INTRADAY"},{"id":"NSE:SBIN-EQ-INTRADAY"}])

# Response
{'code': 1101, 'message': 'Looks like you have no open positions.', 's': 'ok'}

# So, I tried it with the list of id's for a single dictionary key of id

fyers.exit_positions(data={"id":[ "NSE:ITC-EQ-INTRADAY", "NSE:SBIN-EQ-INTRADAY"]})

# response
{'s': 'ok', 'code': 1101, 'message': '2 positions are closed.'}


1
1 reply