Dhan API: DH-905 "Invalid IP"

Dhan returns DH-905 Invalid IP when an order reaches it from an address that isn't your registered primary or secondary static IP. The other common cause is an access token generated before you added the IP. Both are quick to check.

Last updated 13 November 2026 · 1 min read

Check what Dhan sees

Dhan shows the address it detects. In Dhan Web open Profile, Get Trading & Data API, then Sandbox (top right), IP Setup, Get Static IP. You'll see your primary IP, secondary IP and the Detected IP. The detected IP must match one of the other two.

The fixes

  1. Regenerate your access token. Dhan's support page says to re-generate the token once if the IP was added after the token was created.
  2. Send orders from the registered address. If the detected IP is different, your orders are leaving from another connection. Route your Dhan client through the registered IP; the code is on static IP for the Dhan API.
  3. Match IPv4 or IPv6. Dhan's order host is reachable over both. If you registered an IPv4 but your traffic leaves over IPv6 (or the reverse), register the address your connection actually uses: curl -x http://USER:PASS@HOST:PORT https://ifconfig.co
  4. Update the IP if it changed. Home broadband IPs change after router restarts. Dhan lets you change an IP only once in 7 days, so a home IP that keeps changing will keep causing DH-905. A dedicated static IP stops that.

What isn't checked

Only order placement APIs need the registered IP: orders, Super Orders and Forever Orders. Fetching order or trade details works from anywhere. If those calls succeed and orders fail with DH-905, it's the IP, not your token or code.

FAQs

I added my IP but still get DH-905. Why?

Most often the token was generated before the IP was added. Regenerate it. If it persists, compare the Detected IP in Dhan's sandbox with your registered IPs.

Does Dhan accept IPv6?

Yes, Dhan's docs say both IPv4 and IPv6 formats are supported. A dedicated IPv6 at TrueIP is ₹50 a month plus GST.

Sources

Get your dedicated static IP

IPv6 ₹50 a month, IPv4 ₹200 a month, plus GST. Live in minutes, whitelisted once.

Get IPv6 · ₹50/mo + GSTGet IPv4 · ₹200/mo + GST

Keep reading

13 November 2026

Angel One SmartAPI: "static IP is already associated with another app"

SmartAPI won't let you create an app because the static IP is already used. Why Angel One maps one IP to one client, and how to trade two accounts.
13 November 2026

Kite Connect: "IP address is already linked to another account"

Zerodha won't save your static IP because it's linked to another account. Why it happens, family sharing rules, and how to fix it without breaking Zerodha's terms.
13 November 2026

Kotak Neo API: "unauthorized" (100008) and "session ip doesnt match" (1037)

Kotak Neo rejects orders with stCode 100008 "unauthorized" from an unregistered IP, and 1037 when the session came from another IP. What each means and how to fix it.