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

# Funding Events

To enable third-party systems to promptly obtain the execution results of foreign exchange and deposit/withdrawal operations, Broker OpenAPI provides an asynchronous proactive event push mechanism for FX conversion and deposit/withdrawal transaction events.

Clients can subscribe to receive relevant events, allowing them to monitor transaction processing results and status changes in real time.

###  Instant Funding
Instant Funding Event Notification

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

```python
{
    "id": "event_c4b2c210-ce32-41d4-a9a1-cfad4fdf191c",
    "event_type": "FUNDING",
    "timestamp": "2025-03-29T07:02:33.200962333Z",
    "payload": {
        "account_id": "93IUJ28O9VO2KBGHDHR4H9",
        "client_request_id": "LJIS16BACHQG9LPP44L9IQHGAB",
        "instant_funding_id": "89JGKD4LKIVI5UU6L3KHNU10IA",
        "amount": "100",
        "currency": "HKD",
        "type": "DEPOSIT",
        "status": "CANCELED",
        "reason": "xxxxxx",
        "biz_type": "INSTANT_FUNDING"
    }
}
```
  </TabItem>

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

```python
{
    "id": "event_c4b2c210-ce32-41d4-a9a1-cfad4fdf191c",
    "event_type": "FUNDING",
    "timestamp": "2025-03-29T07:02:33.200962333Z",
    "payload": {
        "account_id": "93IUJ28O9VO2KBGHDHR4H9",
        "client_request_id": "LJIS16BACHQG9LPP44L9IQHGAB",
        "instant_funding_id": "89JGKD4LKIVI5UU6L3KHNU10IA",
        "amount": "100",
        "currency": "HKD",
        "type": "DEPOSIT",
        "status": "REJECTED",
        "reason": "xxxxxx",
        "biz_type": "INSTANT_FUNDING"
    }
}
```
  </TabItem>

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

```python
{
    "id": "event_c4b2c210-ce32-41d4-a9a1-cfad4fdf191c",
    "event_type": "FUNDING",
    "timestamp": "2025-03-29T07:02:33.200962333Z",
    "payload": {
        "account_id": "93IUJ28O9VO2KBGHDHR4H9",
        "client_request_id": "LJIS16BACHQG9LPP44L9IQHGAB",
        "instant_funding_id": "89JGKD4LKIVI5UU6L3KHNU10IA",
        "amount": "100",
        "currency": "HKD",
        "type": "DEPOSIT",
        "status": "FAILED",
        "reason": "xxxxxx",
        "biz_type": "INSTANT_FUNDING"
    }
}
```
  </TabItem>

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

```python
{
    "id": "event_c4b2c210-ce32-41d4-a9a1-cfad4fdf191c",
    "event_type": "FUNDING",
    "timestamp": "2025-03-29T07:02:33.200962333Z",
    "payload": {
        "account_id": "93IUJ28O9VO2KBGHDHR4H9",
        "client_request_id": "LJIS16BACHQG9LPP44L9IQHGAB",
        "instant_funding_id": "89JGKD4LKIVI5UU6L3KHNU10IA",
        "amount": "100",
        "currency": "HKD",
        "type": "DEPOSIT",
        "status": "COMPLETED",
        "biz_type": "INSTANT_FUNDING"
    }
}
```
  </TabItem>

</Tabs>




### Response Fields

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

### Payload Fields

| Field              | Type   | Description                                                                                                                                                   |
|--------------------|--------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
| account_id         | string | Account id                                                                                                                                                    |
| client_request_id  | string | Client Request ID, unique for each request.                                                                                                                   |
| instant_funding_id | string | Request id generated by the system.                                                                                                                           |
| amount             | string | Amount.                                                                                                                                                       |
| currency           | string | Currency, See the `currency` field in the [Get Instant Funding Detail](/docs/reference/broker-api/broker-funding-instant-query) API response.                 |
| type               | string | Instant Funding Request Type, See the `type` field in the [Get Instant Funding Detail](/docs/reference/broker-api/broker-funding-instant-query) API response. |
| status             | string | Request status, See the `status` field in the [Get Instant Funding Detail](/docs/reference/broker-api/broker-funding-instant-query) API response.             |
| reason             | string | Reason. If the terminal state is not “COMPLETED”, return the reason.                                                                                          |
| biz_type           | string | Business type, fixed as `INSTANT_FUNDING`                                                                                                                     |






