> For the complete documentation index, see [llms.txt](https://hdsd2.entrade.com.vn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hdsd2.entrade.com.vn/entrade-api/tai-lieu-api-cu/4.-giao-dich-phai-sinh/4.9.-dat-lenh-dieu-kien.md).

# 4.9. Đặt lệnh điều kiện

<table><thead><tr><th width="251">Type</th><th width="249">URL</th><th>Method</th></tr></thead><tbody><tr><td>Real</td><td><a href="https://services.entrade.com.vn/smart-order/orders">https://services.entrade.com.vn/smart-order/orders</a></td><td>POST</td></tr><tr><td>Demo</td><td><a href="https://services.entrade.com.vn/smart-order/orders">https://services.entrade.com.vn/papertrade-smart-order/orders</a></td><td>POST</td></tr></tbody></table>

#### Request header

| Field         | Type | Description                         |
| ------------- | ---- | ----------------------------------- |
| Authorization |      | Bearer \<JWT Token>                 |
| Trading-Token |      | Token được cấp sau khi xác thực OTP |

#### Request Body:

| Field                 | Type   | Description                                     |
| --------------------- | ------ | ----------------------------------------------- |
| investorId            | String | Mã khách hàng                                   |
| investorAccountId     | Int    | Mã tài khoản                                    |
| bankMarginPortfolioId | Double | Mã gói vay                                      |
| symbol                | String | Mã phái sinh (ví dụ “VN30F2504”)                |
| condition             | String | Điều kiện đặt lệnh (ví dụ “>= 1369”, “<= 1396”) |
| targetPrice           | Double | Giá đặt                                         |
| targetSide            | String | “NB” (Mua) hoặc “NS” (Bán)                      |
| targetQuantity        | Int    | Khối lượng đặt                                  |
| type                  | String | Chỉ nhận giá trị “STOP”                         |
| expiredTime           | String | Thời gian đóng lệnh                             |

#### Response Body: (trả lại tất cả thông tin trong request body, và bổ sung thêm)

| Field        | Type   | Description                                                                                                                  |
| ------------ | ------ | ---------------------------------------------------------------------------------------------------------------------------- |
| id           | String | Số hiệu lệnh                                                                                                                 |
| status       | String | “PendingTrigger”, “Canceled” hoặc “Triggered”                                                                                |
| createdDate  | String | <p>Thời điểm (ngày giờ) đặt lệnh, theo định dạng ISO UTC 8601 format datetime</p><p>Ví dụ: 2022-07-15T10:00:00.111+07:00</p> |
| modifiedDate | String | Thời điểm (ngày giờ) thay đổi cuối cùng của lệnh                                                                             |
