Skip to content

Get Historical Orders ​

GET /api/v1.0/accounts/{acc_id}/orders_history

Query the historical order list of the specified trading business account.

Path Parameters ​

ParameterTypeRequiredDescription
acc_idstringYesTrading business account ID.

Request Parameters ​

ParameterTypePositionRequiredDescription
trd_marketstringQueryYesTrading market. See Naming Dictionary
codestringQueryNoCode filtering. Return the data of the specified code. By default, return all data.
startuint64QueryNoStart time of create time. Timestamp, in microseconds.
enduint64QueryNoEnd time of create time, which should be after start time. Timestamp, in microseconds.
page_flagstringQueryNoOptional on the first request. Omit it (or send an empty string) to start from the beginning; afterwards pass the page_flag returned by the server.
page_sizeuint32QueryNoPage size. Defaults to 50 if omitted; when set, must be 10–100.

The combination of start and end:

startendDescription
>0>0start and end are microsecond timestamps, not calendar dates.
0>0start is 90 days before end.
>00end is 90 days after start.
00start is 90 days before the current time, and end is the current time.

Response Parameters ​

FieldTypeDescription
orderslist[order]Order list
page_flagstringPage flag for the next request
completedboolTrue 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",
        "exchange": "US",
        "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",
        "position_open_type": "",
        "algo_info": null
      }
    ],
    "page_flag": "",
    "completed": true
  }
}