# Feature request: assignable client order ids for bracket sub orders

**URL:** <https://forum.alpaca.markets/t/feature-request-assignable-client-order-ids-for-bracket-sub-orders/11405>\
**Category:** Alpaca Trading\
**Created:** [December 21, 2022, 10:50pm UTC](https://forum.alpaca.markets/t/feature-request-assignable-client-order-ids-for-bracket-sub-orders/11405 "2022-12-21T22:50:40Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Homer](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/homer/32/3004_2.png) [@Homer](https://forum.alpaca.markets/u/Homer)\
**Post date:** [December 21, 2022, 10:50pm UTC](https://forum.alpaca.markets/t/feature-request-assignable-client-order-ids-for-bracket-sub-orders/11405/1 "2022-12-21T22:50:40Z")

</div>

id like to be able to provide clientorderid’s for the subsequent orders that get created from a bracket order.

example (yes i know the client id’s are mini in this example)  
order abc has client id abc123  
order abc as a limit sell for gains (i can assign clientid abc123g)  
order abc as a stop loss for losses (i can assign clientid abc123l)

when i look at open orders after the initial position is opened then i can see the two pending sub orders with abc123g and abc123l. also when i get a cancelled and filled notice on the sub orders then it will have my abc123g or abc123l.

right now its alpaca generated sub order ids, i want it to be my clientid’s on the sub orders.

please let me know if you see this request so i dont have to follow up wondering. 🙂

---

<div class="post-metadata">

**Author:** ![mahmoud\_alpaca](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/mahmoud_alpaca/32/4501_2.png) [@mahmoud\_alpaca](https://forum.alpaca.markets/u/mahmoud_alpaca)\
**Post date:** [December 22, 2022, 11:05am UTC](https://forum.alpaca.markets/t/feature-request-assignable-client-order-ids-for-bracket-sub-orders/11405/2 "2022-12-22T11:05:29Z")

</div>

hello there! you [can](https://alpaca.markets/docs/api-references/trading-api/orders/) input your own `client_order_id` when sending an order in the request body.

---

<div class="post-metadata">

**Author:** ![Homer](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/homer/32/3004_2.png) [@Homer](https://forum.alpaca.markets/u/Homer)\
**Post date:** [December 24, 2022, 2:47am UTC](https://forum.alpaca.markets/t/feature-request-assignable-client-order-ids-for-bracket-sub-orders/11405/3 "2022-12-24T02:47:39Z")

</div>

so for a “bracket order” you can enter 3 client ids?  
1 - for the bracket  
2 - for the subsequent win possible order  
3 - for the subsequent loss possible order?

my post is about bracket orders, not simple orders.

---

<div class="post-metadata">

**Author:** ![oleg.rakhmatulin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/oleg.rakhmatulin/32/559_2.png) [@oleg.rakhmatulin](https://forum.alpaca.markets/u/oleg.rakhmatulin)\
**Post date:** [December 24, 2022, 1:37pm UTC](https://forum.alpaca.markets/t/feature-request-assignable-client-order-ids-for-bracket-sub-orders/11405/4 "2022-12-24T13:37:51Z")

</div>

@Homer, you are right - it’s not possible in the current REST API and AFAIU requires support on the server side. I’m unable to verify it now but if take profit and stop loss orders have valid server-assigned order IDs after bracket order placement you can change (assign) the client order IDs for these orders using separate REST calls.

---

<div class="post-metadata">

**Author:** ![Homer](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/homer/32/3004_2.png) [@Homer](https://forum.alpaca.markets/u/Homer)\
**Post date:** [December 24, 2022, 3:22pm UTC](https://forum.alpaca.markets/t/feature-request-assignable-client-order-ids-for-bracket-sub-orders/11405/5 "2022-12-24T15:22:58Z")

</div>

ok. feature request it is then! 🙂 Happy holidays!

---

<div class="post-metadata">

**Author:** ![AlwaysTraining](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/alwaystraining/32/3600_2.png) [@AlwaysTraining](https://forum.alpaca.markets/u/AlwaysTraining)\
**Post date:** [December 25, 2022, 4:05am UTC](https://forum.alpaca.markets/t/feature-request-assignable-client-order-ids-for-bracket-sub-orders/11405/6 "2022-12-25T04:05:12Z")

</div>

I have also wanted to provide a client\_order\_id when calling `close_position`

---

<div class="post-metadata">

**Author:** ![alpacanoob](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/alpacanoob/32/2371_2.png) [@alpacanoob](https://forum.alpaca.markets/u/alpacanoob)\
**Post date:** [January 10, 2023, 7:49pm UTC](https://forum.alpaca.markets/t/feature-request-assignable-client-order-ids-for-bracket-sub-orders/11405/7 "2023-01-10T19:49:57Z")

</div>

I second this request.

What is happening sometimes is after placing an OCO order, the order stream is being received before my OCO order API response. Since we are not able to set the client orderId for the stop\_loss order, it is making it hard to determine what this order is that has come through in the stream.
