# Tracing a rebalancing

## Prerequisites

- **Authentication scopes** — `portfolios:admin`
For more information, refer to [Authentication scopes](/products/byol/concepts/api_concepts/authentication/authentication_oauth#list-of-authentication-scopes).
- **Webhook handler ready** — Set up a webhook endpoint to listen for rebalancing execution events.
  - Subscribe to [`REBALANCING_EXECUTION_ORDER.*` and `ORDER.*`](/products/byol/guides/portfolios/rebalancing/rebalancing_webhooks) events.
For more information, refer to [Implementing webhooks](/products/byol/getting_started/implementing_webhooks).


**Recommended: Track rebalancing progress with webhooks**

Monitor rebalancing execution via webhook events in real-time. Subscribe to rebalancing execution order events and underlying order events to receive automatic notifications as the rebalancing process unfolds.

For more information, refer to [Rebalancing webhook events](/products/byol/guides/portfolios/rebalancing/rebalancing_webhooks)

This section describes how you can track the progress of a rebalancing process.

As described above, you receive update webhook events for each account when new orders are added within a rebalancing process. The depicted flow focuses on the specifics of a portfolio order that triggers a rebalancing.

For more general details on the individual steps of a portfolio order, refer to the ['Understanding portfolio orders'](/products/byol/guides/portfolios/understanding_portfolio_orders) guide.

Rebalancing_execution_order.NEW
Portfolio_order.NEW
Portfolio_order.PROCESSING & Rebalancing_execution_order.PROCESSING
- a) `Individual_order.PROCESSING`
- b) `Individual_order.FILLED`
- c) Step a & b repeat until all `individual_orders` of the batch are in the `FILLED` state.


Portfolio_order.FILLED
Rebalancing_execution_order.FILLED
Webhooks notify you of events in business processes, not the success or failure of the initialisation of those processes.

Please be sure to check the [HTTP status](/api_errors/) of the response to your requests and handle failure cases appropriately.

In addition, a portfolio order of type `REBALANCING` contains the `rebalancing_execution_id` in the client reference to enable simple allocation.

As described in the [‘Tracking portfolio orders’ guide](/products/byol/guides/portfolios/tracking_orders), each individual order carries the `portfolio_order_id` in its client reference field. In this way, there is a chain of references at the various levels of the process.

The execution of the rebalancing is referenced in the portfolio order, the portfolio order is referenced in the individual orders.