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

# Sổ lệnh

> Lấy sổ lệnh giao dịch trong ngày theo từng thị trường cơ sở hoặc phái sinh, bao gồm trạng thái và thông tin xử lý của từng lệnh.



## OpenAPI

````yaml https://cdn.entrade.com.vn/dnse-openapi/doc/dnse-openapi-2026-05-07.yaml get /accounts/{accountNo}/orders
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:
    parameters:
      - name: accountNo
        in: path
        required: true
        description: Số tiểu khoản
        deprecated: false
        schema:
          type: string
        example: '0001179019'
    get:
      tags:
        - account
      summary: Sổ lệnh
      description: >-
        Lấy sổ lệnh giao dịch trong ngày theo từng thị trường cơ sở hoặc phái
        sinh, bao gồm trạng thái và thông tin xử lý của từng lệnh.
      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: STOCK
        - 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
          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: 641
            Date:
              schema:
                type: string
              example: Tue, 24 Mar 2026 03:32:29 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:
                  orders:
                    type: array
                    example:
                      - id: 141
                        side: NB
                        accountNo: '0001179019'
                        symbol: BCM
                        price: 51200
                        priceSecure: 51200
                        averagePrice: 0
                        quantity: 300
                        fillQuantity: 0
                        canceledQuantity: 0
                        leaveQuantity: 300
                        orderType: LO
                        orderCategory: NORMAL
                        orderStatus: New
                        loanPackageId: 7937
                        marketType: STOCK
                        transDate: '2026-03-16'
                        createdDate: '2026-03-24T03:15:22.226297778Z'
                        modifiedDate: '2026-03-24T03:15:22.358568266Z'
                    description: Danh sách lệnh giao dịch
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 141
                          description: Id lệnh giao dịch
                          format: int32
                        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: BCM
                          description: Mã chứng khoán
                        price:
                          type: number
                          example: 51200
                          description: Giá đặt
                          format: double
                        priceSecure:
                          type: number
                          example: 51200
                          description: Giá dùng để kiểm tra sức mua/đặt lệnh
                          format: double
                        averagePrice:
                          type: number
                          example: 0
                          description: Giá khớp trung bình
                          format: double
                        quantity:
                          type: integer
                          example: 300
                          description: Khối lượng đặt
                          format: int32
                        fillQuantity:
                          type: integer
                          example: 0
                          description: Khối lượng đã khớp
                          format: int32
                        canceledQuantity:
                          type: integer
                          example: 0
                          description: Khối lượng đã hủy
                          format: int32
                        leaveQuantity:
                          type: integer
                          example: 300
                          description: Khối lượng còn lại
                          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ờ
                        orderCategory:
                          type: string
                          example: NORMAL
                          description: >-
                            Phân loại lệnh thường, lệnh điều kiện (mặc định
                            NORMAL)
                        orderStatus:
                          type: string
                          example: New
                          description: >-
                            Trạng thái lệnh

                            - Pending/PendingNew: Chờ gửi

                            - New: Chờ khớp

                            - PendingReplace: Chờ sửa

                            - PendingCancel: Chờ hủy

                            - PartiallyFilled: Khớp một phần

                            - Filled: Khớp toàn bộ

                            - Canceled: Đã hủy

                            - 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
                        loanPackageId:
                          type: integer
                          example: 7937
                          description: Gói vay áp dụng cho mã chứng khoán
                          format: int32
                        marketType:
                          type: string
                          example: STOCK
                          description: |-
                            Loại thị trường
                            STOCK: Lệnh cơ sở
                            DERIVATIVE: Lệnh phái sinh
                        transDate:
                          type: string
                          example: '2026-03-16'
                          description: Ngày giao dịch
                        createdDate:
                          type: string
                          example: '2026-03-24T03:15:22.226297778Z'
                          description: Thời điểm tạo
                          format: date-time
                        modifiedDate:
                          type: string
                          example: '2026-03-24T03:15:22.358568266Z'
                          description: Thời điểm cập nhật
                          format: date-time
              example:
                orders:
                  - id: 141
                    side: NB
                    accountNo: '0001179019'
                    symbol: BCM
                    price: 51200
                    priceSecure: 51200
                    averagePrice: 0
                    quantity: 300
                    fillQuantity: 0
                    canceledQuantity: 0
                    leaveQuantity: 300
                    orderType: LO
                    orderCategory: NORMAL
                    orderStatus: New
                    loanPackageId: 7937
                    marketType: STOCK
                    transDate: '2026-03-16'
                    createdDate: '2026-03-24T03:15:22.226297778Z'
                    modifiedDate: '2026-03-24T03:15:22.358568266Z'
        '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:
                  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.