Hi,
Has something changed in the super order recently? My code which was working fine is giving an error. I have not changed anything in the code.
{“errorType”:“Input_Exception”,“errorCode”:“DH-905”,“errorMessage”:“Missing required fields, bad values for parameters etc.”}
Hello @Rohit_Tikekar ,
We request you to please share your request structure with us so we can assist you better.
Also, if you’ve added the field correlation_id, make sure it’s less than 30 characters. You can check the detailed payload structure here: Super Order - DhanHQ Ver 2.0 / API Document
It was the correlation id length. I adjusted it so now it is working again. Thank you.
1 Like
Hi @Trishul_Devadiga ,
This was working fine after I fixed the length issue. Now today I am facing another issue.
HTTP error occurred: 400 Client Error: for url:
Response content: {“errorType”:“Input_Exception”,“errorCode”:“DH-905”,“errorMessage”:“dhanClientId is required”}
I have generated access token as usual and have not made any changes to the payload or script anywhere.
Hey @Rohit_Tikekar ,
Please ensure that you mention the client ID as shown in the error. If it’s already included and you’re still facing the error, kindly share the payload for further assistance.
payload = {
“clientId”: client_code,
“correlationId”: str(uuid.uuid4())[:30],
“transactionType”: trans_type,
“exchangeSegment”: dhan.NSE,
“productType”: dhan.INTRA,
“orderType”: dhan.MARKET,
“securityId”: stock_id,
“quantity”: quantity,
“price”: 0, # Price should be 0 for Intraday orders
“targetPrice”: target_price,
“stopLossPrice”: stop_loss_price,
“trailingJump”: trailing_jump
}
this is the payload. I haven’t touched client ID. Not sure why the error.
I guess clientId is changed to dhanClienId. How to get notified if there are changes like this so I can do these changes before the market hours.
Hey @Rohit_Tikekar ,
We want to inform you that it was previously mentioned as dhanclientid itself. Any major update in the API is always communicated through our community and documented in the Dhan API docs.