Unable to place sell order from api for Sensex option

This is the code to place an order.

image

Here are the details for security ID’s which I extracted from the csv file.
image

This is the error which I keep getting as a response from DHAN api

The error is not at all helpful.

The value for qty is 10 and symbol is 874026 which seem to be correct parameter values.

I am clueless here now.
This is only happening for the SENSEX options, for all the other instruments like (Nifty, BankNifty, Midcpnifty) the same lines of code works like a charm.

Would really appreciate some help here.

@Dhan @Dhan_Help
@Hardik
@Poornima

I see for curl requests there are dedicated segment types for BSE FNO

However, I don’t see any such updates for the python library

@Hardik @Dhan @Dhan_Help Would really appreciate some clarity here.

Hello @sugam192

Yes, if you look at the Python Library, FNO is defined for NSE_FNO. This is the reason why you are getting the error.

Over here, for BSE_FNO, while using Python Library, you will have to pass it as a string which is

exchange_segment="BSE_FNO"

This should help. You can raise a PR on github if you want to contribute this change, or else we will add this in the next build and update documentation accordingly.

Thanks Hardik, it worked.
I would be glad to raise a PR… can you please share the URL to the repo

Sure @sugam192

Would be great to have you contribute. Here is the repo: GitHub - dhan-oss/DhanHQ-py: The official Python client for communicating with the Dhan API.