# Order Details

`GET` `/v1/trade/order`

This API is used for order detail query

## Parameters

### Query Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `order_id` | string | Yes | Order ID for specifying order ID query, for example: `701276261045858304` |
| `is_attached` | boolean | No | Whether `order_id` refers to an attached order |

## Request Example

```bash
curl --request GET \
  --url 'https://openapi.longbridge.com/v1/trade/order?order_id=<order_id>' \
  --header 'Authorization: Bearer <access_token>'
```

## Response

### Response Properties

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `order_id` | string | No | Order ID |
| `status` | string | No | Order Status. One of: `NotReported`, `ReplacedNotReported`, `ProtectedNotReported`, `VarietiesNotReported`, `DelayedNotReported`, `FilledStatus`, `WaitToNew`, `NewStatus`, `WaitToReplace`, `PendingReplaceStatus`, `ReplacedStatus`, `PartialFilledStatus`, `WaitToCancel`, `PendingCancelStatus`, `RejectedStatus`, `CanceledStatus`, `ExpiredStatus`, `PartialWithdrawal`. |
| `stock_name` | string | No | Stock Name |
| `quantity` | string | No | Submitted Quantity |
| `executed_quantity` | string | No | Executed Quantity. when the order is not filled, value is 0 |
| `price` | string | No | Submitted Price. when market condition order is not triggered, value is empty string |
| `executed_price` | string | No | Executed Price. when the order is not filled, value is 0 |
| `submitted_at` | string | No | Submitted Time |
| `side` | string | No | Order Side. **Enum Value:**, `Buy`, `Sell` |
| `symbol` | string | No | Stock symbol, use `ticker.region` format, example: `AAPL.US` |
| `order_type` | string | No | Order Type. One of: `LO`, `ELO`, `MO`, `AO`, `ALO`, `ODD`, `LIT`, `MIT`, `TSLPAMT`, `TSLPPCT`, `SLO`. |
| `last_done` | string | No | Last done. when the order is not filled, value is empty string |
| `trigger_price` | string | No | `LIT` / `MIT` Order Trigger Price. When the order is not `LIT` / `MIT` order, value is empty string |
| `msg` | string | No | Rejected message or remark, default value is empty string. |
| `tag` | string | No | Order tag. **Enum Value**, `Normal` - Normal Order, `Gtc` - Long term Order, `Grey` - Grey Order |
| `time_in_force` | string | No | Time in force Type. **Enum Value:**, `Day` - Day Order, `GTC` - Good Til Canceled Order, `GTD` - Good Til Date Order |
| `expire_date` | string | No | 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 | No | Last updated time, formatted as a timestamp (second) |
| `trigger_at` | string | No | Conditional order trigger time. formatted as a timestamp (second) |
| `trailing_amount` | string | No | `TSLPAMT` order trailing amount. When the order is not `TSLPAMT` order, value is empty string |
| `trailing_percent` | string | No | `TSLPPCT` order trailing percent. When the order is not `TSLPPCT` order, value is empty string |
| `limit_offset` | string | No | `TSLPPCT` order limit offset amount. When the order is not `TSLPPCT` order, value is empty string |
| `trigger_status` | string | No | 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_USED`, `DEACTIVE`, `ACTIVE`, `RELEASED` |
| `currency` | string | No | Currency |
| `outside_rth` | string | No | Enable or disable outside regular trading hours, Default is `UnknownOutsideRth` when the order is not a US stock. **Enum Value:**, `RTH_ONLY` - Regular trading hour only, `ANY_TIME` - Any time, `OVERNIGHT` - Overnight" |
| `remark` | string | No | Remark |
| `free_status` | string | Yes | Commission-free Status, default value is None **Enum Value:** `None` - None `Calculated` - Commission-free amount to be calculated `Pending` - Pending commission-free `Ready` - Commission-free applied |
| `free_amount` | string | Yes | Commission-free amount, default value is empty string. |
| `free_currency` | string | Yes | Commission-free currency, default value is empty string. |
| `deductions_status` | string | Yes | Deduction status/Cashback Status, default value is NONE **Enum Value:** `NONE` - Pending Settlement `NO_DATA` - Settled with no data `PENDING` - Settled and pending distribution `DONE` - Settled and distributed |
| `deductions_amount` | string | Yes | Deduction amount, default value is empty string. |
| `deductions_currency` | string | Yes | Deduction currency, default value is empty string. |
| `platform_deducted_status` | string | Yes | Platform fee deduction status/Cashback Status, default value is NONE **Enum Value:** `NONE` - Pending Settlement `NO_DATA` - Settled with no data `PENDING` - Settled and pending distribution `DONE` - Settled and distributed |
| `platform_deducted_amount` | string | Yes | Platform fee deduction amount, default value is empty string. |
| `platform_deducted_currency` | string | Yes | Platform fee deduction currency, default value is empty string. |
| `history` | object[] | Yes | Order history details |
| `└ price` | string | No | Submitted Price. when market condition order is not triggered, value is empty string |
| `└ quantity` | string | No | Submitted Quantity |
| `└ status` | string | No | Order Status. One of: `NotReported`, `ReplacedNotReported`, `ProtectedNotReported`, `VarietiesNotReported`, `DelayedNotReported`, `FilledStatus`, `WaitToNew`, `NewStatus`, `WaitToReplace`, `PendingReplaceStatus`, `ReplacedStatus`, `PartialFilledStatus`, `WaitToCancel`, `PendingCancelStatus`, `RejectedStatus`, `CanceledStatus`, `ExpiredStatus`, `PartialWithdrawal`. |
| `└ msg` | string | No | Rejected message or remark, default value is empty string. |
| `└ time` | string | Yes | Occurrence time |
| `charge_detail` | object | Yes | Order charges |
| `└ total_amount` | string | Yes | Total charges amount |
| `└ currency` | string | No | Currency |
| `└ items` | object[] | Yes | Order charge details |
| `└ limit_depth_level` | int32 | Yes | Specifies the bid/ask depth level |
| `└ monitor_price` | string | No | Monitoring price |
| `└ trigger_count` | int32 | Yes | Number of triggers |
| `└ attached_orders` | object[] | No | List of attached order details |
| `multi_leg` | object | No | Multi-leg strategy information. Only returned for multi-leg option combination orders; otherwise not returned. |
| `└ strategy` | string | No | Multi-leg strategy **Enum Value:** `0` - CoveredCall (Covered stock) `1` - CoveredPut (Covered stock) `2` - VerticalCallSpread (Vertical spread) `3` - VerticalPutSpread (Vertical spread) `4` - Collar `5` - Straddle `6` - Strangle `7` - CalendarCallSpread (Calendar) `8` - CalendarPutSpread (Calendar) |
| `└ strategy_name` | string | No | Strategy name |
| `└ multileg_id` | string | No | Multi-leg combination ID |
| `└ code` | string | No | Multi-leg combination code |
| `└ legs` | object[] | No | Legs of the combination order |

### Response JSON Example

```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"
        }
      ]
    }
  }
}
```
