import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Journal Events
To enable third-party systems to promptly obtain the results of journal transfers (cash / position), Broker OpenAPI supports an asynchronous event push mechanism for journal transfer–related operations (cash / position).

When the status of a journal transfer operation (cash / position) changes, the system will deliver event notifications, and subscribed clients will receive the final or intermediate execution results.

###  Cash Journal
Cash Journal Event Notification

<Tabs groupId="programming-language">
  <TabItem value="CANCELED" label="CANCELED">

```python
{
    "id": "event_c4b2c210-ce32-41d4-a9a1-cfad4fdf191c",
    "event_type": "JOURNAL",
    "timestamp": "2025-03-29T07:02:33.200962333Z",
    "payload": {
        "from_account": "93IUJ28O9VO2KBGHDHR4H9",
        "to_account": "41IO9QG4M5O65B0EA4LSJ4UJ99",
        "client_request_id": "LJIS16BACHQG9LPP44L9IQHGAB",
        "journal_id": "89JGKD4LKIVI5UU6L3KHNU10IA",
        "journal_type": "CASH",
        "amount": "100",
        "currency": "USD",
        "status": "CANCELED",
        "reason": "xxxxxx",
        "biz_type": "CASH_JOURNAL"
    }
}
```
  </TabItem>

  <TabItem value="REJECTED " label="REJECTED">

```python
{
    "id": "event_c4b2c210-ce32-41d4-a9a1-cfad4fdf191c",
    "event_type": "JOURNAL",
    "timestamp": "2025-03-29T07:02:33.200962333Z",
    "payload": {
        "from_account": "93IUJ28O9VO2KBGHDHR4H9",
        "to_account": "41IO9QG4M5O65B0EA4LSJ4UJ99",
        "client_request_id": "LJIS16BACHQG9LPP44L9IQHGAB",
        "journal_id": "89JGKD4LKIVI5UU6L3KHNU10IA",
        "journal_type": "CASH",
        "amount": "100",
        "currency": "USD",
        "status": "REJECTED",
        "reason": "xxxxxx",
        "biz_type": "CASH_JOURNAL"
    }
}
```
  </TabItem>

  <TabItem value="FAILED" label="FAILED">

```python
{
    "id": "event_c4b2c210-ce32-41d4-a9a1-cfad4fdf191c",
    "event_type": "JOURNAL",
    "timestamp": "2025-03-29T07:02:33.200962333Z",
    "payload": {
        "from_account": "93IUJ28O9VO2KBGHDHR4H9",
        "to_account": "41IO9QG4M5O65B0EA4LSJ4UJ99",
        "client_request_id": "LJIS16BACHQG9LPP44L9IQHGAB",
        "journal_id": "89JGKD4LKIVI5UU6L3KHNU10IA",
        "journal_type": "CASH",
        "amount": "100",
        "currency": "USD",
        "status": "FAILED",
        "reason": "xxxxxx",
        "biz_type": "CASH_JOURNAL"
    }
}
```
  </TabItem>

  <TabItem value="COMPLETED" label="COMPLETED">

```python
{
    "id": "event_c4b2c210-ce32-41d4-a9a1-cfad4fdf191c",
    "event_type": "JOURNAL",
    "timestamp": "2025-03-29T07:02:33.200962333Z",
    "payload": {
        "from_account": "93IUJ28O9VO2KBGHDHR4H9",
        "to_account": "41IO9QG4M5O65B0EA4LSJ4UJ99",
        "client_request_id": "LJIS16BACHQG9LPP44L9IQHGAB",
        "journal_id": "89JGKD4LKIVI5UU6L3KHNU10IA",
        "journal_type": "CASH",
        "amount": "100",
        "currency": "USD",
        "status": "COMPLETED",
        "biz_type": "CASH_JOURNAL"
    }
}
```
  </TabItem>

</Tabs>





### Response Fields

| Field      | Type   | Description                        |
|------------|--------|------------------------------------|
| id         | string | Unique event identifier            |
| event_type | string | Event type, fixed as `JOURNAL`     |
| timestamp  | string | Event timestamp in ISO 8601 format |
| payload    | object | Event payload data                 |


### Payload Fields

| Field             | Type   | Description                                                                                                                                   |
|-------------------|--------|-----------------------------------------------------------------------------------------------------------------------------------------------|
| from_account      | string | From account id.                                                                                                                              |
| to_account        | string | To account id.                                                                                                                                |
| client_request_id | string | Client Request ID, unique for each request.                                                                                                   |
| journal_id        | string | Request id generated by the system.                                                                                                           |
| journal_type      | string | Journal type, fixed as `CASH`                                                                                                                 |
| amount            | string | Amount                                                                                                                                        |
| currency          | string | Currency, See the `currency` field in the [Query Cash Journal Detail](/docs/reference/broker-api/broker-journal-cash-query) API response.     |
| status            | string | Request status, See the `status` field in the [Query Cash Journal Detail](/docs/reference/broker-api/broker-journal-cash-query) API response. |
| reason            | string | Reason. If the terminal state is not “COMPLETED”, return the reason.                                                                          |
| biz_type          | string | Business type, fixed as `CASH_JOURNAL`                                                                                                        |








###  Position Journal
Position Journal Event Notification

<Tabs groupId="programming-language">
  <TabItem value="CANCELED" label="CANCELED">

