交易
鑑權
簽名方式:每個請求用 App Key / Secret 簽名。請求頭如下:
| 名稱 | 類型 | 必填 | 說明 |
|---|---|---|---|
Authorization | string · header | 必填 | OpenAPI 後台 上的賬戶 Access Token,作為原始 token 傳入(不帶 Bearer 前綴),並參與簽名計算。 |
X-Api-Key | string · header | 必填 | 你的 App Key。 |
X-Timestamp | string · header | 必填 | 請求時間戳,單位秒(Unix 時間)。 |
X-Api-Signature | string · header | 必填 | HMAC-SHA256 簽名。格式:HMAC-SHA256 SignedHeaders=authorization;x-api-key;x-timestamp, Signature=。 |
該接口用於訂單詳情查詢。
# Replace the order ID below with your actual order ID
longbridge order detail 693664675163312128
請求
查詢參數
| 名稱 | 類型 | 必填 | 說明 |
|---|---|---|---|
order_id | string | 必填 | 訂單 ID,用於指定訂單 ID 查詢,例如:`701276261045858304` |
is_attached | boolean | 可選 | order_id 是否為附加單 |
響應
響應欄位
| 名稱 | 類型 | 必填 | 說明 |
|---|---|---|---|
order_id | string | 可選 | 訂單 ID |
status | string | 可選 | 訂單狀態。可選值:`NotReported`、`ReplacedNotReported`、`ProtectedNotReported`、`VarietiesNotReported`、`DelayedNotReported`、`FilledStatus`、`WaitToNew`、`NewStatus`、`WaitToReplace`、`PendingReplaceStatus`、`ReplacedStatus`、`PartialFilledStatus`、`WaitToCancel`、`PendingCancelStatus`、`RejectedStatus`、`CanceledStatus`、`ExpiredStatus`、`PartialWithdrawal`。 |
stock_name | string | 可選 | 股票名稱 |
quantity | string | 可選 | 下單數量 |
executed_quantity | string | 可選 | 成交數量。. 當訂單未成交時為 0 |
price | string | 可選 | 下單價格。. 當市價條件單未觸發時為空字符串 |
executed_price | string | 可選 | 成交價。. 當訂單未成交時為 0 |
submitted_at | string | 可選 | 下單時間 |
side | string | 可選 | 買賣方向。**可選值:**, `Buy` - 買入,`Sell` - 賣出 |
symbol | string | 可選 | 股票代碼,使用 `ticker.region` 格式,例如:`AAPL.US` |
order_type | string | 可選 | 訂單類型。可選值:`LO`、`ELO`、`MO`、`AO`、`ALO`、`ODD`、`LIT`、`MIT`、`TSLPAMT`、`TSLPPCT`、`SLO`。 |
last_done | string | 可選 | 最近成交價格。. 當訂單未成交時為空字符串 |
trigger_price | string | 可選 | `LIT` / `MIT` 訂單觸發價格。. 當訂單不是 `LIT` / `MIT` 訂單為空字符串 |
msg | string | 可選 | 拒絕信息或備註,默認為空字符串。 |
tag | string | 可選 | 訂單標記。**可選值:**, `Normal` - 普通訂單,`Gtc` - 長期單,`Grey` - 暗盤單 |
time_in_force | string | 可選 | 訂單有效期類型。**可選值:**, `Day` - 當日有效,`GTC` - 撤單前有效,`GTD` - 到期前有效 |
expire_date | string | 可選 | 長期單過期時間,格式為 `YYYY-MM-DD`, 例如:`2022-12-05。. 不是長期單時,默認為空字符串。` |
updated_at | string | 可選 | 最近更新時間,格式為時間戳 (秒),默認為 0。 |
trigger_at | string | 可選 | 條件單觸發時間,格式為時間戳 (秒),默認為 0。 |
trailing_amount | string | 可選 | `TSLPAMT` 訂單跟蹤金額。. 當訂單不是 `TSLPAMT` 訂單時為空字符串。 |
trailing_percent | string | 可選 | `TSLPPCT` 訂單跟蹤漲跌幅。. 當訂單不是 `TSLPPCT` 訂單時為空字符串。 |
limit_offset | string | 可選 | `TSLPAMT` / `TSLPPCT` 訂單指定價差。. 當訂單不是 `TSLPAMT` / `TSLPPCT` 訂單時為空字符串。 |
trigger_status | string | 可選 | 條件單觸發狀態,當訂單不是條件單或條件單未觸發時,觸發狀態為 NOT_USED. **可選值:**, `NOT_USED` - 未激活 `DEACTIVE` - 已失效 `ACTIVE` - 已激活 `RELEASED` - 已觸發 |
currency | string | 可選 | 結算貨幣 |
outside_rth | string | 可選 | 是否允許盤前盤後,當訂單不是美股時,默認為 UnknownOutsideRth. **可選值:**, `RTH_ONLY` - 不允許盤前盤後,`ANY_TIME` - 允許盤前盤後,`OVERNIGHT` - 夜盤 |
remark | string | 可選 | 備註 |
free_status | string | 必填 | 免傭狀態,默認為 None **可選值:** `None` - 無 `Calculated` - 免傭額待計算 `Pending` - 待免傭 `Ready` - 已免傭 |
free_amount | string | 必填 | 免佣金額,默認為空字符串 |
free_currency | string | 必填 | 免傭貨幣,默認為空字符串 |
deductions_status | string | 必填 | 抵扣狀態/返現狀態,默認為 NONE **可選值:** `NONE` - 待結算 `NO_DATA` - 已結算無數據 `PENDING` - 已結算待發放 `DONE` - 已結算已發放 |
deductions_amount | string | 必填 | 抵扣金額,默認為空字符串 |
deductions_currency | string | 必填 | 抵扣貨幣,默認為空字符串 |
platform_deducted_status | string | 必填 | 平臺費抵扣狀態/返現狀態,默認為 NONE **可選值:** `NONE` - 待結算 `NO_DATA` - 已結算無數據 `PENDING` - 已結算待發放 `DONE` - 已結算已發放 |
platform_deducted_amount | string | 必填 | 平臺費抵扣金額,默認為空字符串 |
platform_deducted_currency | string | 必填 | 平臺費抵扣貨幣,默認為空字符串 |
history | object[] | 必填 | 訂單歷史明細 |
└ price | string | 可選 | 下單價格。. 當市價條件單未觸發時為空字符串 |
└ quantity | string | 可選 | 下單數量 |
└ status | string | 可選 | 訂單狀態。可選值:`NotReported`、`ReplacedNotReported`、`ProtectedNotReported`、`VarietiesNotReported`、`DelayedNotReported`、`FilledStatus`、`WaitToNew`、`NewStatus`、`WaitToReplace`、`PendingReplaceStatus`、`ReplacedStatus`、`PartialFilledStatus`、`WaitToCancel`、`PendingCancelStatus`、`RejectedStatus`、`CanceledStatus`、`ExpiredStatus`、`PartialWithdrawal`。 |
└ msg | string | 可選 | 拒絕信息或備註,默認為空字符串。 |
└ time | string | 必填 | 發生時間 |
charge_detail | object | 必填 | 訂單費用 |
└ total_amount | string | 必填 | 全部費用 |
└ currency | string | 可選 | 結算貨幣 |
└ items | object[] | 必填 | 訂單費用明細 |
└ limit_depth_level | int32 | 必填 | 指定買賣檔位 |
└ monitor_price | string | 可選 | 監控價格 |
└ trigger_count | int32 | 必填 | 觸發次數 |
└ attached_orders | object[] | 可選 | 附加訂單詳情列表 |
multi_leg | object | 可選 | 多腿策略信息,僅多腿期權組合訂單返回,非組合訂單不返回。 |
└ strategy | string | 可選 | 多腿策略 **可選值:** `0` - CoveredCall(股票擔保)`1` - CoveredPut(股票擔保)`2` - VerticalCallSpread(跨價期權)`3` - VerticalPutSpread(跨價期權)`4` - Collar(領式策略)`5` - Straddle(馬鞍式策略)`6` - Strangle(勒束式策略)`7` - CalendarCallSpread(跨期期權策略)`8` - CalendarPutSpread(跨期期權策略) |
└ strategy_name | string | 可選 | 策略名稱 |
└ multileg_id | string | 可選 | 多腿組合 ID |
└ code | string | 可選 | 多腿組合代碼 |
└ legs | object[] | 可選 | 組合訂單的各腿 |
響應 JSON 示例
{
"code": 0,
"message": "success",
"data": {
"order_id": "828940451093708800",
"status": "FilledStatus",
"stock_name": "Apple",
"quantity": "10",
"executed_quantity": "10",
"price": "200.000",
"executed_price": "164.660",
"submitted_at": "1680863604",
"side": "Buy",
"symbol": "AAPL.US",
"order_type": "LO",
"last_done": "164.660",
"trigger_price": "0.0000",
"msg": "",
"tag": "Normal",
"time_in_force": "Day",
"expire_date": "2023-04-10",
"updated_at": "1681113000",
"trigger_at": "0",
"trailing_amount": "",
"trailing_percent": "",
"limit_offset": "",
"limit_depth_level": 0,
"monitor_price": "",
"trigger_count": 1,
"trigger_status": "NOT_USED",
"outside_rth": "ANY_TIME",
"currency": "USD",
"remark": "1680863603.927165",
"free_status": "None",
"free_amount": "",
"free_currency": "",
"deductions_status": "NONE",
"deductions_amount": "",
"deductions_currency": "",
"platform_deducted_status": "NONE",
"platform_deducted_amount": "",
"platform_deducted_currency": "",
"history": [
{
"price": "164.6600",
"quantity": "10",
"status": "FilledStatus",
"msg": "Execution of 10",
"time": "1681113000"
},
{
"price": "200.0000",
"quantity": "10",
"status": "NewStatus",
"msg": "",
"time": "1681113000"
}
],
"charge_detail": {
"items": [
{
"code": "BROKER_FEES",
"name": "Broker Fees",
"fees": []
},
{
"code": "THIRD_FEES",
"name": "Third-party Fees",
"fees": []
}
],
"total_amount": "0",
"currency": "USD"
},
"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": "",
"limit_depth_level": 0
}
],
"multi_leg": {
"strategy": "2",
"strategy_name": "Vertical spread",
"multileg_id": "Spread_QQQ20260731C764/767",
"code": "QQQ 260731 764/767 Vertical spread",
"legs": [
{
"symbol": "QQQ260731C764000.US",
"side": "Buy",
"position": "LONG",
"ratio_quantity": "1",
"strike_price": "764",
"expire_date": "20260731",
"contract_direction": "C"
},
{
"symbol": "QQQ260731C767000.US",
"side": "Sell",
"position": "SHORT",
"ratio_quantity": "1",
"strike_price": "767",
"expire_date": "20260731",
"contract_direction": "C"
}
]
}
}
}錯誤碼
參見錯誤碼文檔。