獲取歷史訂單
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."
}