Dhan API

Dhan trading automation for dry-run-first broker workflows

Dhan trading automation requires more than a token and an order endpoint. A safe implementation needs credential handling, consent readiness, static IP verification, postback configuration, order update handling, dry-run receipts, and a clear rule that live orders require user confirmation.

Dhan automation starts with readiness

Before live trading is considered, the system should confirm that Dhan credentials are present, stored securely, scoped appropriately, and current. It should also verify integration requirements such as static IP configuration and postback URL readiness where applicable.

A readiness check is not only a backend concern. Users need a clear status: connected, dry-run available, live blocked, live ready, or error state. This prevents a command interface from giving the impression that execution is available when the broker setup is incomplete.

Vantaro treats broker readiness as a gating layer. If a credential or integration requirement is missing, the system can still explain the issue and record the event, but live execution should remain unavailable.

Access token vs API key

An API key usually identifies the application or integration, while an access token authorizes account-specific API calls. Both are sensitive. Neither should appear in public frontend code, screenshots, browser logs, analytics events, or support conversations.

A common mistake is treating tokens as setup text that can be copied freely. In a trading workflow, these values can affect account-level actions. Store them server-side, encrypt them, rotate them when needed, and redact them from logs.

Docs pages should explain tokens without encouraging users to paste secrets into chat or issue trackers. Every screenshot placeholder should include a reminder to redact credentials.

  • Never expose tokens in public routes.
  • Never send tokens to analytics.
  • Never include tokens in SEO screenshots.

Consent, static IP, and postback URL

Broker integrations often depend on consent flows, known egress IPs, and callback URLs. These are not administrative details; they are part of live execution safety. If the broker cannot trust the request origin or notify the platform of order state, the workflow is incomplete.

Static IP readiness helps ensure that broker requests come from an expected server environment. Postbacks or order update flows help keep platform state aligned with broker state. Without these controls, users may see stale or incomplete information.

A production implementation should have explicit checks for each prerequisite and clear user-facing copy when a prerequisite blocks live trading.

Dry-run and confirmation flow

A dry-run for a Dhan command should validate the order shape without sending a live order. It should show broker account, action, symbol, quantity, product type, price fields, risk checks, and any blocking errors.

The confirmation step should be tied to that exact payload. If the user changes quantity, symbol, or order type, the old confirmation should no longer be valid. This is especially important for Telegram commands because chat context can move quickly.

The safest user experience is explicit: preview first, confirm second, audit always.

Common Dhan errors and safe handling

Dhan API errors should be documented as operational states. Invalid token, static IP required, unsupported symbol, malformed request, and postback issues each need a different remediation path. A generic error message is not enough for a broker-connected product.

For errors that may affect authentication or order routing, live execution should remain blocked. The product can still provide an explanation, link to the relevant docs page, and record the failed workflow in the audit log.

The user should never be pushed to retry blindly. Retrying a malformed or duplicated trading command can create more risk than the original error.

Evidence and screenshots to add before final publication

Redacted dry-run receipt for broker-connected AI trading
Dry-run receipt showing parsed command, broker readiness, risk checks, and confirmation requirement.
Redacted audit evidence for safe trading workflow
Redacted workflow evidence that avoids exposing broker credentials or account-sensitive details.

FAQ

Can Dhan automation run in dry-run mode?

Yes. Dry-run mode is the preferred first step because it validates command parsing and readiness without placing a live order.

What blocks live Dhan execution?

Expired credentials, missing consent, static IP issues, unsupported symbols, failed risk checks, or missing user confirmation should block live execution.

Does Vantaro guarantee Dhan order execution?

No. Broker APIs, market state, and user confirmation all affect execution. Vantaro provides workflow controls, not guaranteed outcomes.