getOrders() and getOrder(order_id) are entirely different API calls. getOrders() is used to get whole order book of the day. getOrder(order_id) is used to get details of life cycle of an order in our system like(open pending, open, modify pending etc).
This is the reason you will not be able to see parent orderid in getOrders(order_id) API call.
Was first leg executed for this bracket order? Can you private message your client id ?
Yes the parent order was executed, that is why we have this order.
When doing complete orders query, I get proper parent id (below is the extract from full orders query)
{"exchange_order_id": "1100000000544352", "disclosed_quantity": 1, "market_protection": 0, "tradingsymbol": "HDFCBANK", "tag": "OHOLBASK", "order_type": "SL-M", "trigger_price": 1201.55, "instrument_token": 341249, "status_message": null, "status": "TRIGGER PENDING", "product": "BO", "exchange": "NSE", "order_id": "161122000056833", "price": 0.0, "pending_quantity": 1, "validity": "DAY", "placed_by": "RG0229", "order_timestamp": "2016-11-22 09:51:30", "parent_order_id": "161122000024864", "exchange_timestamp": "2016-11-22 09:51:30", "average_price": 0.0, "variety": "bo", "transaction_type": "BUY", "filled_quantity": 0, "quantity": 1}
But, when i do individual orders query, parent_order_id is not shown.(below is the response on indivdual query)
{"status": "success", "data": [{"status": "TRIGGER PENDING", "product": "BO", "pending_quantity": 1, "order_type": "SL-M", "exchange": "NSE", "order_id": "161122000056833", "price": 0.0, "exchange_order_id": "1100000000544352", "order_timestamp": "2016-11-22 09:51:30", "transaction_type": "BUY", "trigger_price": 1201.55, "validity": "DAY", "disclosed_quantity": 1, "status_message": null, "average_price": 0.0, "quantity": 1}, {"status": "MODIFIED", "product": "BO", "pending_quantity": 1, "order_type": "SL-M", "exchange": "NSE", "order_id": "161122000056833", "price": 0.0, "exchange_order_id": "1100000000544352", "order_timestamp": "2016-11-22 09:51:30", "transaction_type": "BUY", "trigger_price": 1208.75, "validity": "DAY", "disclosed_quantity": 1, "status_message": null, "average_price": 0.0, "quantity": 1}, {"status": "MODIFY PENDING", "product": "BO", "pending_quantity": 1, "order_type": "SL-M", "exchange": "NSE", "order_id": "161122000056833", "price": 0.0, "exchange_order_id": "1100000000544352", "order_timestamp": "2016-11-22 09:51:30", "transaction_type": "BUY", "trigger_price": 1208.75, "validity": "DAY", "disclosed_quantity": 1, "status_message": null, "average_price": 0.0, "quantity": 1}, {"status": "MODIFY VALIDATION PENDING", "product": "BO", "pending_quantity": 1, "order_type": "SL-M", "exchange": "NSE", "order_id": "161122000056833", "price": 0.0, "exchange_order_id": "1100000000544352", "order_timestamp": "2016-11-22 09:51:30", "transaction_type": "BUY", "trigger_price": 1208.75, "validity": "DAY", "disclosed_quantity": 1, "status_message": null, "average_price": 0.0, "quantity": 1}, {"status": "TRIGGER PENDING", "product": "BO", "pending_quantity": 1, "order_type": "SL-M", "exchange": "NSE", "order_id": "161122000056833", "price": 0.0, "exchange_order_id": "1100000000544352", "order_timestamp": "2016-11-22 09:35:21", "transaction_type": "BUY", "trigger_price": 1208.75, "validity": "DAY", "disclosed_quantity": 1, "status_message": null, "average_price": 0.0, "quantity": 1}, {"status": "OPEN PENDING", "product": "BO", "pending_quantity": 1, "order_type": "SL-M", "exchange": "NSE", "order_id": "161122000056833", "price": 0.0, "exchange_order_id": null, "order_timestamp": "2016-11-22 09:35:21", "transaction_type": "BUY", "trigger_price": 1208.75, "validity": "DAY", "disclosed_quantity": 1, "status_message": null, "average_price": 0.0, "quantity": 1}, {"status": "VALIDATION PENDING", "product": "BO", "pending_quantity": 1, "order_type": "SL-M", "exchange": "NSE", "order_id": "161122000056833", "price": 0.0, "exchange_order_id": null, "order_timestamp": "2016-11-22 09:35:21", "transaction_type": "BUY", "trigger_price": 1208.75, "validity": "DAY", "disclosed_quantity": 1, "status_message": null, "average_price": 0.0, "quantity": 1}, {"status": "PUT ORDER REQ RECEIVED", "product": "BO", "pending_quantity": 0, "order_type": "SL-M", "exchange": "NSE", "order_id": "161122000056833", "price": 0.0, "exchange_order_id": null, "order_timestamp": "2016-11-22 09:35:21", "transaction_type": "BUY", "trigger_price": 1208.75, "validity": "DAY", "disclosed_quantity": 1, "status_message": null, "average_price": 0.0, "quantity": 1}]}
getOrders() and getOrder(order_id) are entirely different API calls.
getOrders() is used to get whole order book of the day.
getOrder(order_id) is used to get details of life cycle of an order in our system like(open pending, open, modify pending etc).
This is the reason you will not be able to see parent orderid in getOrders(order_id) API call.
https://kite.trade/docs/connect/v1/#retrieving-an-individual-order
It shows that parent_order_id will also be returned.
However, I think from trading perspective, it should return parent_order_id as well when querying for individual order.
Please check with Kailash also, I remember, the parent_order_id was coming sometime back in individual orders as well.