Introducing: Postbacks for Order Updates on DhanHQ API

Hello all,

APIs as a trading product serves a very niche segment of traders. APIs in the industry were always built for programmers first and not traders, with a complex set of requests for each order. When we launched DhanHQ, we wanted to provide the best platform and an entire ecosystem to Dhan users, so that they have all the tools in their arsenal when it comes to trading, backed by our core infrastructure.

With DhanHQ, we are trying to simplify API based trading for individual systematic traders and platforms. One of the major challenges with API trading is the number of GET requests which need to be handled to know about status of orders, to get real time updates when trading via APIs.

As we try to simplify API trading, we wanted to offer a simple solution for all order updates to your system, without the need for having to manage scenarios of GET requests. We explored various solutions for this, and finally leveraged postbacks.

Introducing Postbacks for Order Updates on DhanHQ, which will give real time trade notifications as postback messages on your trading system.

With Postback Updates for Orders, you’ll receive real-time messages about your trading orders directly to your own system along with Dhan Platforms. You can stay informed about critical updates on your orders, such as order fills, partial fills, or order rejections, all in real-time. This saves hassle of configuring GET requests and less chances of breaching rate limits.

You can set up a Postback URL while generating your Access token itself. To know more about the specifications, you can read them here: Postback - DhanHQ Ver 1.0 / API Document

At Dhan, we are at the forefront of technology, and Postback Updates for Orders is just one more way we’re pushing the boundaries of what’s possible in the world of trading.

This is a must add to anyone who uses their own trading system to trade, so do try it and let us know your feedback.

Happy Trading!

– Hardik



Thank you for adding postbacks.

I have a doubt here, if the same user logs in 10 3rd party apps using dhan.
Will order updates be sent to all the 10 postback urls ?

Hello @subhash

Welcome to Dhan Community!

Great to know that you are exploring postback updates. Order updates on postback are on an access token level. So when you generate any access token, you have the option to configure Postback URL as per the platform/system (you can also use same URL for multiple access tokens).

Now, whenever the order is placed via API, the postback order update will only be sent to the postback URL associated with that access token.

This means if a user has 10 different apps with postback URL set, then only the app from where order is sent will receive the update.

How to setup postbacks programatically please advise an example would help.

any update please Hardik.

Hello @saisaigraph

Postbacks require you to configure an address where server can send messages regarding order updates. So before configuring anything on python, you will need to create a server with a domain, where data can be sent. From here, you can use this data to know about the order updates.

There is no such direct Python code example that I can help you with, but you can use Python libraries like Flask to create this easily.

any video tutorial available please. if not could you make one please.

Will http postback work or only https?


You can add either and it should work.