Dear Dhan Support Team,
I am currently integrating your Order Placement API from my VPS server, but I am consistently receiving the following error:
DH-905 – Invalid IP
I would like to clarify that I have already completed all required setup steps:
• My VPS public IPv4 address is whitelisted in my Dhan account
• The IP verification API confirms:
-
ipMatchStatus: SECONDARY_MATCH (also tested with PRIMARY)
-
ordersAllowed: true
• I am making API calls directly from the same VPS using curl (not Postman or any external tool)
• I have ensured that my system is using IPv4 (disabled IPv6 preference at OS level)
• The same error occurs for both NSE_FNO and NSE_EQ order requests
Despite this, every order placement attempt returns “Invalid IP”.
Request you to please check the following on my account:
-
Whether my account is fully enabled for API-based order placement
-
Whether any additional activation (such as DDPI or API permissions) is required
-
Whether Equity and F&O trading via API is enabled
-
Whether there are any backend restrictions or compliance requirements blocking order execution
-
Whether the IP whitelisting is correctly applied on your side
This appears to be a backend/account configuration issue rather than a request or IP issue, as all validations from my side are correct.
Please assist in resolving this so I can proceed with API-based trading.
Thank you for your support.
Regards,
Sourabh
Dhan Client ID: 1105017113
bhagwatgeetainshort@autotrade:~$ curl https://api.ipify.org
34.93.255.170
bhagwatgeetainshort@autotrade:~$ curl -4 --request POST \
--url https://api.dhan.co/v2/orders \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'access-token: eyJ0eXAiOiJKV1QiL**************aqGtMiQRM8KA' \
--data '{
"dhanClientId": "1105017113",
"correlationId": "test12345",
"transactionType": "BUY",
"exchangeSegment": "NSE_FNO",
"productType": "INTRADAY",
"orderType": "MARKET",
"validity": "DAY",
"securityId": "72255",
"quantity": 65,
"afterMarketOrder": true
}'
{"errorType":"Input_Exception","errorCode":"DH-905","errorMessage":"Invalid IP"}
bhagwatgeetainshort@autotrade:~$ curl https://api.dhan.co/v2/ip/getIP \
--header 'access-token: eyJ0eXAiOiJKV1Qi*****************RM8KA'
{"modifyDatePrimary":"2026-05-01",
"modifyDateSecondary":"2026-05-02",
"primaryIP":"34.47.192.68",
"secondaryIP":"34.93.255.170",
"detectedIP":"34.93.255.170",
"ipMatchStatus":"SECONDARY_MATCH",
"ordersAllowed":true}