# Liquidating positions of an account

## Prerequisites

- **Authentication scopes** — `account_liquidations:admin`
For more information, refer to [Authentication scopes](/products/tol/concepts/api_concepts/authentication/authentication_oauth#list-of-authentication-scopes).


Before initiating account liquidations, ensure you have:

- **Webhook handler ready** — Set up a webhook endpoint to listen for liquidation lifecycle events.
  - Subscribe to [`ACCOUNT_LIQUIDATION.*`](/products/tol/guides/liquidations/liquidations_webhooks) events.
For more information, refer to [Implementing webhooks](/products/tol/getting_started/implementing_webhooks).


You can initiate a liquidation of an account for either a specific user or a business entity using the following:

**POST** [`/accounts/{account_id}/liquidations`](/api/liquidations/create_account_liquidation)

**Example request - user**

```json
{
  "user_id": "7c9dc9d0-8953-42f9-9b5e-f602a6201577"
}
```

**Example request - business**

```json
{
  "business_id": "a9a72268-4f3c-4de2-abb9-a553a3bb7608"
}
```

An `account_liquidation_id` will be returned as a response. You can use this ID to track the progress of the liquidation and assign the resulting individual orders as described below.

For more information, see the ['Orders'](/products/tol/guides/orders/placing_an_order) guide.

## Webhooks

**Recommended: Use webhooks to track liquidation progress**

Set up a webhook listener for `ACCOUNT_LIQUIDATION.*` events to track the liquidation lifecycle from NEW through PROCESSING, FILLED, SETTLED (or CANCELLED). You will receive automatic notifications at each state transition rather than needing to poll for status updates.

For more information, refer to [Account liquidation webhook events](/products/tol/guides/liquidations/liquidations_webhooks)

A webhook is sent for each state transition that the liquidation undergoes in its lifecycle.

**Example webhook**

```json
{
  "id": "56510309-d9de-4730-9b5b-4a0ed047f3a9",
  "created_at": "2021-07-21T14:10:00.00Z",
  "type": "ACCOUNT_LIQUIDATION.NEW",
  "object": {
    "id": "b2f541dc-a27b-4d5a-b970-41812b0892b9",
    "created_at": "2021-07-21T14:10:00.000Z",
    "updated_at": "2021-07-21T14:10:00.000Z",
    "account_id": "debf2026-f2da-4ff0-bb84-92e45babb1e3",
    "user_id": "81dfb00e-9be6-4617-8994-dfd0407f34df",
    "cash_amount": "1000",
    "currency": "EUR",
    "status": "NEW",
    "orders": []
  },
  "webhook_id": "b838bde5-b6df-4f1f-bfc4-71d3fb01d430"
}
```

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.