# 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                                                                             |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://hdsd2.entrade.com.vn/entrade-api/tai-lieu-api-cu/4.-giao-dich-phai-sinh/4.9.-dat-lenh-dieu-kien.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
