获取历史订单
GET/api/v1.0/accounts/{acc_id}/orders_history查询指定交易业务账户的历史订单列表。
路径参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
acc_id | string | 是 | 业务账户 ID。 |
请求参数
| 参数 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
trd_market | string | 查询 | 是 | 交易市场。可选值参见 命名词典 |
code | string | 查询 | 否 | 代码筛选。返回指定代码的数据,默认返回全部数据。 |
start | uint64 | 查询 | 否 | 创建时间的起始时间,时间戳,单位微秒。 |
end | uint64 | 查询 | 否 | 创建时间的结束时间,应在起始时间之后。时间戳,单位微秒。 |
page_flag | string | 查询 | 是 | 翻页标记,首次请求填空字符串表示从头开始,之后填入服务端返回的 page_flag。 |
page_size | uint32 | 查询 | 否 | 每页条数,默认 50,取值范围 10-100。 |
start 和 end 的组合说明:
| start | end | 说明 |
|---|---|---|
| >0 | >0 | start 和 end 分别为指定日期。 |
| 0 | >0 | start 为 end 之前 90 天。 |
| >0 | 0 | end 为 start 之后 90 天。 |
| 0 | 0 | start 为当前日期之前 90 天,end 为当前日期。 |
响应参数
| 字段 | 类型 | 说明 |
|---|---|---|
orders | list[Order] | 订单列表 |
page_flag | string | 下次请求的翻页标记 |
completed | bool | 为 true 表示所有订单已返回,客户端应停止翻页请求。 |
响应示例
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
}
}失败响应:
json
{
"s": "error",
"errcode": -1200,
"errmsg": "Error message."
}