> ## Documentation Index
> Fetch the complete documentation index at: https://hoalulab.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Chi tiết lệnh theo ID

> Lấy thông tin chi tiết của một lệnh giao dịch cụ thể theo `orderId`, bao gồm trạng thái, khối lượng, giá và các thông tin liên quan.



## OpenAPI

````yaml https://cdn.entrade.com.vn/dnse-openapi/doc/dnse-openapi-2026-05-07.yaml get /accounts/{accountNo}/orders/{orderId}
openapi: 3.0.0
info:
  title: DNSE-OpenAPI-V2
  version: 1.0.0
  description: DNSE OpenAPI spec and tests
servers:
  - url: https://openapi-uat.dnse.com.vn
security: []
paths:
  /accounts/{accountNo}/orders/{orderId}:
    parameters:
      - name: accountNo
        in: path
        required: true
        description: Số tiểu khoản
        deprecated: false
        schema:
          type: string
        example: '0001179019'
      - name: orderId
        in: path
        required: true
        description: Id lệnh giao dịch
        deprecated: false
        schema:
          type: integer
        example: 96
    get:
      tags:
        - trading
      summary: Chi tiết lệnh theo ID
      description: "Lấy thông tin chi tiết của một lệnh giao dịch cụ thể theo\_`orderId`, bao gồm trạng thái, khối lượng, giá và các thông tin liên quan."
      parameters:
        - name: marketType
          in: query
          required: true
          description: |-
            Loại thị trường 
            - STOCK: Sổ lệnh cơ sở
            - DERIVATIVE: Sổ lệnh phái sinh
          deprecated: false
          schema:
            type: string
          example: DERIVATIVE
        - name: orderCategory
          in: query
          required: true
          description: Phân loại lệnh thường, lệnh điều kiện (mặc định NORMAL)
          deprecated: false
          schema:
            type: string
          example: NORMAL
        - name: X-API-Key
          in: header
          description: API Key được cấp khi đăng ký dịch vụ
          schema:
            type: string
          example: '{{apiKey}}'
        - name: X-Aux-Date
          in: header
          description: Thời gian thực hiện yêu cầu
          schema:
            type: string
          example: '{{date}}'
        - name: X-Signature
          in: header
          description: Chữ ký xác thực yêu cầu
          schema:
            type: string
          example: '{{signature}}'
        - name: version
          in: header
          description: 'Phiên bản API '
          schema:
            type: string
            format: date
          example: '2026-05-07'
      responses:
        '200':
          description: OK
          headers:
            Content-Length:
              schema:
                type: integer
              example: 966
            Date:
              schema:
                type: string
              example: Tue, 24 Mar 2026 03:35:03 GMT
            Vary:
              schema:
                type: string
              example: Origin
            X-Ratelimit-Limit:
              schema:
                type: integer
              example: -1
            X-Ratelimit-Remaining:
              schema:
                type: integer
              example: 0
            X-Ratelimit-Reset:
              schema:
                type: integer
              example: 0
            X-Tyk-Api-Expires:
              schema:
                type: string
              example: Thu, 02 Jan 3000 15:04:00 UTC
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: integer
                    example: 966
                    description: ID lệnh
                    format: int32
                  side:
                    type: string
                    example: NS
                    description: |-
                      Chiều giao dịch
                      - NB: Mua
                      - NS: Bán
                  accountNo:
                    type: string
                    example: '0001179019'
                    description: Số tiểu khoản
                  symbol:
                    type: string
                    example: 41I1G4000
                    description: Mã hợp đồng phái sinh
                  price:
                    type: number
                    example: 1706.1
                    description: Giá đặt lệnh
                    format: double
                  quantity:
                    type: integer
                    example: 5
                    description: Khối lượng đặt lệnh
                    format: int32
                  orderType:
                    type: string
                    example: LO
                    description: |-
                      Loại lệnh
                      - LO: Lệnh giới hạn
                      - MOK/MAK/MTL: Lệnh thị trường
                      - ATO/ATC: Lệnh phiên định kỳ mở cửa/đóng cửa
                      - PLO: Lệnh khớp lệnh sau giờ
                  loanPackageId:
                    type: integer
                    example: 2278
                    description: Mã gói vay
                    format: int32
                  orderCategory:
                    type: string
                    example: NORMAL
                    description: Phân loại lệnh (mặc định NORMAL)
                  orderStatus:
                    type: string
                    example: Filled
                    description: |-
                      Trạng thái lệnh
                      - Pending/PendingNew: Chờ gửi
                      - New: Chờ khớp
                      - PartiallyFilled: Khớp một phần
                      - Filled: Khớp toàn bộ
                      - Rejected: Bị từ chối
                      - Expired: Hết hạn trong phiên
                      - DoneForDay: Lệnh được giải tỏa do không khớp trong phiên
                  fillQuantity:
                    type: integer
                    example: 5
                    description: Khối lượng đã khớp
                    format: int32
                  lastQuantity:
                    type: integer
                    example: 2
                    description: Khối lượng khớp gần nhất
                    format: int32
                  lastPrice:
                    type: number
                    example: 1706.1
                    description: Giá khớp gần nhất
                    format: double
                  averagePrice:
                    type: number
                    example: 1750.96
                    description: Giá khớp trung bình
                    format: double
                  transDate:
                    type: string
                    example: '2026-03-16'
                    description: Ngày giao dịch
                  taxRate:
                    type: integer
                    format: int32
                    example: 0
                    description: Tỷ lệ thuế
                  exchangeFeeRate:
                    type: integer
                    format: int32
                    example: 0
                    description: Tỷ lệ phí trả Sở giao dịch
                  feeRate:
                    type: integer
                    example: 0
                    description: Tổng tỷ lệ phí của lệnh
                    format: int32
                  leaveQuantity:
                    type: integer
                    example: 0
                    description: Khối lượng còn lại chưa khớp
                    format: int32
                  canceledQuantity:
                    type: integer
                    example: 0
                    description: Khối lượng đã hủy
                    format: int32
                  error:
                    type: string
                    example: ''
                    description: Mã lỗi nếu lệnh bị từ chối
                  marketType:
                    type: string
                    example: DERIVATIVE
                    description: |-
                      Loại thị trường
                      - STOCK: Sổ lệnh cơ sở
                      - DERIVATIVE: Sổ lệnh phái sinh
                  priceSecure:
                    type: number
                    example: 1706.1
                    description: Giá dùng để kiểm tra sức mua/đặt lệnh
                    format: double
                  createdDate:
                    type: string
                    example: '2026-03-23T03:10:06.556826794Z'
                    description: Thời điểm tạo lệnh
                    format: date-time
                  modifiedDate:
                    type: string
                    example: '2026-03-23T04:07:45.683977124Z'
                    description: Thời điểm cập nhật lệnh
                    format: date-time
                  metadata:
                    type: string
                    example: >-
                      {"orderSession":"OPEN","dealId":"1.77410795472387E14","releaseSecureOnFilled":"false","originMaker":"1000005917-close_deal_177410795472387","dtaAccountNo":"D000113702","isForeigner":false,"probType":"CUSTOMER","eventNo":5}
                    description: Thông tin bổ sung của lệnh
              example:
                id: 966
                side: NS
                accountNo: '0001179019'
                symbol: 41I1G4000
                price: 1706.1
                quantity: 5
                orderType: LO
                loanPackageId: 2278
                orderCategory: NORMAL
                orderStatus: Filled
                fillQuantity: 5
                lastQuantity: 2
                lastPrice: 1706.1
                averagePrice: 1750.96
                transDate: '2026-03-16'
                taxRate: 0
                exchangeFeeRate: 0
                feeRate: 0
                leaveQuantity: 0
                canceledQuantity: 0
                error: ''
                marketType: DERIVATIVE
                priceSecure: 1706.1
                createdDate: '2026-03-23T03:10:06.556826794Z'
                modifiedDate: '2026-03-23T04:07:45.683977124Z'
                metadata: >-
                  {"orderSession":"OPEN","dealId":"1.77410795472387E14","releaseSecureOnFilled":"false","originMaker":"1000005917-close_deal_177410795472387","dtaAccountNo":"D000113702","isForeigner":false,"probType":"CUSTOMER","eventNo":5}
        '400':
          description: Yêu cầu không hợp lệ
          headers:
            Content-Length:
              schema:
                type: integer
              example: 102
            Date:
              schema:
                type: string
              example: Wed, 25 Mar 2026 16:21:07 GMT
            Vary:
              schema:
                type: string
              example: Origin
            X-Ratelimit-Limit:
              schema:
                type: integer
              example: -1
            X-Ratelimit-Remaining:
              schema:
                type: integer
              example: 0
            X-Ratelimit-Reset:
              schema:
                type: integer
              example: 0
            X-Tyk-Api-Expires:
              schema:
                type: string
              example: Thu, 02 Jan 3000 15:04:00 UTC
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                  message:
                    type: string
                  status:
                    type: integer
              example:
                status: 400
                code: RESOURCE_NOT_FOUND
                message: 'OrderRepository: cannot find object with id: 96'
        '500':
          description: Lỗi hệ thống
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 500
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-009
                    description: Mã lỗi
                  message:
                    type: string
                    example: Lỗi hệ thống
                    description: Thông điệp lỗi
              example:
                code: OA-009
                message: Lỗi hệ thống
                status: 500

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.