Get Cash Logs
GET/api/v1.0/accounts/{acc_id}/cash_logsQuery cash flow records for a specified trading account. Supports filtering by time range, flow direction, and symbol, with pagination support.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
acc_id | string | Yes | Trading business account ID. |
Request Parameters
| Parameter | Type | Position | Required | Description |
|---|---|---|---|---|
begin_time | uint64 | Query | Yes | Query start time, Unix timestamp (microseconds). |
end_time | uint64 | Query | Yes | Query end time, Unix timestamp (microseconds). Must be greater than or equal to begin_time. |
direction | direction | Query | No | Flow direction filter. IN: Inflow; OUT: Outflow. Returns all directions if not specified. |
code | string | Query | No | Symbol code. Format: market.symbol, e.g. US.AAPL, HK.00700. Returns all records if not specified. |
page_flag | string | Query | No | Pagination cursor. Omit on first request; pass the page_flag from the previous response for subsequent requests. |
page_size | uint32 | Query | No | Page size. Defaults to 10 if omitted; when set, must not exceed 20. |
Request Example
bash
curl -X GET 'https://webapi.moomoo.com/api/v1.0/accounts/{acc_id}/cash_logs?begin_time=1709251200000000&end_time=1709337600000000&direction=IN&page_size=10' \
-H 'Authorization: Bearer <AccessToken>' | jqResponse Parameters
| Field | Type | Description |
|---|---|---|
cash_logs | list[cash_log] | Cash flow record list. |
page_flag | string | Next page cursor. Pass as page_flag in the next request to retrieve subsequent data. |
completed | bool | Whether all data has been returned. true indicates no more data. |
Response Example
json
{
"s": "ok",
"d": {
"cash_logs": [
{
"transaction_name": "Stock Sell Executed",
"created_time": "03/01/2024 10:30:00",
"cash_change": "18000.00",
"balance": "25000.00",
"symbol": "AAPL",
"stock_name": "AAPL Apple Inc."
},
{
"transaction_name": "Stock Buy Executed",
"created_time": "03/01/2024 09:45:00",
"cash_change": "-18000.00",
"balance": "7000.00",
"symbol": "AAPL",
"stock_name": "AAPL Apple Inc."
}
],
"page_flag": "a1b2c3d4e5f6",
"completed": false
}
}