###  Instant Exchange
Instant Exchange Event Notification

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

```python
{
    "id": "event_c4b2c210-ce32-41d4-a9a1-cfad4fdf191c",
    "event_type": "FUNDING",
    "timestamp": "2025-03-29T07:02:33.200962333Z",
    "payload": {
        "account_id": "93IUJ28O9VO2KBGHDHR4H9",
        "client_request_id": "LJIS16BACHQG9LPP44L9IQHGAB",
        "instant_exchange_id": "89JGKD4LKIVI5UU6L3KHNU10IA",
        "from_amount": "100",
        "to_amount": "700",
        "from_currency": "USD",
        "to_currency": "HKD",
        "status": "CANCELED",
        "reason": "xxxxxx",
        "biz_type": "INSTANT_EXCHANGE"
    }
}
```
  </TabItem>

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

```python
{
    "id": "event_c4b2c210-ce32-41d4-a9a1-cfad4fdf191c",
    "event_type": "FUNDING",
    "timestamp": "2025-03-29T07:02:33.200962333Z",
    "payload": {
        "account_id": "93IUJ28O9VO2KBGHDHR4H9",
        "client_request_id": "LJIS16BACHQG9LPP44L9IQHGAB",
        "instant_exchange_id": "89JGKD4LKIVI5UU6L3KHNU10IA",
        "from_amount": "100",
        "to_amount": "700",
        "from_currency": "USD",
        "to_currency": "HKD",
        "status": "REJECTED",
        "reason": "xxxxxx",
        "biz_type": "INSTANT_EXCHANGE"
    }
}
```
  </TabItem>

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

```python
{
    "id": "event_c4b2c210-ce32-41d4-a9a1-cfad4fdf191c",
    "event_type": "FUNDING",
    "timestamp": "2025-03-29T07:02:33.200962333Z",
    "payload": {
        "account_id": "93IUJ28O9VO2KBGHDHR4H9",
        "client_request_id": "LJIS16BACHQG9LPP44L9IQHGAB",
        "instant_exchange_id": "89JGKD4LKIVI5UU6L3KHNU10IA",
        "from_amount": "100",
        "to_amount": "700",
        "from_currency": "USD",
        "to_currency": "HKD",
        "status": "FAILED",
        "reason": "xxxxxx",
        "biz_type": "INSTANT_EXCHANGE"
    }
}
```
  </TabItem>

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

```python
{
    "id": "event_c4b2c210-ce32-41d4-a9a1-cfad4fdf191c",
    "event_type": "FUNDING",
    "timestamp": "2025-03-29T07:02:33.200962333Z",
    "payload": {
        "account_id": "93IUJ28O9VO2KBGHDHR4H9",
        "client_request_id": "LJIS16BACHQG9LPP44L9IQHGAB",
        "instant_exchange_id": "89JGKD4LKIVI5UU6L3KHNU10IA",
        "from_amount": "100",
        "to_amount": "700",
        "from_currency": "USD",
        "to_currency": "HKD",
        "status": "COMPLETED",
        "biz_type": "INSTANT_EXCHANGE"
    }
}
```
  </TabItem>

</Tabs>



### Response Fields

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


### Payload Fields

| Field             | Type   | Description                                                                                                                                                               |
|-------------------|--------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| account_id        | string | Account id                                                                                                                                                                |
| client_request_id | string | Client Request ID, unique for each request.                                                                                                                               |
| instant_exchange_id     | string | Request id generated by the system.                                                                                                                                       |
| from_amount       | string | Base amount for exchange.                                                                                                                                                 |
| to_amount         | string | Amount after exchange.                                                                                                                                                    |
| from_currency     | string | Base currency for exchange., See the `from_currency` field in the [Get Instant Exchange Detail](/docs/reference/broker-api/broker-funding-query-instant-fx) API response. |
| to_currency       | string | Currency after exchange. , See the `to_currency` field in the [Get Instant Exchange Detail](/docs/reference/broker-api/broker-funding-query-instant-fx) API response.     |
| status            | string | Request status, See the `status` field in the [Get Instant Exchange Detail](/docs/reference/broker-api/broker-funding-query-instant-fx) API response.                     |
| reason            | string | Reason. If the terminal state is not “COMPLETED”, return the reason.                                                                                                      |
| biz_type          | string | Business type, fixed as `INSTANT_EXCHANGE`                                                                                                                                |





