Dhan API Integration
Dhan HQ API adapters for fast-moving options desks.
I integrate Dhan HQ API for firms that want modern REST semantics, options workflows, and client-owned deployment without SaaS lock-in.
Platform capabilities
- Multi-broker integration
- TradingView automation
- Client management
- Cloud infrastructure
Integrates with Dhan
Broker overview

Dhan API integration connects your trading platform to Dhan HQ API for authenticated order placement, portfolio reads, and market data suitable for equity and derivatives workflows. Tokens, segment flags, and rate policies must be automated like any Indian broker—this page captures Dhan-specific delivery constraints for planning.
Last reviewed: 2026-11-24. Limits and endpoints change—verify against the broker's official developer documentation before go-live.
Keys and session tokens
Dhan HQ authentication
Dhan developer onboarding issues client credentials used to obtain session tokens after the trader authorizes your application. Store refresh material in per-user vault rows with encryption keys you control.
HQ API documentation evolves quickly—pin the API version in your adapter and subscribe to Dhan developer announcements.
Options-heavy desks should model additional margin preview calls in auth scopes—confirm required grants during discovery.
For VPS deployments, align server clocks with NTP; skewed JWT `exp` claims cause confusing 401 loops.
Client consent screens should list scopes your OMS actually uses—over-scoped apps fail compliance review at prop firms.
HQ API login responses may include segment flags—cache them on the user row so UI feature toggles do not call auth endpoints repeatedly.
November 2026 planning
Dhan throughput expectations
Engineering teams should budget **~5–8 REST requests per second** per active session unless Dhan assigns higher commercial limits.
Options chain endpoints are heavy—cache strikes by underlying with TTL aligned to session length, not infinite.
Bulk order features still need pacing; parallel goroutines per user can trip limits instantly during scrambles.
Separate read and write connection pools so quote traffic does not starve cancels during volatility.
Options scanners that fan out chain requests per underlying need worker pools with global caps—uncapped parallelism is how desks trip limits at 9:16.
Log correlation ids on every order insert so Dhan support tickets include a single id spanning place, modify, and cancel.
Live data
Dhan streaming
Dhan exposes streaming for quotes after session establishment. Map `instrument_id` fields from the master download job.
Reconnect strategies must rebuild subscription manifests from persisted watchlists, not hard-coded arrays in code.
For options, streaming both underlying and active strikes can explode cardinality—prioritize near-the-money strikes per policy.
Fall back to REST snapshots when stream lag exceeds SLA; log incidents for post-trade review.
Streaming both spot and many strikes can saturate NIC on small VPS boxes—right-size network before promising sub-100ms tick-to-screen.
After Dhan deploys API tweaks, reconnect loops may need backoff jitter so all clients do not stampede auth simultaneously.
HQ API coverage
Segments and order types
Dhan supports cash and derivatives segments for entitled accounts. Validate shorting, MTF, and product types against live margin responses.
Options multi-leg strategies need idempotent client order ids so retries do not duplicate legs.
Basket workflows should confirm partial fill handling—some legs may fill while others reject on margin.
Currency and commodity segments depend on account entitlements—feature-flag UI by segment capability returned at login.
Weekly options strategies need explicit exchange routing in payloads—never infer exchange from symbol text alone.
Mark-to-market displays should use the same price source as RMS—mixing socket LTP with delayed REST quotes creates false risk breaches.
Desk awareness
Dhan operational notes
Younger API surfaces mean faster schema changes—automate contract tests on nightly builds.
Options expiry weeks increase reject rates—tighten pre-trade risk checks and display broker reason codes.
Client re-auth flows should be mobile-friendly; many Dhan users operate primarily on phone.
Settlement timing for funds affects next-day buying power—do not infer balances without calling holdings endpoints.
Dhan marketing pushes new API features faster than enterprise change boards—keep a public changelog section in your internal wiki.
Mobile-first users abandon desktop login—embed re-auth flows that deep link back to your PWA after Dhan completes OAuth-style steps.
Redacted illustration
Example payload shape
POST /v2/orders
{
"exchangeSegment": "NSE_FNO",
"transactionType": "BUY",
"quantity": 50,
"orderType": "LIMIT",
"productType": "INTRADAY",
"price": 125.4,
"correlationId": "dhan-***REDACTED***"
}Dhan adapter
Delivery timeline
HQ API integrations often complete in **6–9 weeks** when an OMS framework already exists.
Options phase two often adds **4–6 weeks** for chain caching, Greeks sourcing, and RMS interplay—scope separately from cash-only MVP.
Confirm API access and throughput limits with Dhan before implementation, especially when options screening or higher-volume workflows are in scope.
Engagement
How we deliver Dhan integration
Phase one ships login, orders, positions, and instrument master. Phase two adds options chain UX and advanced order types per your roadmap.
You receive adapter code, monitoring hooks, and explicit mapping tables between Dhan enums and your OMS.
Nightly jobs warm instrument masters and invalidate Redis caches when checksums change—Monday opens should never wait on a cold download.
Runbooks document who rotates API secrets, which VPS owns broker egress, and how to drain strategies before Dhan maintenance windows.
Pen tests focus on token storage and idempotency keys—duplicate cancels must not send two HTTP calls when traders double-tap mobile UI.
Go-live rehearsal includes options expiry week with capped notionals so ops can rehearse margin rejects without client surprises.
Documentation lists every Dhan endpoint your build calls, the owning microservice, and the on-call rotation for adapter incidents.
Weekly office hours during hypercare review reject logs with your desk leads so RMS thresholds stay realistic after the first live fortnight.
Hypercare ends with a signed accept/reject matrix covering every order type you marketed to clients on day one.
Related Modules & Services
8 modules to explore alongside your platform build.
- 01Capabilities
India broker API integrations
Explore this capability and how it can be engineered for your business.
India broker API integrations - 02Capabilities
Broker API Integration
Explore this capability and how it can be engineered for your business.
Broker API Integration - 03Integrations
Multi Broker Algo Trading Platform
Unified multi-broker connectivity and routing for your operations.
Multi Broker Algo Trading Platform - 04Capabilities
Choosing Broker APIs
Explore this capability and how it can be engineered for your business.
Choosing Broker APIs - 05Capabilities
Broker API Guide
Explore this capability and how it can be engineered for your business.
Broker API Guide - 06Capabilities
Broker API Integration
Explore this capability and how it can be engineered for your business.
Broker API Integration - 07Capabilities
Zerodha API Integration
Explore this capability and how it can be engineered for your business.
Zerodha API Integration - 08Capabilities
Order Management Systems
Explore this capability and how it can be engineered for your business.
Order Management Systems
Frequently Asked Questions
5 questions covered before you launch.
Yes, as one adapter among several—normalize order intent at the gateway layer.
This engagement covers server APIs your web/mobile clients call—not store listing or app design unless scoped.
Quarterly or after Dhan changelog emails—update this page’s numbers when limits change.
Support varies by segment and changelog—confirm during discovery with test accounts before promising bracket UX in sales decks.
When unsupported, your OMS can emulate brackets with child orders plus internal triggers, but that is separate engineering scope.
Track token expiry horizon, 429 rates, order reject ratio, and socket gap seconds with alerts tied to IST session hours.
Dashboards should split paper versus live accounts so QA traffic never skews production SLOs.

Ready to scope KC Algo?
KC Algo is a branded software and implementation path for operators who need multi-broker, multi-client trading software—with clear ownership boundaries and no implied brokerage authorization. Operating workflows and deployment responsibilities are shaped around the desk. A technical discussion can clarify platform fit, integrations, and deployment responsibilities for Indian and Forex desks.
Services
- Algo Trading Platforms
- Multi-Broker Integration
- TradingView Automation
- Risk Management Systems
- OMS & RMS Development
- Client Management Portals
Ready to review a platform demo?
Book a walkthrough when you already know your market context, broker connectivity needs, and compliance ownership.
Let's review KC Algo for your desk — software partnership with clear compliance boundaries.
Broker names and logos appear on this page for identification only. Kennedy Chokkalingam integrates with broker APIs as custom engineering work and is not affiliated with, sponsored by, or endorsed by any broker listed here. All trademarks belong to their owners.