Get Historical Orders
GET/api/v1.0/accounts/{acc_id}/orders_historyQuery the historical order list of the specified trading business account.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
acc_id | string | Yes | Trading business account ID. |
Request Parameters
| Parameter | Type | Position | Required | Description |
|---|---|---|---|---|
trd_market | string | Query | Yes | Trading market. See Naming Dictionary |
code | string | Query | No | Code filtering. Return the data of the specified code. By default, return all data. |
start | uint64 | Query | No | Start time of create time. Timestamp, in microseconds. |
end | uint64 | Query | No | End time of create time, which should be after start time. Timestamp, in microseconds. |
page_flag | string | Query | Yes | Empty string, which means starting from the beginning, otherwise using the page_flag returned by the server. |
page_size | uint32 | Query | No | Page size. Default is 50. Range: 10-100. |
The combination of start and end:
| start | end | Description |
|---|---|---|
| >0 | >0 | start and end are the specified dates respectively. |
| 0 | >0 | start is 90 days before end. |
| >0 | 0 | end is 90 days after start. |
| 0 | 0 | start is 90 days before, end is the current date. |
Response Parameters
| Field | Type | Description |
|---|---|---|
orders | list[Order] | Order list |
page_flag | string | Page flag for the next request |
completed | bool | True means that all orders have been returned, and client should stop the request for this batch. |
Response Example
json
{
"s": "ok",
"d": {
"orders": [
{
"side": "BUY",
"order_type": "LIMIT",
"order_status": "FILLED_ALL",
"order_id": "2024030100000001",
"code": "US.AAPL",
"stock_name": "Apple Inc.",
"security_type": "STOCK",
"qty": "100",
"price": "180.000",
"currency": "USD",
"create_time": 1709251200000000,
"updated_time": 1709251210000000,
"dealt_qty": "100",
"dealt_avg_price": "180.000",
"last_err_msg": "",
"remark": "",
"time_in_force": "DAY",
"session": "RTH",
"aux_price": "0.000",
"trail_type": "NONE",
"trail_value": "0.000",
"trail_spread": "0.000"
}
],
"page_flag": "",
"completed": true
}
}Error Response:
json
{
"s": "error",
"errcode": -1200,
"errmsg": "Error message."
}