> ## 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 trạng thái lệnh

> Lấy lịch sử các lần cập nhật trạng thái hay khớp từng phần của một lệnh giao dịch theo `orderId` , chỉ áp dụng cho lệnh phái sinh.



## OpenAPI

````yaml https://cdn.entrade.com.vn/dnse-openapi/doc/dnse-openapi-2026-05-07.yaml get /accounts/{accountNo}/executions/{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}/executions/{orderId}:
    parameters:
      - name: accountNo
        in: path
        required: true
        description: Số tiểu khoản
        schema:
          type: integer
        example: 1179019
      - name: orderId
        in: path
        required: true
        description: Id lệnh giao dịch
        schema:
          type: integer
        example: 1651
    get:
      tags:
        - account
      summary: Chi tiết trạng thái lệnh
      description: >-
        Lấy lịch sử các lần cập nhật trạng thái hay khớp từng phần của một lệnh
        giao dịch theo `orderId` , chỉ áp dụng cho lệnh phái sinh.
      parameters:
        - name: marketType
          in: query
          required: true
          description: |-
            Loại thị trường 
            - STOCK: Lệnh cơ sở
            - DERIVATIVE: 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 (mặc định NORMAL)
          deprecated: false
          schema:
            type: string
          example: NORMAL
        - name: X-API-Key
          in: header
          required: true
          description: API Key được cấp khi đăng ký dịch vụ
          deprecated: false
          schema:
            type: string
          example: '{{apiKey}}'
        - name: X-Aux-Date
          in: header
          required: true
          description: Thời gian thực hiện yêu cầu
          deprecated: false
          schema:
            type: string
          example: '{{date}}'
        - name: X-Signature
          in: header
          required: true
          description: Chữ ký xác thực yêu cầu
          deprecated: false
          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: 2628
            Date:
              schema:
                type: string
              example: Wed, 08 Apr 2026 06:28:59 GMT
            Vary:
              schema:
                type: string
              example: Origin
            X-Ratelimit-Limit:
              schema:
                type: integer
              example: 100000
            X-Ratelimit-Remaining:
              schema:
                type: integer
              example: 99998
            X-Ratelimit-Reset:
              schema:
                type: integer
              example: 1775715087
            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
                    format: int32
                    example: 1651
                    description: ID lệnh
                  side:
                    type: string
                    example: NB
                    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: HPG
                    description: Mã chứng khoán
                  price:
                    type: integer
                    format: int32
                    example: 24250
                    description: Giá đặt lệnh
                  quantity:
                    type: integer
                    format: int32
                    example: 500
                    description: Khối lượng đặt lệnh
                  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
                    format: int32
                    example: 5757
                    description: Mã gói vay
                  orderCategory:
                    type: string
                    example: NORMAL
                    description: Phân loại lệnh (mặc định NORMAL)
                  orderStatus:
                    type: string
                    example: PartiallyFilled
                    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
                    format: int32
                    example: 200
                    description: Khối lượng đã khớp
                  lastQuantity:
                    type: integer
                    format: int32
                    example: 100
                    description: Khối lượng khớp gần nhất
                  lastPrice:
                    type: integer
                    format: int32
                    example: 24250
                    description: Giá khớp gần nhất
                  averagePrice:
                    type: integer
                    format: int32
                    example: 24250
                    description: Giá khớp trung bình
                  transDate:
                    type: string
                    example: '2026-07-13'
                    description: Ngày giao dịch
                  taxRate:
                    type: integer
                    format: int32
                    example: 0
                    description: Tỷ lệ thuế
                  exchangeFeeRate:
                    type: number
                    format: double
                    example: 0.00027
                    description: Tỷ lệ phí trả Sở giao dịch
                  feeRate:
                    type: number
                    format: double
                    example: 0.00027
                    description: Tổng tỷ lệ phí của lệnh
                  leaveQuantity:
                    type: integer
                    format: int32
                    example: 300
                    description: Khối lượng còn lại chưa khớp
                  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: STOCK
                    description: |-
                      Loại thị trường
                      - STOCK: Lệnh cơ sở
                      - DERIVATIVE: Lệnh phái sinh
                  priceSecure:
                    type: integer
                    format: int32
                    example: 24250
                    description: Giá dùng để kiểm tra sức mua/đặt lệnh
                  createdDate:
                    type: string
                    format: date-time
                    example: '2026-07-13T06:50:36.532741Z'
                    description: Thời điểm tạo lệnh
                  modifiedDate:
                    type: string
                    format: date-time
                    example: '2026-07-13T06:50:59.052768Z'
                    description: Thời điểm cập nhật lệnh
                  metadata:
                    type: string
                    example: >-
                      {"orderSession":"OPEN","ip":"202.60.110.58","maker":"1000005917","isForeigner":false,"reqId":"24534","probType":"CUSTOMER_8000","eventNo":4.0}
                    description: Thông tin bổ sung của lệnh
                  reports:
                    type: array
                    description: Danh sách trạng thái lệnh theo từng lần cập nhật
                    example:
                      - id: 1651
                        side: NB
                        accountNo: '0001179019'
                        symbol: HPG
                        price: 24250
                        quantity: 500
                        orderType: LO
                        orderStatus: PartiallyFilled
                        fillQuantity: 100
                        lastQuantity: 100
                        lastPrice: 24250
                        averagePrice: 24250
                        transDate: '2026-07-13'
                        createdDate: '2026-07-13T06:50:36.532741Z'
                        modifiedDate: '2026-07-13T06:50:51.613222Z'
                        taxRate: 0
                        exchangeFeeRate: 0
                        feeRate: 0.00027
                        leaveQuantity: 400
                        canceledQuantity: 0
                        error: ''
                        priceSecure: 24250
                        metadata: >-
                          {"orderSession":"OPEN","ip":"202.60.110.58","maker":"1000005917","isForeigner":false,"reqId":"24534","probType":"CUSTOMER_8000","eventNo":3}
                        loanPackageId: 5757
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          format: int32
                          example: 1651
                          description: ID lệnh
                        side:
                          type: string
                          example: NB
                          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: HPG
                          description: Mã chứng khoán
                        price:
                          type: integer
                          format: int32
                          example: 24250
                          description: Giá đặt lệnh
                        quantity:
                          type: integer
                          format: int32
                          example: 500
                          description: Khối lượng đặt lệnh
                        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ờ
                        orderStatus:
                          type: string
                          example: PartiallyFilled
                          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
                          format: int32
                          example: 100
                          description: Khối lượng đã khớp
                        lastQuantity:
                          type: integer
                          format: int32
                          example: 100
                          description: Khối lượng khớp gần nhất
                        lastPrice:
                          type: integer
                          format: int32
                          example: 24250
                          description: Giá khớp gần nhất
                        averagePrice:
                          type: integer
                          format: int32
                          example: 24250
                          description: Giá khớp trung bình
                        transDate:
                          type: string
                          example: '2026-07-13'
                          description: Ngày giao dịch
                        createdDate:
                          type: string
                          format: date-time
                          example: '2026-07-13T06:50:36.532741Z'
                          description: Thời điểm tạo lệnh
                        modifiedDate:
                          type: string
                          format: date-time
                          example: '2026-07-13T06:50:51.613222Z'
                          description: Thời điểm cập nhật lệnh
                        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: number
                          format: double
                          example: 0.00027
                          description: Tổng tỷ lệ phí của lệnh
                        leaveQuantity:
                          type: integer
                          format: int32
                          example: 400
                          description: Khối lượng còn lại chưa khớp
                        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
                        priceSecure:
                          type: integer
                          format: int32
                          example: 24250
                          description: Giá dùng để kiểm tra sức mua/đặt lệnh
                        metadata:
                          type: string
                          example: >-
                            {"orderSession":"OPEN","ip":"202.60.110.58","maker":"1000005917","isForeigner":false,"reqId":"24534","probType":"CUSTOMER_8000","eventNo":3}
                          description: Thông tin bổ sung của lệnh
                        loanPackageId:
                          type: integer
                          format: int32
                          example: 5757
                          description: Mã gói vay
              example:
                id: 1651
                side: NB
                accountNo: '0001179019'
                symbol: HPG
                price: 24250
                quantity: 500
                orderType: LO
                loanPackageId: 5757
                orderCategory: NORMAL
                orderStatus: PartiallyFilled
                fillQuantity: 200
                lastQuantity: 100
                lastPrice: 24250
                averagePrice: 24250
                transDate: '2026-07-13'
                taxRate: 0
                exchangeFeeRate: 0.00027
                feeRate: 0.00027
                leaveQuantity: 300
                canceledQuantity: 0
                error: ''
                marketType: STOCK
                priceSecure: 24250
                createdDate: '2026-07-13T06:50:36.532741Z'
                modifiedDate: '2026-07-13T06:50:59.052768Z'
                metadata: >-
                  {"orderSession":"OPEN","ip":"202.60.110.58","maker":"1000005917","isForeigner":false,"reqId":"24534","probType":"CUSTOMER_8000","eventNo":4.0}
                reports:
                  - id: 1651
                    side: NB
                    accountNo: '0001179019'
                    symbol: HPG
                    price: 24250
                    quantity: 500
                    orderType: LO
                    orderStatus: PartiallyFilled
                    fillQuantity: 100
                    lastQuantity: 100
                    lastPrice: 24250
                    averagePrice: 24250
                    transDate: '2026-07-13'
                    createdDate: '2026-07-13T06:50:36.532741Z'
                    modifiedDate: '2026-07-13T06:50:51.613222Z'
                    taxRate: 0
                    exchangeFeeRate: 0
                    feeRate: 0.00027
                    leaveQuantity: 400
                    canceledQuantity: 0
                    error: ''
                    priceSecure: 24250
                    metadata: >-
                      {"orderSession":"OPEN","ip":"202.60.110.58","maker":"1000005917","isForeigner":false,"reqId":"24534","probType":"CUSTOMER_8000","eventNo":3}
                    loanPackageId: 5757
                  - id: 1651
                    side: NB
                    accountNo: '0001179019'
                    symbol: HPG
                    price: 24250
                    quantity: 500
                    orderType: LO
                    orderStatus: PartiallyFilled
                    fillQuantity: 100
                    lastQuantity: 100
                    lastPrice: 24250
                    averagePrice: 24250
                    transDate: '2026-07-13'
                    createdDate: '2026-07-13T06:50:36.532741Z'
                    modifiedDate: '2026-07-13T06:50:51.613222Z'
                    taxRate: 0
                    exchangeFeeRate: 0
                    feeRate: 0.00027
                    leaveQuantity: 400
                    canceledQuantity: 0
                    error: ''
                    priceSecure: 24250
                    metadata: >-
                      {"orderSession":"OPEN","ip":"202.60.110.58","maker":"1000005917","isForeigner":false,"reqId":"24534","probType":"CUSTOMER_8000","eventNo":3}
                    loanPackageId: 5757
                  - id: 1651
                    side: NB
                    accountNo: '0001179019'
                    symbol: HPG
                    price: 24250
                    quantity: 500
                    orderType: LO
                    orderStatus: PendingNew
                    fillQuantity: 0
                    lastQuantity: 0
                    lastPrice: 0
                    averagePrice: 0
                    transDate: '2026-07-13'
                    createdDate: '2026-07-13T06:50:36.532741Z'
                    modifiedDate: '2026-07-13T06:50:36.532743Z'
                    taxRate: 0
                    exchangeFeeRate: 0
                    feeRate: 0.00027
                    leaveQuantity: 500
                    canceledQuantity: 0
                    error: <no value>
                    priceSecure: 24250
                    metadata: >-
                      {"orderSession":"OPEN","ip":"202.60.110.58","maker":"1000005917","isForeigner":false,"reqId":"24534","probType":"CUSTOMER_8000","eventNo":1}
                    loanPackageId: 5757
                  - id: 1651
                    side: NB
                    accountNo: '0001179019'
                    symbol: HPG
                    price: 24250
                    quantity: 500
                    orderType: LO
                    orderStatus: New
                    fillQuantity: 0
                    lastQuantity: 0
                    lastPrice: 0
                    averagePrice: 0
                    transDate: '2026-07-13'
                    createdDate: '2026-07-13T06:50:36.532741Z'
                    modifiedDate: '2026-07-13T06:50:36.545128Z'
                    taxRate: 0
                    exchangeFeeRate: 0
                    feeRate: 0.00027
                    leaveQuantity: 500
                    canceledQuantity: 0
                    error: ''
                    priceSecure: 24250
                    metadata: >-
                      {"orderSession":"OPEN","ip":"202.60.110.58","maker":"1000005917","isForeigner":false,"reqId":"24534","probType":"CUSTOMER_8000","eventNo":2}
                    loanPackageId: 5757
                  - id: 1651
                    side: NB
                    accountNo: '0001179019'
                    symbol: HPG
                    price: 24250
                    quantity: 500
                    orderType: LO
                    orderStatus: PartiallyFilled
                    fillQuantity: 200
                    lastQuantity: 100
                    lastPrice: 24250
                    averagePrice: 24250
                    transDate: '2026-07-13'
                    createdDate: '2026-07-13T06:50:36.532741Z'
                    modifiedDate: '2026-07-13T06:50:59.052768Z'
                    taxRate: 0
                    exchangeFeeRate: 0
                    feeRate: 0.00027
                    leaveQuantity: 300
                    canceledQuantity: 0
                    error: ''
                    priceSecure: 24250
                    metadata: >-
                      {"orderSession":"OPEN","ip":"202.60.110.58","maker":"1000005917","isForeigner":false,"reqId":"24534","probType":"CUSTOMER_8000","eventNo":4}
                    loanPackageId: 5757
        '400':
          description: Yêu cầu không hợp lệ
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                  message:
                    type: string
                  status:
                    type: integer
              example:
                code: OA-003
                message: Thông tin nhập không hợp lệ
                status: 400
        '500':
          description: Lỗi hệ thống
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                  message:
                    type: string
                  status:
                    type: integer
              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.