Webhook
During the app registration process, users have the option to specify an open POST API as their webhook URL. On configuring the postback URL, order updates will be instantaneously transmitted to this address.
As part of the webhook flow, users can receive both:
- Order Updates
- GTT Order Updates
When registering an app, users can choose what type of updates they wish to receive. By default, order updates are enabled. To receive GTT order updates, users must explicitly enable this by editing their app’s configuration from the My Apps page.
The webhook endpoint:
- Should not require authentication.
- Should respond with a 2XX status.
- Must be open to receive POST requests.
The payloads sent to the webhook URL will be identical to the updates received via WebSocket.
Response structure:
- Order
- GTT Order
{
"update_type": "order",
"user_id": "******",
"userId": "******",
"exchange": "NSE",
"instrument_token": "NSE_EQ|INE848E01016",
"instrument_key": "NSE_EQ|INE848E01016",
"trading_symbol": "NHPC-EQ",
"tradingsymbol": "NHPC-EQ",
"product": "D",
"order_type": "MARKET",
"average_price": 0,
"price": 0,
"trigger_price": 0,
"quantity": 1,
"disclosed_quantity": 0,
"pending_quantity": 1,
"transaction_type": "BUY",
"order_ref_id": "57744821658411",
"exchange_order_id": "",
"parent_order_id": null,
"validity": "DAY",
"status": "put order req received",
"is_amo": false,
"variety": "SIMPLE",
"tag": null,
"exchange_timestamp": null,
"status_message": "",
"order_id": "240221025997024",
"order_request_id": "1",
"order_timestamp": "2024-02-21 14:40:02",
"filled_quantity": 0,
"guid": null,
"placed_by": "******",
"status_message_raw": null
}
The lowercase field (tradingsymbol
) is deprecated and will be removed in future versions. Use the snake_case versions for consistency.
{
"update_type": "gtt_order",
"type": "MULTIPLE",
"exchange": "NSE_EQ",
"instrument_token": "NSE_EQ|INE806A01020",
"quantity": 1,
"product": "D",
"gtt_order_id": "GTT-CU25270200024002",
"expires_at": 1772216999000000,
"created_at": 1740641185000000,
"rules": [
{
"strategy": "ENTRY",
"status": "FAILED",
"trigger_type": "IMMEDIATE",
"trigger_price": 7.7,
"transaction_type": "BUY",
"message": "The price set should be within the circuit limits. Please modify your order price.",
"order_id": "250228010168535"
},
{
"strategy": "STOPLOSS",
"status": "CANCELLED",
"trigger_type": "IMMEDIATE",
"trigger_price": 7.6,
"transaction_type": "SELL",
"message": "",
"order_id": null
},
{
"strategy": "TARGET",
"status": "CANCELLED",
"trigger_type": "IMMEDIATE",
"trigger_price": 7.64,
"transaction_type": "SELL",
"message": "",
"order_id": null
}
]
}
- While creating app provide a webhook URL which is in your control rather than a public endpoint.