I’ve been an API consumer since version 1.0 and migrated my integration to v2.0 early this year. However, I didn’t get a chance to work further at that time. Now, when I tried to explore and proceed with the integration again, the order placement API is failing in both Live and Sandbox environments.
Here’s the request payload I am using:
{
"price": 114.45,
"boProfitValue": 0.0,
"boStopLossValue": 0.0,
"dhanClientId": "XXXXXXXX",
"correlationId": "anythingggg",
"transactionType": "BUY",
"exchangeSegment": "NSE_FNO",
"productType": "MARGIN",
"orderType": "LIMIT",
"validity": "DAY",
"securityId": "47761",
"quantity": 2,
"afterMarketOrder": false
}
Response received:
{
"errorType": "Input_Exception",
"errorCode": "DH-905",
"errorMessage": "Missing required fields, bad values for parameters etc."
}
This error message is too generic and doesn’t specify which field is invalid or missing, which makes debugging very difficult. I had already suggested earlier that API error messages should be more descriptive and meaningful, so that developers can quickly identify the exact issue. Unfortunately, this still seems to be a problem.
Feedback / Suggestions
- Clearer Error Responses
I requested last year also please improve error responses to clearly mention which parameter is wrong or missing instead of a broad message likeDH-905. - API Change Log
I could not find any changelog for v2.0 or subsequent updates. Having a documented changelog (similar to DeltaExchange API Changelog) would help developers track and adapt to changes smoothly. - Simplify or Better Document the Order Placement API
Order placement currently feels complex since the payload requirements change by order type. If simplification isn’t possible, please at least provide comprehensive documentation with complete payload examples for all order types (LIMIT, MARKET, BO, CO, etc.).
For example, the LIMIT order request above used to work earlier but now fails without clear guidance.
I hope you’ll consider these points to improve the developer experience with Dhan APIs.
Thanks!
