DHAN sandbox API Issues and Reset Feature

**DhanHQ Sandbox: no way to reset the account after an error (blocked by “MTM is at 70 Percent”). Is there a reset?
**
Hi everyone,

I am building an application on top of the DhanHQ API and use the Sandbox to validate each API call and workflow before connecting to production. That is what a sandbox is for: trying out the calls and functions, including the error cases, so the application is proven before it touches a real account.

The problem

While testing the exit logic, a few repeated MARKET SELL orders went out for one stock while the Sandbox position list was still showing the old position. The position list had not yet updated, so each exit looked like it was needed. All the sells traded at the sandbox price and the account ended up with a large short position (several hundred shares). Now:

  • Funds show a negative available balance (about -12% of the starting funds below zero).
  • Every new order, including the BUY orders to cover the short, is rejected with “RMS: MTM is at 70 Percent. New Trades are not permitted now”.
  • It did not change the next trading day, so there is no daily reset or recomputation.
  • About a dozen older test orders are stuck in TRANSIT, some for 10 days, including after market open. They cannot be cancelled (DH-906 “Order is in Transit state”) and keep holding margin.

The sandbox account is blocked, and I cannot continue testing.

What I could not find

  • No reset button in the developer area, and no reset call in the Sandbox’s API list (I checked its OpenAPI spec).
  • Nothing in the support articles about resetting a sandbox account.

Why a reset matters

A sandbox exists so mistakes happen there instead of in production. If one mistake can lock the account for good, the developer cannot recover, repeat the test, or start over. A self-service reset (a button in the portal and/or an endpoint) that returns the account to its starting state would fix this. A daily automatic reset would also clear stuck orders and positions.

Questions

  1. Is there a way to reset the Sandbox account that I missed?
  2. If not, has anyone had it reset by support, and how long did it take?
  3. Would others like a self-service reset too? If you do, a reply here helps show the demand.

Other Sandbox behaviours I saw (in case they help others)

  • Orders can stay in TRANSIT indefinitely.

  • The positions list can lag behind executed orders and catch up later. Check the order book before sending an exit twice.

  • The margin calculator often times out. The trade-history call (/trades/{from-date}/{to-date}/{page-number}) answered DH-905 for valid dates. The EDIS T-PIN call answered HTTP 500.

  • Order calls often return DH-904 (rate limit) at a pace far below the documented 10 requests per second.

    Thanks

DhanHQ Sandbox: prices do not match the live market (circuit-limit rejections for normal limit orders, MARKET orders fill at 100.00)

Hi everyone,

I am testing order placement in the Sandbox (the v2 sandbox API) with prices from the live market. Limit orders at the current market price are rejected because the Sandbox seems to use a different reference price for each stock. Has anyone else seen this, and is there a way to get the sandbox prices in line with the market?

What I see (today, 23 Oct 2026, during market hours)

  1. HDFCBANK, BUY LIMIT 72 at 691.25 (the live price at that moment was about 691), product INTRADAY, validity DAY. Rejected, order status REJECTED: Order Price needs to be Circuit Limits of 843.30 to 1030.60 The same happened for a second order at 691.30.

  2. CDSL, SELL LIMIT 84 at 1,198.3 (live price about 1,186). Rejected: Order Price needs to be Circuit Limits of 1275.80 to 1559.20

  3. A MARKET BUY for CDSL, 84 shares, was accepted and shows TRADED with an average traded price of 100.00. That is far outside the same stock’s circuit limits above, and far from its live price. The same 100.00 appeared for HDFCBANK market orders in my earlier tests.

So the Sandbox appears to use one reference price for the circuit band (about the middle of 1275.80 to 1559.20 for CDSL, 843.30 to 1030.60 for HDFCBANK, which does not match today’s live prices of about 1,186 and 691) and another, a flat 100.00, for MARKET fills.

Why it matters

  • A limit or stop-limit order at the real market price can never pass the Sandbox, so the normal workflow (place at the current price, then a target and a stop-loss around it) cannot be tested.
  • Target (LIMIT) orders of a bracket get rejected for the same reason, while the stop-loss (STOP_LOSS_MARKET) is accepted, so a trade is left half protected.
  • Orders have to be placed at prices that make no sense for the stock just to get through.

Questions

  1. Is the Sandbox’s price data meant to follow the live market, or is it a fixed or old snapshot? If it is a snapshot, which date or prices does it use?
  2. Is there a way to see the reference price or circuit band the Sandbox uses for an instrument (a quote or market-data call that works in the Sandbox)?
  3. Has anyone found a workaround, such as using only MARKET orders or placing orders only inside the band?

Details of what I send: product INTRADAY, validity DAY, exchange segment NSE_EQ, prices rounded to the instrument’s tick size. The rejections come back in omsErrorDescription with status REJECTED.

Other Sandbox behaviours I saw (in case they help others)

  • A positions call can return an empty list for several minutes after an order has TRADED. I now build the open position from the day’s executed orders.
  • A stop-loss order can sit in TRANSIT for a long time right after it is placed.

Thanks!

Hi @Nishant_Rathee ,

Following discussion over the call with our executive, this has been addressed. For any other queries, please write to us at apihelp@dhan.co for further assistance.