Order placement thru trading view webhook is not working

Hi,
I have used webhook to place orders from my trading view premium account based on a strategy developed in pine script.
I get alerts during Buy/Sell signal but i don’t see orders getting placed in my Dhan trading account.
I tried using curl command to place the order and check the response code as suggested here: About webhooks — TradingView
and all i get is 500 server error.
Request you to help me resolve this issue at the earliest.

Thanks,
Ragha

1 Like

Hello @Ragha

Welcome to Dhan Community. To get an understanding of setting up webhooks, you can refer to the video here : How to Use and Setup Webhook Alerts? - TradingView Webhook Alerts | Dhan - YouTube

In this case, price alert needs to be generated through your strategy to be able to place orders on Dhan. You can always reach out to us at help@dhan.co if you face any such difficulties.

Thanks Hardik for responding.
In response to the notification email that i received, I have shared detailed steps that i have tried via curl/python code to look at the actual response from the server . Let me know if you need more details.

-Ragha

I am having the same issue and the getting same error. Support is unable to find out the reason

curl -H ‘Content-Type: application/json; charset=utf-8’ -d ‘{“secret”:“XXXXX”,“alertType”:“multi_leg_order”,“order_legs”:[{“transactionType”:“B”,“orderType”:“MKT”,“quantity”:“1”,“exchange”:“NSE”,“symbol”:“NSE:NIFTY”,“instrument”:“OPT”,“productType”:“I”,“sort_order”:“1”,“price”:“0”,“option_type”:“PE”,“strike_price”:“19400”,“expiry_date”:“2023-08-17”}]}’ -X POST https://tv-webhook.dhan.co/tv/alert/dd838d5a1db14f72b5399bd2dada32d2/XXXXX

{“timestamp”:“2023-08-11T11:24:29.527+00:00”,“status”:500,“error”:“Internal Server Error”,“path”:“/tv/alert/dd838d5a1db14f72b5399bd2dada32d2/XXXXXX”}%

curl -H ‘Content-Type: application/json; charset=utf-8’ -d ‘{“secret”:“XXXXX”,“alertType”:“multi_leg_order”,“order_legs”:[{“transactionType”:“B”,“orderType”:“MKT”,“quantity”:“1”,“exchange”:“NSE”,“symbol”:“NIFTY”,“instrument”:“OPT”,“productType”:“I”,“sort_order”:“1”,“price”:“0”,“option_type”:“CE”,“strike_price”:“19400.0”,“expiry_date”:“2023-08-17”}]}’ -X POST https://tv-webhook.dhan.co/tv/alert/dd838d5a1db14f72b5399bd2dada32d2/XXXXX

{“timestamp”:“2023-08-11T11:27:40.969+00:00”,“status”:500,“error”:“Internal Server Error”,“path”:“/tv/alert/dd838d5a1db14f72b5399bd2dada32d2/XXXXX”}%