# Introduction

The `ACCOUNT` WebSocket channel sends events about your account, such as the changes of state of your take profit / stop loss orders (TP/SLs).

One subscription covers your main account and every subaccount. Each message carries the `account_id` it belongs to.

:::info[Note]
You must [authenticate](https://docs.onetrading.com/websocket/authenticate.md) before subscribing.
:::

## Subscribe

```json
{
    "type": "SUBSCRIBE",
    "channels": [
        {
            "name": "ACCOUNT"
        }
    ]
}
```

## Subscription Confirmation

```json
{
    "type": "SUBSCRIPTIONS",
    "channels": [
        {
            "name": "ACCOUNT",
            "account_id": "726288e6-a463-4f88-9068-024ae8f97a34"
        }
    ],
    "time": 1763288100299000000
}
```

The channel sends no snapshot, and messages are not replayed after a reconnect.

## Message format

Every message on the channel carries these fields:

| Field | Type | Description |
|---|---|---|
| `channel_name` | string | `ACCOUNT`. |
| `type` | string | The kind of event: see [Message types](#message-types). The rest of the message depends on it. |
| `time` | string | When the message was sent, as an ISO 8601 string. |
| `account_id` | string | The account the event belongs to: your main account, or one of its subaccounts. |

## Message types

| `type` | Sent when |
|---|---|
| `EXOTIC_ORDER` | A take profit / stop loss (TP/SL) was created, armed, changed, triggered, executed or cancelled. |

More types may be added: ignore a `type` you do not recognise.

## Take profit / stop loss (`EXOTIC_ORDER`)

A TP/SL is held in a separate service, not on the exchange itself, so it does not appear on the [TRADING](https://docs.onetrading.com/websocket/trading/introduction.md) channel. When one of its levels is reached, the close orders it places are ordinary orders: they and their trades are reported on that channel.

An `EXOTIC_ORDER` message adds the event and the TP/SL to the common fields:

```json
{
    "channel_name": "ACCOUNT",
    "type": "EXOTIC_ORDER",
    "time": "2026-11-16T10:15:02.512Z",
    "account_id": "726288e6-a463-4f88-9068-024ae8f97a34",
    "event_type": "EXOTIC_ORDER_ACTIVATED",
    "event_timestamp": "2026-11-16T10:15:02.000Z",
    "data": {
        "version": 2,
        "client_id": "0d0b1f0c-7f0e-4f55-9a53-6f6f3c1c2a10",
        "status": "ACTIVE",
        "…": "…"
    }
}
```

| Field | Type | Description |
|---|---|---|
| `event_type` | string | What happened to the TP/SL: see the table below. |
| `event_timestamp` | string | When it happened (ISO 8601). Use it to put messages in order. |
| `message_id` | string | `EXOTIC_ORDER_TRIGGERED` only. That message can be delivered more than once with the same `message_id`: deduplicate on it. |
| `data` | object | The TP/SL, in the shape of its `event_type`. Always carries `"version": 2`. |

| `event_type` | Sent when |
|---|---|
| [`EXOTIC_ORDER_REGISTERED`](https://docs.onetrading.com/exotic-order-registered-374348m0.md) | A TP/SL was created |
| [`EXOTIC_ORDER_UPDATED`](https://docs.onetrading.com/exotic-order-updated-374349m0.md) | Its levels were changed |
| [`EXOTIC_ORDER_ACTIVATED`](https://docs.onetrading.com/exotic-order-activated-374350m0.md) | It became `ACTIVE`: its levels are being watched |
| [`EXOTIC_ORDER_TRIGGERED`](https://docs.onetrading.com/exotic-order-triggered-374351m0.md) | A level was reached and its close is about to be placed |
| [`EXOTIC_ORDER_EXECUTED`](https://docs.onetrading.com/exotic-order-executed-374352m0.md) | Its close finished |
| [`EXOTIC_ORDER_CANCELLED`](https://docs.onetrading.com/exotic-order-cancelled-374353m0.md) | It ended without completing a close, with the reason |

To read the current state, for example after a reconnect, use [Get Exotic Orders (TP/SL)](https://docs.onetrading.com/get-exotic-orders-tpsl-4589055e0.md).

### Lifecycle

```
PENDING ──→ ACTIVE ──→ TRIGGERED ──→ COMPLETE
  │           │           │
  └───────────┴───────────┴──────────→ CANCELLED
```

| Transition | Message |
|---|---|
| Created | `EXOTIC_ORDER_REGISTERED` |
| `PENDING` → `ACTIVE`, or straight away for a position TP/SL created on an open position | `EXOTIC_ORDER_ACTIVATED` |
| Levels changed | `EXOTIC_ORDER_UPDATED` |
| `ACTIVE` → `TRIGGERED` | `EXOTIC_ORDER_TRIGGERED` |
| `TRIGGERED` → `COMPLETE` | `EXOTIC_ORDER_EXECUTED` |
| Any → `CANCELLED` | `EXOTIC_ORDER_CANCELLED` |

`data.status` is the TP/SL's status after the event. Levels are sent as numbers (`take_profit_price`, `trigger_price`); amounts are decimal strings.
