# Submit Order

`POST` `/v1/trade/order`

This API is used to submit order for HK and US stocks, warrant and option.

## Parameters

### Request Body

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `symbol` | string | Yes | Stock symbol, use `ticker.region` format, example: `AAPL.US` |
| `order_type` | string | Yes | Order Type. One of: `LO`, `ELO`, `MO`, `AO`, `ALO`, `ODD`, `LIT`, `MIT`, `TSLPAMT`, `TSLPPCT`, `SLO`. |
| `submitted_price` | string | No | Submitted price, example: `388.5`. `LO` / `ELO` / `ALO` / `ODD` / `LIT` Order Required |
| `submitted_quantity` | string | Yes | Submitted quantity, example: `100`. US stocks accept fractional quantities, such as `0.05`. Fractional US orders must set `outside_rth` to `RTH_ONLY`; otherwise the order is rejected with error code `603200`. |
| `trigger_price` | string | No | Trigger price, example: `388.5`. `LIT` / `MIT` Order Required |
| `limit_offset` | string | No | Limit offset amount. `TSLPAMT` / `TSLPPCT` Order Required when`limit_depth_level` is set to 0 |
| `trailing_amount` | string | No | Trailing amount. `TSLPAMT` Order Required |
| `trailing_percent` | string | No | Trailing percent. `TSLPPCT` Order Required |
| `expire_date` | string | No | Long term order expire date, format `YYYY-MM-DD`, example: `2022-12-05`. Required when `time_in_force` is `GTD` |
| `side` | string | Yes | Order Side. **Enum Value:**, `Buy`, `Sell` |
| `outside_rth` | string | No | Enable or disable outside regular trading hours. **Enum Value:**, `RTH_ONLY` - regular trading hour only, `ANY_TIME` - any time, `OVERNIGHT` - Overnight, `OPTION_PRE_MARKET` - Overnight option |
| `time_in_force` | string | Yes | Time in force Type. **Enum Value:**, `Day` - Day Order, `GTC` - Good Til Canceled Order, `GTD` - Good Til Date Order |
| `remark` | string | No | remark (Maximum 255 characters) |
| `limit_depth_level` | integer | No | Specifies the bid/ask depth level. Value range is -5 ~ 0 ~ 5. Negative numbers indicate bid levels (e.g. -1 means best bid level 1), positive numbers indicate ask levels (e.g. 1 means best ask level 1). When set to 0, the `limit_offset` parameter takes effect. Valid for `TSLPAMT` / `TSLPPCT` orders |
| `monitor_price` | string | No | Monitoring price. Monitoring starts only after reaching this price, updating the reference price. Valid for `TSLPAMT` / `TSLPPCT` orders |
| `trigger_count` | integer | No | Number of triggers. Value range is 0 ~ 3. Specifies that within 1 minute, the order will only be placed after being triggered multiple times. Valid for `LIT` / `MIT` / `TSLPAMT` / `TSLPPCT` orders |
| `client_request_id` | string | No | Idempotent request ID for preventing duplicate order submissions. The server caches this request ID for 10 minutes. If a request with the same ID is received within this period, it returns the same response without creating a duplicate order. Must be a unique identifier (e.g., UUID). |
| `attached_params` | object | No | Attached order parameters (take-profit / stop-loss) |
| `attached_params.attached_order_type` | string | No | Attached order type. **Enum Value:**, `PROFIT_TAKER` - Take Profit, `STOP_LOSS` - Stop Loss, `BRACKET` - Bracket Order |
| `attached_params.profit_taker_price` | string | No | Take-profit trigger price |
| `attached_params.stop_loss_price` | string | No | Stop-loss trigger price |
| `attached_params.time_in_force` | string | No | Attached order time in force type. **Enum Value:**, `Day` - Day Order, `GTC` - Good Til Canceled Order, `GTD` - Good Til Date Order (inherits the main order's `expire_date` in this case) |
| `attached_params.expire_time` | integer | No | Expire time (Unix timestamp, in seconds) |
| `attached_params.activate_order_type` | string | No | Order type submitted after triggering, e.g. `LIT` (limit-if-touched) or `MIT` (market-if-touched) |
| `attached_params.profit_taker_submit_price` | string | No | Take-profit limit order submitted price, required when `activate_order_type` is `LIT` |
| `attached_params.stop_loss_submit_price` | string | No | Stop-loss limit order submitted price, required when `activate_order_type` is `LIT` |
| `attached_params.activate_rth` | string | No | Whether the order submitted after triggering allows pre/post market trading. **Enum Value:**, `RTH_ONLY` - Regular trading hours only, `ANY_TIME` - Any time |
| `attached_params.profit_taker_depth_level` | integer | No | Specifies the bid/ask depth level for the take-profit limit order submitted price, valid when `activate_order_type` is `LIT` |
| `attached_params.stop_loss_depth_level` | integer | No | Specifies the bid/ask depth level for the stop-loss limit order submitted price, valid when `activate_order_type` is `LIT` |

## Request Example

```bash
curl --request POST \
  --url 'https://openapi.longbridge.com/v1/trade/order' \
  --header 'Authorization: Bearer <access_token>' \
  --header 'Content-Type: application/json' \
  --data '{"symbol":"<symbol>","order_type":"<order_type>","submitted_price":"<submitted_price>","submitted_quantity":"<submitted_quantity>","trigger_price":"<trigger_price>","limit_offset":"<limit_offset>","trailing_amount":"<trailing_amount>","trailing_percent":"<trailing_percent>","expire_date":"<expire_date>","side":"<side>","outside_rth":"<outside_rth>","time_in_force":"<time_in_force>","remark":"<remark>","limit_depth_level":0,"monitor_price":"<monitor_price>","trigger_count":0,"client_request_id":"<client_request_id>","attached_params":{"attached_order_type":"<attached_order_type>","profit_taker_price":"<profit_taker_price>","stop_loss_price":"<stop_loss_price>","time_in_force":"<time_in_force>","expire_time":0,"activate_order_type":"<activate_order_type>","profit_taker_submit_price":"<profit_taker_submit_price>","stop_loss_submit_price":"<stop_loss_submit_price>","activate_rth":"<activate_rth>"}}'
```

## Response

### Response JSON Example

```json
{
  "code": 0,
  "message": "success",
  "data": {
    "order_id": 683615454870679600
  }
}
```
