Modify Order: RS-9005 failure " todo mandatory fields '

I’m trying to modify a SL order.

dhan.modify_order(
                order_id=252305******,
                order_type=dhan.SL,
                leg_name='ENTRY_LEG',
                quantity=int(order_quantity),
                price=float(140.8),
                disclosed_quantity=int(order_quantity),
                trigger_price=float(135),
                validity=dhan.DAY
            )

It’s a FNO SL order. ‘leg_name’ is marked as conditionally required. But if I leave it off, I get the error that a positional field is missing. Same issue with ‘disclosed_quantity’. If I leave ‘leg_name’ as ‘’ (like in the example), I get the error that the field is blank. If I get any of the other value (like STOP_LOSS_LEG), I get the error code RS-9005 with message " todo mandatory fields ’ !! :roll_eyes: What does that even mean?

And more important, how do I modify an order. Using python.

1 Like

Hello @Sumith

Welcome to Dhan Community!

As in the example shared by you, leg_name should be ENTRY_LEG only if you want to add that. If you add this, what is the error message you are getting?

It will be great if you can share your Client ID along with API request time at api@dhan.co, so that we can look into from our end and help you resolve this faster.

Sent an email with the details. Thanks

Hi @Hardik , I never got a reply back after sending the email to api@dhan.co.

To your question after adding the leg_name as ENTRY_LEG, the error message is RS-9005 " todo mandatory fields ". What does this cryptic remark message mean? Someone forgot to finish their TODO items in the code?? There seems to be no way to modify an existing order contrary to what is in the API and examples. Any help will be appreciated.

Hello @Sumith

We checked the logs and found that the orders modifications were placed successfully. Have replied you on mail as well couple of days back for the same. In case you are still facing the issue, feel free to send in order ID on the same mail, and would definitely look into it.