multiple order while placing bracket order

I’m using Fyers API v3 to automate equity trades and recently observed that when I place a bracket order (e.g., for the buy side), it gets split into multiple smaller orders. Although the main buy leg has a single order ID, the stop-loss and target legs are assigned separate order IDs. Fyers charges brokerage based on each unique order ID, which leads to higher costs.

Additionally, I need to modify the stop-loss and target orders dynamically at runtime. How can I retrieve their respective order IDs for this purpose? Also, why do these legs have different order IDs when they were all part of a single bracket order?

Lastly, if I place three separate orders—one for entry (buy) and two for exit (stop-loss and target)—would this approach behave any differently in terms of order IDs and brokerage charges?

For example, if I place a bracket order to buy 1000 quantity of stock X, the order sometimes gets split into 10 smaller buy trades with varying quantities that total 1000. In this case, I receive only one order ID for the main buy order, but unexpectedly, I end up with 10 different stop-loss order IDs and 10 different target order IDs—instead of just one stop-loss and one target, as initially expected. This results in a total of 21 order IDs instead of the expected 3, which also increases brokerage charges since Fyers charges per order ID.

This is the main issue with flyers. Every time I trade, I get charged around 150 rupees for brokerage for single order(for a 5lakh order value). I can confirm that Dhan changes flat 20 rs. I am switching my broker to Dhan, and you should too.

Hi @114504570747008532661,

This is how BO and CO work. These orders are executed based on the available price.

For example, if you place a buy order for 10 qty with a target and stop loss of 5 points, each time a part of your order gets executed, a separate target and stop loss order is created for that portion. That’s why each execution has a different order ID, and brokerage is charged for each unique order ID. We have noted your concern and will work on a better way to address it.

On the other hand, for normal single or multiple orders (without BO/CO), there’s no need to create target or stop loss orders. So, the order doesn’t split, and brokerage is charged as one execution.

Also i want to modify those chunk sl / target orders at runtime , so how would i link my original target ids to their sibling order id , i can get all orders ( open / executed/ cancelled ) but how would i group them as part of single entity