> 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/9.-lay-chi-tiet-lenh.md).

# 9. Lấy chi tiết lệnh

* **URL:**
  * PROD: <https://services.entrade.com.vn/entrade-api/derivative/orders/:orderId>
  * PAPERTRADE: <https://services.entrade.com.vn/papertrade-entrade-api/derivative/orders/:orderId>
* **Method:** `GET`
* **Description:** Lấy chi tiết lệnh
* **Parameters:**
  * `orderId`: Id lệnh cần lấy chi tiết
* **Query parameters: None**
* **Response:**

```
{  
    "id": 1110909,
    "side": "NB",
    "investorId": 1000000036,
    "investorAccountId": 1000000036,
    "bankId": 10000,
    "bankAccountId": 1000040,
    "symbol": "VN30F2512",
    "price": 1920.9,
    "quantity": 1,
    "orderType": "LO",
    "orderStatus": "PendingNew",
    "fillQuantity": 0,
    "lastQuantity": 0,
    "lastPrice": 0.0,
    "averagePrice": 0.0,
    "createdDate": "2025-11-27T07:48:27.349Z",
    "modifiedDate": "2025-11-27T07:48:32.495Z",
    "bankMarginPortfolioId": 34,
    "dealId": 0,
    "tradingFee": 0.0,
    "tradingTax": 0.0,
    "orderSecure": 9604500.0,
    "priceSecure": 1920.9,
    "marginRate": 0.05,
    "quantitySecure": 1,
    "leavesQuantity": 0,
    "externalId": "117_1110909_1",
    "error": "CAN_NOT_CANCEL_PENDINGNEW_ORDER_IN_OPEN_SESSION-Cannot cancel Pending New order in Open session",
    "maker": "0013000000",
    "version": 2,
    "type": "DERIVATIVE",
    "fillValue": 0.0     
}
```

* **Mô tả các field quan trọng:**
  * `id`: id của lệnh đặt
  * `side`
    * `NB`: Long
    * `NS`: Short
  * `orderStatus`: trạng thái lệnh đặt
    * `PendingNew`: chờ gửi
    * `New`: chờ khớp
    * `PartiallyFilled`: khớp 1 phần
    * `Filled`: khớp
    * `Rejected`: tư chối
    * `Canceled`: huỷ
  * `quantity`: KL lệnh
  * `fillQuantity`: KL khớp
  * `lastQuantity`: KL khớp cuối cùng
  * `averagePrice`: giá trung bình khớp của lệnh
  * `bankMarginPortfolioId`: gói vay của lệnh
  * `price`: giá đặt lệnh
  * `lastPrice`: giá khớp cuối cùng
