交易

订单详情

GEThttps://openapi.longbridge.com/v1/trade/order

鉴权

签名方式:每个请求用 App Key / Secret 签名。请求头如下:

名称类型必填说明
Authorizationstring · header必填OpenAPI 后台 上的账户 Access Token,作为原始 token 传入(不带 Bearer 前缀),并参与签名计算。
X-Api-Keystring · header必填你的 App Key。
X-Timestampstring · header必填请求时间戳,单位秒(Unix 时间)。
X-Api-Signaturestring · header必填HMAC-SHA256 签名。格式:HMAC-SHA256 SignedHeaders=authorization;x-api-key;x-timestamp, Signature=。

该接口用于订单详情查询。

>_ CLI
# Replace the order ID below with your actual order ID
longbridge order detail 693664675163312128

请求

查询参数

名称类型必填说明
order_idstring必填订单 ID,用于指定订单 ID 查询,例如:`701276261045858304`
is_attachedboolean可选order_id 是否为附加单

响应

响应字段

名称类型必填说明
order_idstring可选订单 ID
statusstring可选订单状态。可选值:`NotReported`、`ReplacedNotReported`、`ProtectedNotReported`、`VarietiesNotReported`、`DelayedNotReported`、`FilledStatus`、`WaitToNew`、`NewStatus`、`WaitToReplace`、`PendingReplaceStatus`、`ReplacedStatus`、`PartialFilledStatus`、`WaitToCancel`、`PendingCancelStatus`、`RejectedStatus`、`CanceledStatus`、`ExpiredStatus`、`PartialWithdrawal`。
stock_namestring可选股票名称
quantitystring可选下单数量
executed_quantitystring可选成交数量。. 当订单未成交时为 0
pricestring可选下单价格。. 当市价条件单未触发时为空字符串
executed_pricestring可选成交价。. 当订单未成交时为 0
submitted_atstring可选下单时间
sidestring可选买卖方向。**可选值:**, `Buy` - 买入,`Sell` - 卖出
symbolstring可选股票代码,使用 `ticker.region` 格式,例如:`AAPL.US`
order_typestring可选订单类型。可选值:`LO`、`ELO`、`MO`、`AO`、`ALO`、`ODD`、`LIT`、`MIT`、`TSLPAMT`、`TSLPPCT`、`SLO`。
last_donestring可选最近成交价格。. 当订单未成交时为空字符串
trigger_pricestring可选`LIT` / `MIT` 订单触发价格。. 当订单不是 `LIT` / `MIT` 订单为空字符串
msgstring可选拒绝信息或备注,默认为空字符串。
tagstring可选订单标记。**可选值:**, `Normal` - 普通订单,`Gtc` - 长期单,`Grey` - 暗盘单
time_in_forcestring可选订单有效期类型。**可选值:**, `Day` - 当日有效,`GTC` - 撤单前有效,`GTD` - 到期前有效
expire_datestring可选长期单过期时间,格式为 `YYYY-MM-DD`, 例如:`2022-12-05。. 不是长期单时,默认为空字符串。`
updated_atstring可选最近更新时间,格式为时间戳 (秒),默认为 0。
trigger_atstring可选条件单触发时间,格式为时间戳 (秒),默认为 0。
trailing_amountstring可选`TSLPAMT` 订单跟踪金额。. 当订单不是 `TSLPAMT` 订单时为空字符串。
trailing_percentstring可选`TSLPPCT` 订单跟踪涨跌幅。. 当订单不是 `TSLPPCT` 订单时为空字符串。
limit_offsetstring可选`TSLPAMT` / `TSLPPCT` 订单指定价差。. 当订单不是 `TSLPAMT` / `TSLPPCT` 订单时为空字符串。
trigger_statusstring可选条件单触发状态,当订单不是条件单或条件单未触发时,触发状态为 NOT_USED. **可选值:**, `NOT_USED` - 未激活 `DEACTIVE` - 已失效 `ACTIVE` - 已激活 `RELEASED` - 已触发
currencystring可选结算货币
outside_rthstring可选是否允许盘前盘后,当订单不是美股时,默认为 UnknownOutsideRth. **可选值:**, `RTH_ONLY` - 不允许盘前盘后,`ANY_TIME` - 允许盘前盘后,`OVERNIGHT` - 夜盘"
remarkstring可选备注
free_statusstring必填免佣状态,默认为 None **可选值:** `None` - 无 `Calculated` - 免佣额待计算 `Pending` - 待免佣 `Ready` - 已免佣
free_amountstring必填免佣金额,默认为空字符串
free_currencystring必填免佣货币,默认为空字符串
deductions_statusstring必填抵扣状态/返现状态,默认为 NONE **可选值:** `NONE` - 待结算 `NO_DATA` - 已结算无数据 `PENDING` - 已结算待发放 `DONE` - 已结算已发放
deductions_amountstring必填抵扣金额,默认为空字符串
deductions_currencystring必填抵扣货币,默认为空字符串
platform_deducted_statusstring必填平台费抵扣状态/返现状态,默认为 NONE **可选值:** `NONE` - 待结算 `NO_DATA` - 已结算无数据 `PENDING` - 已结算待发放 `DONE` - 已结算已发放
platform_deducted_amountstring必填平台费抵扣金额,默认为空字符串
platform_deducted_currencystring必填平台费抵扣货币,默认为空字符串
historyobject[]必填订单历史明细
└ pricestring可选下单价格。. 当市价条件单未触发时为空字符串
└ quantitystring可选下单数量
└ statusstring可选订单状态。可选值:`NotReported`、`ReplacedNotReported`、`ProtectedNotReported`、`VarietiesNotReported`、`DelayedNotReported`、`FilledStatus`、`WaitToNew`、`NewStatus`、`WaitToReplace`、`PendingReplaceStatus`、`ReplacedStatus`、`PartialFilledStatus`、`WaitToCancel`、`PendingCancelStatus`、`RejectedStatus`、`CanceledStatus`、`ExpiredStatus`、`PartialWithdrawal`。
└ msgstring可选拒绝信息或备注,默认为空字符串。
└ timestring必填发生时间
charge_detailobject必填订单费用
└ total_amountstring必填全部费用
└ currencystring可选结算货币
└ itemsobject[]必填订单费用明细
└ limit_depth_levelint32必填指定买卖档位
└ monitor_pricestring可选监控价格
└ trigger_countint32必填触发次数
└ attached_ordersobject[]可选附加订单详情列表
multi_legobject可选多腿策略信息,仅多腿期权组合订单返回,非组合订单不返回。
└ strategystring可选多腿策略 **可选值:** `0` - CoveredCall(股票担保)`1` - CoveredPut(股票担保)`2` - VerticalCallSpread(垂直策略)`3` - VerticalPutSpread(垂直策略)`4` - Collar(领式策略)`5` - Straddle(跨式策略)`6` - Strangle(宽跨式策略)`7` - CalendarCallSpread(日历策略)`8` - CalendarPutSpread(日历策略)
└ strategy_namestring可选策略名称
└ multileg_idstring可选多腿组合 ID
└ codestring可选多腿组合代码
└ legsobject[]可选组合订单的各腿

响应 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"
        }
      ]
    }
  }
}

错误码

参见错误码文档。