Added

New "group_id" and "group_role" fields on orders

Broker API

Adds two optional fields to the Order and OrderLeg schemas so callers can identify which multi-leg order an order belongs to and what part it plays:

  • group_id: an opaque UUID shared by every order in one bracket, oto, or oco order, including legs and replacements.
  • group_role: one of entry, take_profit, or stop_loss, from the new OrderGroupRole enum. For oco orders, the top-level order is take_profit.

Both keys are omitted for orders that are not part of a bracket, oto, or oco order. Trade update events carry the same fields, so clients consuming only the stream can group bracket legs that arrive one at a time with legs set to null. New examples show a bracket order response and a bracket-leg trade update.

Affected Endpoints

  • POST /v1/trading/accounts/{account_id}/orders
  • GET /v1/trading/accounts/{account_id}/orders
  • GET /v1/trading/accounts/{account_id}/orders/{order_id}
  • GET /v1/trading/accounts/{account_id}/orders:by_client_order_id
  • PATCH /v1/trading/accounts/{account_id}/orders/{order_id}
  • DELETE /v1/trading/accounts/{account_id}/orders
  • DELETE /v1/trading/accounts/{account_id}/positions
  • DELETE /v1/trading/accounts/{account_id}/positions/{symbol_or_asset_id}
  • GET /v2/events/trades