> 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.4.-so-lenh.md).

# 4.4. Sổ lệnh

| Type | URL                                                                                                                                                                                                                                                                                  | Method |
| ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------ |
| Real | [https://services.entrade.com.vn/entrade-api/derivative/orders?investorId=\<investorId>&\_start=\<startIndex>&\_end=\<endIndex>](https://services.entrade.com.vn/entrade-api/derivative/orders?investorAccountId=<investorAccountId>&_start=<startIndex>&_end=<endIndex>)            | GET    |
| Demo | [https://services.entrade.com.vn/papertrade-entrade-api/derivative/orders?investorId=\<investorId>&\_start=\<startIndex>&\_end=\<endIndex>](https://services.entrade.com.vn/entrade-api/derivative/orders?investorAccountId=<investorAccountId>&_start=<startIndex>&_end=<endIndex>) | GET    |

#### **Query param**

| Field                 | Type | Description                                           |
| --------------------- | ---- | ----------------------------------------------------- |
| **investorAccountId** |      | Mã tiểu khoản                                         |
| **startIndex**        |      | số index bắt đầu (lệnh đầu tiên bắt đầu từ index = 0) |
| **endIndex**          |      | số index kết thúc                                     |

#### **Resquest header**

| Field             | Type | Description         |
| ----------------- | ---- | ------------------- |
| **Authorization** |      | Bearer \<JWT token> |

#### **Response body**

| Field    | Type       | Description     |
| -------- | ---------- | --------------- |
| **data** | Order list | Danh sách order |

#### **Order**

| Field                     | Type                    | Description                                                                                                                                                                                                                                                                                                                                 |
| ------------------------- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **id**                    | integer                 | Số hiệu lệnh                                                                                                                                                                                                                                                                                                                                |
| **side**                  | string                  | <p>Lệnh Mua/Bán thuộc các giá trị sau: </p><p>- NB: Mua </p><p>- NS: Bán </p>                                                                                                                                                                                                                                                               |
| **investorAccountId**     | string                  | Mã tiểu khoản                                                                                                                                                                                                                                                                                                                               |
| **investorId**            | string                  | Mã Khách hàng                                                                                                                                                                                                                                                                                                                               |
| **symbol**                | string                  | Mã                                                                                                                                                                                                                                                                                                                                          |
| **price**                 | number                  | Giá đặt                                                                                                                                                                                                                                                                                                                                     |
| **quantity**              | integer                 | Khối lượng đặt                                                                                                                                                                                                                                                                                                                              |
| **orderType**             | string                  | <p>Loại lệnh, thuộc các giá trị sau: </p><p>- LO: lệnh giới hạn </p><p>- MTL: lệnh thị trường </p><p>- ATC/ATO: lệnh khớp phiên định kỳ đóng cửa/mở cửa </p><p>- PLO: lệnh khớp lệnh sau giờ </p>                                                                                                                                           |
| **orderStatus**           | string                  | <p>Trạng thái lệnh, thuộc các giá trị sau đây: </p><p>- pending: chờ gửi </p><p>- pendingNew: chờ gửi </p><p>- new: chờ khớp </p><p>- partiallyFilled: khớp một phần </p><p>- filled: khớp toàn bộ </p><p>- rejected: bị từ chối </p><p>- expired: bị hết hạn trong phiên </p><p>- doneForDay: lệnh hết hiệu lực khi hết phiên </p><p> </p> |
| **fillQuantity**          | integer                 | Khối lượng đã khớp                                                                                                                                                                                                                                                                                                                          |
| **lastQuantity**          | <p>integer </p><p> </p> | Khối lượng của lần khớp gần nhất của lệnh                                                                                                                                                                                                                                                                                                   |
| **lastPrice**             | number                  | Giá khớp của lần khớp gần nhất của lệnh                                                                                                                                                                                                                                                                                                     |
| **averagePrice**          | double                  | Giá khớp trung bình của lệnh                                                                                                                                                                                                                                                                                                                |
| **createdDate**           | string                  | <p>Thời điểm (ngày giờ) đặt lệnh, theo định dạng ISO UTC 8601 format datetime </p><p> </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                                                                                                                                                                                                                                                                                            |
| **bankMarginPortfolioId** | integer                 | Id gói vay                                                                                                                                                                                                                                                                                                                                  |