###  Exchange
Foreign Exchange Conversion Event Notification

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

```python
{
    "id": "event_c4b2c210-ce32-41d4-a9a1-cfad4fdf191c",
    "event_type": "FUNDING",
    "timestamp": "2025-03-29T07:02:33.200962333Z",
    "payload": {
        "account_id": "93IUJ28O9VO2KBGHDHR4H9",
        "client_request_id": "LJIS16BACHQG9LPP44L9IQHGAB",
        "fx_id": "89JGKD4LKIVI5UU6L3KHNU10IA",
        "from_amount": "100",
        "from_currency": "USD",
        "to_currency": "HKD",
        "status": "CANCELED",
        "reason": "xxxxxx",
        "biz_type": "EXCHANGE"
    }
}
```
  </TabItem>

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

```python
{
    "id": "event_c4b2c210-ce32-41d4-a9a1-cfad4fdf191c",
    "event_type": "FUNDING",
    "timestamp": "2025-03-29T07:02:33.200962333Z",
    "payload": {
        "account_id": "93IUJ28O9VO2KBGHDHR4H9",
        "client_request_id": "LJIS16BACHQG9LPP44L9IQHGAB",
        "fx_id": "89JGKD4LKIVI5UU6L3KHNU10IA",
        "from_amount": "100",
        "from_currency": "USD",
        "to_currency": "HKD",
        "status": "REJECTED",
        "reason": "xxxxxx",
        "biz_type": "EXCHANGE"
    }
}
```
  </TabItem>

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

```python
{
    "id": "event_c4b2c210-ce32-41d4-a9a1-cfad4fdf191c",
    "event_type": "FUNDING",
    "timestamp": "2025-03-29T07:02:33.200962333Z",
    "payload": {
        "account_id": "93IUJ28O9VO2KBGHDHR4H9",
        "client_request_id": "LJIS16BACHQG9LPP44L9IQHGAB",
        "fx_id": "89JGKD4LKIVI5UU6L3KHNU10IA",
        "from_amount": "100",
        "from_currency": "USD",
        "to_currency": "HKD",
        "status": "FAILED",
        "reason": "xxxxxx",
        "biz_type": "EXCHANGE"
    }
}
```
  </TabItem>

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

```python
{
    "id": "event_c4b2c210-ce32-41d4-a9a1-cfad4fdf191c",
    "event_type": "FUNDING",
    "timestamp": "2025-03-29T07:02:33.200962333Z",
    "payload": {
        "account_id": "93IUJ28O9VO2KBGHDHR4H9",
        "client_request_id": "LJIS16BACHQG9LPP44L9IQHGAB",
        "fx_id": "89JGKD4LKIVI5UU6L3KHNU10IA",
        "from_amount": "100",
        "to_amount": "801",
        "from_currency": "USD",
        "to_currency": "HKD",
        "fx_rate": "8.01",
        "status": "COMPLETED",
        "biz_type": "EXCHANGE"
    }
}
```
  </TabItem>

</Tabs>





### Response Fields

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


### Payload Fields

| Field             | Type   | Description                                                                                                                                         |
|-------------------|--------|-----------------------------------------------------------------------------------------------------------------------------------------------------|
| account_id        | string | Account id                                                                                                                                          |
| client_request_id | string | Client Request ID, unique for each request.                                                                                                         |
| fx_id             | string | Request id generated by the system.                                                                                                                 |
| from_amount       | string | Base amount for exchange.                                                                                                                           |
| to_amount         | string | Amount after exchange.                                                                                                                              |
| from_currency     | string | Base currency for exchange., See the `from_currency` field in the [Get FX Detail](/docs/reference/broker-api/broker-funding-query-fx) API response. |
| to_currency       | string | Currency after exchange. , See the `to_currency` field in the [Get FX Detail](/docs/reference/broker-api/broker-funding-query-fx) API response.     |
| fx_rate           | string | FX ratre.                                                                                                                                           |
| status            | string | Request status, See the `status` field in the [Get FX Detail](/docs/reference/broker-api/broker-funding-query-fx) API response.                     |
| reason            | string | Reason. If the terminal state is not “COMPLETED”, return the reason.                                                                                |
| biz_type          | string | Business type, fixed as `EXCHANGE`                                                                                                                  |