```python
{
    "id": "event_c4b2c210-ce32-41d4-a9a1-cfad4fdf191c",
    "event_type": "JOURNAL",
    "timestamp": "2025-03-29T07:02:33.200962333Z",
    "payload": {
        "from_account": "93IUJ28O9VO2KBGHDHR4H9",
        "to_account": "41IO9QG4M5O65B0EA4LSJ4UJ99",
        "client_request_id": "LJIS16BACHQG9LPP44L9IQHGAB",
        "journal_id": "89JGKD4LKIVI5UU6L3KHNU10IA",
        "journal_type": "POSITION",
        "instrument_type": "EQUITY",
        "market": "US",
        "symbol": "BULL",
        "quantity": "100",
        "status": "CANCELED",
        "reason": "xxxxxx",
        "biz_type": "POSITION_JOURNAL"
    }
}
```
  </TabItem>

  <TabItem value="REJECTED " label="REJECTED">

```python
{
    "id": "event_c4b2c210-ce32-41d4-a9a1-cfad4fdf191c",
    "event_type": "JOURNAL",
    "timestamp": "2025-03-29T07:02:33.200962333Z",
    "payload": {
        "from_account": "93IUJ28O9VO2KBGHDHR4H9",
        "to_account": "41IO9QG4M5O65B0EA4LSJ4UJ99",
        "client_request_id": "LJIS16BACHQG9LPP44L9IQHGAB",
        "journal_id": "89JGKD4LKIVI5UU6L3KHNU10IA",
        "journal_type": "POSITION",
        "instrument_type": "EQUITY",
        "market": "US",
        "symbol": "BULL",
        "quantity": "100",
        "status": "REJECTED",
        "reason": "xxxxxx",
        "biz_type": "POSITION_JOURNAL"
    }
}
```
  </TabItem>

  <TabItem value="FAILED" label="FAILED">

```python
{
    "id": "event_c4b2c210-ce32-41d4-a9a1-cfad4fdf191c",
    "event_type": "JOURNAL",
    "timestamp": "2025-03-29T07:02:33.200962333Z",
    "payload": {
        "from_account": "93IUJ28O9VO2KBGHDHR4H9",
        "to_account": "41IO9QG4M5O65B0EA4LSJ4UJ99",
        "client_request_id": "LJIS16BACHQG9LPP44L9IQHGAB",
        "journal_id": "89JGKD4LKIVI5UU6L3KHNU10IA",
        "journal_type": "POSITION",
        "instrument_type": "EQUITY",
        "market": "US",
        "symbol": "BULL",
        "quantity": "100",
        "status": "FAILED",
        "reason": "xxxxxx",
        "biz_type": "POSITION_JOURNAL"
    }
}
```
  </TabItem>

  <TabItem value="COMPLETED" label="COMPLETED">

```python
{
    "id": "event_c4b2c210-ce32-41d4-a9a1-cfad4fdf191c",
    "event_type": "JOURNAL",
    "timestamp": "2025-03-29T07:02:33.200962333Z",
    "payload": {
        "from_account": "93IUJ28O9VO2KBGHDHR4H9",
        "to_account": "41IO9QG4M5O65B0EA4LSJ4UJ99",
        "client_request_id": "LJIS16BACHQG9LPP44L9IQHGAB",
        "journal_id": "89JGKD4LKIVI5UU6L3KHNU10IA",
        "journal_type": "POSITION",
        "instrument_type": "EQUITY",
        "market": "US",
        "symbol": "BULL",
        "quantity": "100",
        "status": "COMPLETED",
        "biz_type": "POSITION_JOURNAL"
    }
}
```
  </TabItem>

</Tabs>





### Response Fields

| Field      | Type   | Description                        |
|------------|--------|------------------------------------|
| id         | string | Unique event identifier            |
| event_type | string | Event type, fixed as `JOURNAL`     |
| timestamp  | string | Event timestamp in ISO 8601 format |
| payload    | object | Event payload data                 |


### Payload Fields

| Field             | Type   | Description                                                                                                                                                                                                                      |
|-------------------|--------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| from_account      | string | From account id.                                                                                                                                                                                                                 |
| to_account        | string | To account id.                                                                                                                                                                                                                   |
| client_request_id | string | Client Request ID, unique for each request.                                                                                                                                                                                      |
| journal_id        | string | Request id generated by the system.                                                                                                                                                                                              |
| journal_type      | string | Journal type, fixed as `POSITION`                                                                                                                                                                                                |
| market            | string | Market code indicating the trading venue or regulatory region of the financial instrument. See the `market` field in the [Query Position Journal Detail](/docs/reference/broker-api/broker-journal-position-query) API response. |
| instrument_type   | string | Type of financial instrument associated with the request. See the `instrument_type` field in the [Query Position Journal Detail](/docs/reference/broker-api/broker-journal-position-query) API response.                         |
| symbol            | string | Symbol name.                                                                                                                                                                                                                     |
| quantity          | string | Quantity                                                                                                                                                                                                                         |
| status            | string | Request status, See the `status` field in the [Query Position Journal Detail](/docs/reference/broker-api/broker-journal-position-query) API response.                                                                            |
| reason            | string | Reason. If the terminal state is not “COMPLETED”, return the reason.                                                                                                                                                             |
| biz_type          | string | Business type, fixed as `POSITION_JOURNAL`                                                                                                                                                                                       |
