Review and share the correct json for Tradingview pinescript alert

@Dhan @Prithvi Tell me, which one is the correct jason

  1. this one

{
“api_key”:“YOUR_DHAN_TRADING_API_KEY”,
“clientId”:“YOUR_DHAN_CLIENT_ID”,
“symbol”:“BANKNIFTY”,
“exchange”:“NSE”,
“segment”:“OPTION”,
“optionType”:“CE”,
“strikePrice”:“44000”,
“expiryDate”:“2026-07-28”,
“transactionType”:“BUY”,
“orderType”:“MARKET”,
“quantity”:“30”,
“productType”:“INTRADAY”
}

  1. this ?

{
“symbol”:“BANKNIFTY”,
“exchange”:“NSE”,
“segment”:“OPTION”,
“optionType”:“CE”,
“strikePrice”:“44000”,
“expiryDate”:“2026-07-28”,
“transactionType”:“BUY”,
“orderType”:“MARKET”,
“quantity”:“30”,
“productType”:“INTRADAY”
}

are these statement correct ? I got this from copilot.

  1. “Dhan’s webhook connector does not expect raw API‑style JSON with api_key and clientId inside the payload.”

  2. :cross_mark: Including "api_key" and "clientId" inside the JSON body is unnecessary and will likely be ignored or rejected, because Dhan already knows your credentials from the webhook configuration.

What I am looking for is, the pine script should generate the json paylod and send it to dhan without me manually creating and adding in the alert message.

@Dhan @Prithvi @PravinJ Can you please respond to my query and share the correct json to use in pine script.