Added

New "group_id" and "group_role" fields on orders

Broker API

Adds two optional fields to the Order and OrderLeg schemas so multi-leg orders can be correlated, including on the trade events stream where legs arrive one at a time with legs: null.

  • group_id: an opaque UUID shared by every order in one bracket, oto, or oco order, including legs and replacements.
  • group_role: a new OrderGroupRole enum with values entry, take_profit, and stop_loss. For oco, the top-level order is take_profit.
  • Both keys are omitted for orders that are not part of a bracket, oto, or oco order.
  • New examples cover a bracket order response and a bracket-leg trade update event.

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
  • POST /v1/trading/accounts/{account_id}/orders/estimation
  • DELETE /v1/trading/accounts/{account_id}/positions
  • DELETE /v1/trading/accounts/{account_id}/positions/{symbol_or_asset_id}
  • GET /v1/rebalancing/runs
  • GET /v1/rebalancing/runs/{run_id}
  • GET /v2/events/trades