Frequent Margin Calculator API Errors (DH-905) – Blocking Integration

Hi Team,

We’ve been experiencing frequent issues with the Margin Calculator API (/v2/margincalculator), specifically repeated DH-905 errors with very generic messaging.

We want to highlight that we have invested significant time and effort building systems around Dhan’s APIs, including integrating margin checks into our trading workflows. However, the current error handling makes it extremely difficult to debug and maintain reliability.

The error:
DH-905: Missing required fields, bad values for parameters etc.

This message is too generic and does not provide any actionable insight into what exactly is wrong in the request. Without field-level validation details, it becomes a trial-and-error process, which is not practical for production systems.

We request the following:

  1. More detailed, field-level validation errors (e.g., which parameter is missing or invalid)

  2. Confirmation that the API strictly adheres to the documented schema

  3. Stable and predictable behavior for margin calculation responses

If these issues persist, it becomes very difficult for us to continue relying on the API, and we may have to consider moving away despite the effort already invested.

We hope you understand the seriousness of this from a developer and system reliability standpoint, and we look forward to improvements.

Thanks.

1 Like

I’m pretty sure that this API was working with the same set of inputs, and now it is giving a generic error for the same input values. @Hardik

Hello @Amri @Srinadha_Reddy1

Can you share the request and response of the APIs on apihelp@dhan.co. We will look into all such instances at once and ensure you do not face any such issues.

It’s happening when the market is closed. I understand if the system is designed that way, but the response should at least include a clear message indicating this. All we need is a developer-friendly API that’s easy to consume.