# Notification (Trade)

`WS` `push · cmd 18`

Order/execution push on the `private` topic. The Notification wrapper carries a JSON payload (event `order_changed_lb`; grid orders use `gridtrading_order`).

```protobuf
message Notification {
  string topic = 1;
  ContentType content_type = 2;
  DispatchType dispatch_type = 3;
  bytes data = 4;
}

enum ContentType { CONTENT_UNDEFINED = 0; CONTENT_JSON = 1; CONTENT_PROTO = 2; }
```

## Push Fields

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `topic` | string | No | Topic |
| `content_type` | int32 | No | Content type (JSON/PROTO) |
| `dispatch_type` | int32 | No | Dispatch type |
| `data` | bytes | No | Payload data (order-changed) |
| `└ side` | string | No | Order side (Buy/Sell) |
| `└ stock_name` | string | No | Stock name |
| `└ submitted_quantity` | string | No | Submitted quantity |
| `└ symbol` | string | No | Order symbol |
| `└ order_type` | string | No | Order type |
| `└ submitted_price` | string | No | Submitted price |
| `└ executed_quantity` | string | No | Executed quantity |
| `└ executed_price` | string | No | Executed price |
| `└ order_id` | string | No | Order id |
| `└ currency` | string | No | Currency |
| `└ status` | string | No | Order status |
| `└ submitted_at` | string | No | Submitted time (timestamp, second) |
| `└ updated_at` | string | No | Last updated time |
| `└ trigger_price` | string | No | LIT / MIT order trigger price |
| `└ msg` | string | No | Rejected message or remark |
| `└ tag` | string | No | Order tag (Normal/GTC/Grey) |
| `└ trigger_status` | string | No | Conditional order trigger status |
| `└ trigger_at` | string | No | Conditional order trigger time (timestamp, second) |
| `└ trailing_amount` | string | No | TSLPAMT order trailing amount |
| `└ trailing_percent` | string | No | TSLPPCT order trailing percent |
| `└ limit_offset` | string | No | TSLPAMT / TSLPPCT order limit offset amount |
| `└ account_no` | string | No | Account no |
| `└ remark` | string | No | Remark message |
| `└ last_share` | string | No | Last share |
| `└ last_price` | string | No | Last price |
| `└ multi_leg` | object | No | Multi-leg strategy information, only pushed for multi-leg option combination orders |
| ` └ strategy` | string | No | Multi-leg strategy |
| ` └ strategy_name` | string | No | Strategy name |
| ` └ multileg_id` | string | No | Multi-leg combination ID |
| ` └ code` | string | No | Multi-leg combination code |
| ` └ legs` | object[] | No | Legs of the combination order |
| `  └ symbol` | string | No | Option symbol, use ticker.region format |
| `  └ side` | string | No | Order side (Buy/Sell) |
| `  └ position` | string | No | Position direction (LONG/SHORT) |
| `  └ ratio_quantity` | string | No | Leg ratio quantity |
| `  └ strike_price` | string | No | Strike price |
| `  └ expire_date` | string | No | Option expiry date, format YYYYMMDD |
| `  └ contract_direction` | string | No | Contract type (C=Call/P=Put) |

## Response JSON Example

```json
{
  "event": "order_changed_lb",
  "data": {
    "side": "Buy",
    "stock_name": "Tencent Holdings Ltd.",
    "submitted_quantity": "1000",
    "symbol": "700.HK",
    "order_type": "LO",
    "submitted_price": "213.2",
    "executed_quantity": "1000",
    "executed_price": "213.2",
    "order_id": "27",
    "currency": "HKD",
    "status": "NewStatus",
    "submitted_at": "1562761893",
    "updated_at": "1562761893"
  }
}
```
