I’m trying to place an options order through the API but receiving a DH-905 error (Missing required fields, bad values for parameters etc.) despite matching the payload format from the documentation exactly.
What’s Working:
Successfully able to call other endpoints (e.g., /v2/fundlimit)
Authentication is working (getting 200 responses for other endpoints)
Your first payload is correct, where you are taking quantity in lot size (i.e. 25). However, you have added ‘orderType’ as MARKET but adding price as well. If you want to place market order, then keep price as 0. Else, you can keep order type as LIMIT and enter your desired order price.
Do we really need all of the above? For example if afterMarketOrder is false, do we still need to pass amoTime as blank? Also, I tried quantity as simple integer and also as a string (shown above) but I get the same error:
{
"errorType": "Input_Exception",
"errorCode": "DH-905",
"errorMessage": "Missing required fields, bad values for parameters etc."
}
I am sure it is something very small that I am missing but not able to figure out!
It worked! I had to make the afterMarketOrder to true and enter OPEN as amoTime since I was doing it “After market”! So I am guessing, when the market is live, I need to pass afterMarketOrder as false and amoTime as blank (“”) and it should work.
Your ‘making quantity in lot size (i.e. 25)’ part of the comment is what I was actually doing wrong earlier. Thank you so much for specifically pointing that out! Very helpful!
Sorry for missing this thread earlier. Can you check the security ID over here? Rest everything looks good.
Or if you can say which instrument are you trying to place this order in, would be able to replicate at my end as well.
@rahulbajaj - I may be wrong but can you try also changing triggerPrice from 0 to 0.0. I am sending a float value for price and triggerPrice values when using the API. It may or may not work but you can give it a try. Like @Hardik mentions everything else looks good.
Thanks @Chutku and @Hardik I am trying with nifty 22700 ce or pe I guess. It was for 21st Feb but it expired so can you try with upcoming weekly expiry.