History Orders
This API is used to get history order.
SDK Links
Request
| HTTP Method | GET |
| HTTP URL | /v1/trade/order/history |
Parameters
Content-Type: application/json; charset=utf-8
| Name | Type | Required | Description |
|---|---|---|---|
| symbol | string | NO | Stock symbol, use ticker.region format, example: AAPL.US |
| status | string[] | NO | Order status example: status=FilledStatus&status=NewStatus |
| side | string | NO | Order side Enum Value: BuySell |
| market | string | NO | Market Enum Value: US - United States of America MarketHK - Hong Kong Market |
| start_at | string | NO | Start time, formatted as a timestamp (second), example: 1650410999.If the start time is null, the default is the 90 days before of the end time or 90 days before of the current time. |
| end_at | string | NO | End time, formatted as a timestamp (second), example: 1650410999. If the end time is null, the default is the current time or 90 days after of the start time. |
Request Example
Response
Response Headers
- Content-Type: application/json
Response Example
json
{
"code": 0,
"message": "success",
"data": {
"orders": [
{
"currency": "HKD",
"executed_price": "0.000",
"executed_quantity": "0",
"expire_date": "",
"last_done": "",
"limit_offset": "",
"msg": "",
"order_id": "706388312699592704",
"order_type": "ELO",
"outside_rth": "UnknownOutsideRth",
"price": "11.900",
"quantity": "200",
"side": "Buy",
"status": "RejectedStatus",
"stock_name": "Bank of East Asia Ltd/The",
"submitted_at": "1651644897",
"symbol": "23.HK",
"tag": "Normal",
"time_in_force": "Day",
"trailing_amount": "",
"trailing_percent": "",
"trigger_at": "0",
"trigger_price": "",
"trigger_status": "NOT_USED",
"updated_at": "1651644898",
"remark": "",
"limit_depth_level": 0,
"monitor_price": "",
"trigger_count": 1,
"attached_orders": [
{
"order_id": "706388312699592705",
"attached_type_display": 2,
"trigger_price": "10.500",
"quantity": "200",
"executed_qty": "0",
"status": "NewStatus",
"updated_at": "1651644898",
"withdrawn": false,
"gtd": "",
"time_in_force": "Day",
"counter_id": "",
"trigger_status": 0,
"executed_amount": "0",
"tag": 0,
"submitted_at": "1651644897",
"executed_price": "0.000",
"force_only_rth": "RTH_ONLY",
"reviewed": false,
"activate_order_type": "MIT",
"activate_rth": "RTH_ONLY",
"submit_price": ""
}
]
}
]
}
}Response Status
| Status | Description | Schema |
|---|---|---|
| 200 | Get History Orders Success | history_orders_rsp |
| 400 | The query failed with an error in the request parameter. | None |
Schemas
history_orders_rsp
| Name | Type | Required | Description |
|---|---|---|---|
| has_more | boolean | true | has more orders record. The maximum number of orders per query is 1000, if the number of results exceeds 1000, then has_more will be true |
| orders | object[] | false | Order Detail |
| ∟ order_id | string | true | Order ID |
| ∟ status | string | true | Order Status |
| ∟ stock_name | string | true | Stock Name |
| ∟ quantity | string | true | Submitted Quantity |
| ∟ executed_quantity | string | true | Executed Quantity. when the order is not filled, value is 0 |
| ∟ price | string | true | Submitted Price. when market condition order is not triggered, value is empty string |
| ∟ executed_price | string | true | Executed Price. when the order is not filled, value is 0 |
| ∟ submitted_at | string | true | Submitted Time |
| ∟ side | string | true | Order Side Enum Value: BuySell |
| ∟ symbol | string | true | Stock symbol, use ticker.region format, example: AAPL.US |
| ∟ order_type | string | true | Order Type |
| ∟ last_done | string | true | Last done. when the order is not filled, value is empty string |
| ∟ trigger_price | string | true | LIT / MIT Order Trigger Price.When the order is not LIT / MIT order, value is empty string |
| ∟ msg | string | true | Rejected message or remark, default value is empty string. |
| ∟ tag | string | true | Order tag Enum Value Normal - Normal OrderGtc - Long term OrderGrey - Grey Order |
| ∟ time_in_force | string | true | Time in force Type Enum Value: Day - Day OrderGTC - Good Til Canceled OrderGTD - Good Til Date Order |
| ∟ expire_date | string | true | Long term order expire date, format: YYYY-MM-DD, example: 2022-12-05.When not a long term order, default value is empty string |
| ∟ updated_at | string | true | Last updated time, formatted as a timestamp (second) |
| ∟ trigger_at | string | true | Conditional order trigger time. formatted as a timestamp (second) |
| ∟ trailing_amount | string | true | TSLPAMT order trailing amount.When the order is not TSLPAMT order, value is empty string |
| ∟ trailing_percent | string | true | TSLPPCT order trailing percent.When the order is not TSLPPCT order, value is empty string |
| ∟ limit_offset | string | true | TSLPPCT order limit offset amount.When the order is not TSLPPCT order, value is empty string |
| ∟ trigger_status | string | true | Conditional Order Trigger Status When an order is not a conditional order or a conditional order is not triggered, the trigger status is NOT_USED Enum Value NOT_USEDDEACTIVEACTIVERELEASED |
| ∟ currency | string | true | Currency |
| ∟ outside_rth | string | true | Enable or disable outside regular trading hours Default is UnknownOutsideRth when the order is not a US stockEnum Value: RTH_ONLY - Regular trading hour onlyANY_TIME - Any timeOVERNIGHT - Overnight" |
| ∟ remark | string | true | Remark |
| ∟ limit_depth_level | int32 | true | Specifies the bid/ask depth level |
| ∟ monitor_price | string | true | Monitoring price |
| ∟ trigger_count | int32 | true | Number of triggers |
| ∟ attached_orders | object[] | false | List of attached order details |
| ∟∟ order_id | string | true | Attached order ID |
| ∟∟ attached_type_display | int32 | true | Attached order type. Enum Value: 1 - Take Profit2 - Stop Loss |
| ∟∟ trigger_price | string | true | Trigger price |
| ∟∟ quantity | string | true | Order quantity |
| ∟∟ executed_qty | string | true | Executed quantity |
| ∟∟ status | string | true | Order status |
| ∟∟ updated_at | string | true | Last updated time, formatted as a timestamp (second) |
| ∟∟ withdrawn | boolean | true | Whether the order has been withdrawn |
| ∟∟ gtd | string | true | GTD expiration date, format: YYYY-MM-DD |
| ∟∟ time_in_force | string | true | Time in force Type Enum Value: Day - Day OrderGTC - Good Til Canceled OrderGTD - Good Til Date Order |
| ∟∟ counter_id | string | true | Counter order ID |
| ∟∟ trigger_status | int32 | true | Conditional order trigger status after the attached order is activated.0 - Not activated1 - Monitoring2 - Cancelled4 - Triggered |
| ∟∟ executed_amount | string | true | Executed amount |
| ∟∟ tag | int32 | true | Order tag |
| ∟∟ submitted_at | string | true | Submitted time, formatted as a timestamp (second) |
| ∟∟ executed_price | string | true | Executed price |
| ∟∟ force_only_rth | string | true | Whether execution is restricted to regular trading hours only |
| ∟∟ reviewed | boolean | true | Whether the order has been reviewed |
| ∟∟ activate_order_type | string | true | Order type submitted after triggering, e.g. LIT (limit-if-touched) or MIT (market-if-touched) |
| ∟∟ activate_rth | string | true | Whether the order submitted after triggering allows pre/post market trading |
| ∟∟ submit_price | string | true | Submitted price |