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

# Lịch sử lệnh

> Lấy danh sách lệnh thường đã đặt trong một khoảng thời gian nhất định. Thời gian tra cứu tối đa trong vòng 1 năm kể từ ngày hiện tại.



## OpenAPI

````yaml https://cdn.entrade.com.vn/dnse-openapi/doc/dnse-openapi-2026-07-23.yaml get /accounts/{accountNo}/orders/history
openapi: 3.0.0
info:
  title: OpenAPI-V2-Spec 260730
  version: 1.0.0
  description: DNSE OpenAPI spec and tests
servers:
  - url: https://openapi-uat.dnse.com.vn
security: []
paths:
  /accounts/{accountNo}/orders/history:
    parameters:
      - name: accountNo
        in: path
        required: true
        description: Số tiểu khoản
        deprecated: false
        schema:
          type: string
        example: '0001179019'
    get:
      tags:
        - account
      summary: Lịch sử lệnh
      description: >-
        Lấy danh sách lệnh thường đã đặt trong một khoảng thời gian nhất định.
        Thời gian tra cứu tối đa trong vòng 1 năm kể từ ngày hiện tại.
      parameters:
        - name: marketType
          in: query
          required: true
          description: |-
            Loại thị trường 
            - STOCK: Gói vay giao dịch cơ sở
            - DERIVATIVE: Gói vay giao dịch phái sinh
          deprecated: false
          schema:
            type: string
          example: STOCK
        - name: from
          in: query
          required: true
          description: |-
            Ngày bắt đầu (yyyy-mm-dd) 
            - Thời gian tra cứu tối đa trong 1 năm tính từ ngày hiện tại
          deprecated: false
          schema:
            type: string
          example: '2026-02-15'
        - name: to
          in: query
          required: true
          description: |-
            Ngày kết thúc (yyyy-mm-dd) 
            - Lớn hơn hoặc bằng ngày bắt đầu và không vượt quá ngày hiện tại
          deprecated: false
          schema:
            type: string
          example: '2026-03-18'
        - 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: API version (YYYY-MM-DD)
          schema:
            type: string
          example: '2026-07-23'
      responses:
        '200':
          description: OK
          headers:
            Content-Length:
              schema:
                type: integer
              example: 4093
            Date:
              schema:
                type: string
              example: Tue, 24 Mar 2026 03:40:59 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:
                  accountNo:
                    type: string
                    example: '0001179019'
                    description: Số tiểu khoản
                  fillQuantity:
                    type: integer
                    example: 0
                    description: Tổng khối lượng đã khớp
                    format: int32
                  total:
                    type: integer
                    example: 8
                    description: Tổng số bản ghi
                    format: int32
                  start:
                    type: integer
                    example: 0
                    description: Vị trí bắt đầu của tập bản ghi được trả về
                    format: int32
                  end:
                    type: integer
                    example: 8
                    description: Vị trí kết thúc của tập bản ghi được trả về
                    format: int32
                  marketType:
                    type: string
                    example: STOCK
                    description: |-
                      Loại thị trường
                      - STOCK: Gói vay giao dịch cơ sở
                      - DERIVATIVE: Gói vay giao dịch phái sinh
                  data:
                    type: array
                    example:
                      - id: 20260312_241
                        symbol: HPG
                        side: NB
                        orderType: LO
                        orderStatus: Expired
                        price: 27200
                        quantity: 200
                        fillQuantity: 0
                        leaveQuantity: 0
                        canceledQuantity: 200
                        averagePrice: 0
                        loanPackageId: 5765
                        transDate: '2026-03-12'
                        createdDate: '2026-03-17T06:44:18.813804Z'
                        modifiedDate: '2026-03-18T15:28:24.44026Z'
                    description: Danh sách lệnh giao dịch
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          example: 20260312_241
                          description: ID lệnh trên hệ thống
                        symbol:
                          type: string
                          example: HPG
                          description: Mã chứng khoán
                        side:
                          type: string
                          example: NB
                          description: |-
                            Chiều giao dịch
                            NB: Mua
                            NS: Bán
                        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: Expired
                          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
                        price:
                          type: integer
                          example: 27200
                          description: Giá đặt
                          format: int32
                        quantity:
                          type: integer
                          example: 200
                          description: Khối lượng đặt
                          format: int32
                        fillQuantity:
                          type: integer
                          example: 0
                          description: Khối lượng đã khớp
                          format: int32
                        leaveQuantity:
                          type: integer
                          example: 0
                          description: Khối lượng còn lại
                          format: int32
                        canceledQuantity:
                          type: integer
                          example: 200
                          description: Khối lượng đã huỷ
                          format: int32
                        averagePrice:
                          type: integer
                          format: int32
                          example: 0
                          description: Giá khớp trung bình
                        loanPackageId:
                          type: integer
                          example: 5765
                          description: ID gói vay
                          format: int32
                        transDate:
                          type: string
                          example: '2026-03-12'
                          description: Ngày giao dịch
                        createdDate:
                          type: string
                          example: '2026-03-17T06:44:18.813804Z'
                          description: Thời điểm tạo
                          format: date-time
                        modifiedDate:
                          type: string
                          example: '2026-03-18T15:28:24.44026Z'
                          description: Thời điểm cập nhật
                          format: date-time
              example:
                accountNo: '0001179019'
                fillQuantity: 0
                total: 8
                start: 0
                end: 8
                marketType: STOCK
                data:
                  - id: 20260312_241
                    symbol: HPG
                    side: NB
                    orderType: LO
                    orderStatus: Expired
                    price: 27200
                    quantity: 200
                    fillQuantity: 0
                    leaveQuantity: 0
                    canceledQuantity: 200
                    averagePrice: 0
                    loanPackageId: 5765
                    transDate: '2026-03-12'
                    createdDate: '2026-03-17T06:44:18.813804Z'
                    modifiedDate: '2026-03-18T15:28:24.44026Z'
                  - id: 20260312_201
                    symbol: HPG
                    side: NB
                    orderType: LO
                    orderStatus: Canceled
                    price: 27200
                    quantity: 100
                    fillQuantity: 0
                    leaveQuantity: 0
                    canceledQuantity: 100
                    averagePrice: 0
                    loanPackageId: 5765
                    transDate: '2026-03-12'
                    createdDate: '2026-03-17T04:38:39.589764Z'
                    modifiedDate: '2026-03-17T06:44:18.80718Z'
                  - id: 20260312_191
                    symbol: HPG
                    side: NB
                    orderType: LO
                    orderStatus: Canceled
                    price: 27000
                    quantity: 100
                    fillQuantity: 0
                    leaveQuantity: 0
                    canceledQuantity: 100
                    averagePrice: 0
                    loanPackageId: 5765
                    transDate: '2026-03-12'
                    createdDate: '2026-03-17T04:37:55.076343Z'
                    modifiedDate: '2026-03-17T04:38:39.58558Z'
                  - id: 20260312_171
                    symbol: HPG
                    side: NB
                    orderType: LO
                    orderStatus: Rejected
                    price: 27200
                    quantity: 300
                    fillQuantity: 0
                    leaveQuantity: 0
                    canceledQuantity: 300
                    averagePrice: 0
                    loanPackageId: 5765
                    transDate: '2026-03-12'
                    createdDate: '2026-03-17T04:27:07.160028Z'
                    modifiedDate: '2026-03-17T04:27:07.16518Z'
                  - id: 20260312_161
                    symbol: HPG
                    side: NB
                    orderType: LO
                    orderStatus: Canceled
                    price: 27200
                    quantity: 200
                    fillQuantity: 0
                    leaveQuantity: 0
                    canceledQuantity: 200
                    averagePrice: 0
                    loanPackageId: 5765
                    transDate: '2026-03-12'
                    createdDate: '2026-03-17T04:26:29.007723Z'
                    modifiedDate: '2026-03-17T04:27:07.156301Z'
                  - id: 20260312_151
                    symbol: HPG
                    side: NB
                    orderType: LO
                    orderStatus: Canceled
                    price: 27100
                    quantity: 100
                    fillQuantity: 0
                    leaveQuantity: 0
                    canceledQuantity: 100
                    averagePrice: 0
                    loanPackageId: 5765
                    transDate: '2026-03-12'
                    createdDate: '2026-03-17T04:22:19.045725Z'
                    modifiedDate: '2026-03-17T04:26:28.9999Z'
                  - id: 20260305_61
                    symbol: ACB
                    side: NB
                    orderType: LO
                    orderStatus: Expired
                    price: 23200
                    quantity: 100
                    fillQuantity: 0
                    leaveQuantity: 0
                    canceledQuantity: 100
                    averagePrice: 0
                    loanPackageId: 5757
                    transDate: '2026-03-05'
                    createdDate: '2026-03-11T08:32:01.401474Z'
                    modifiedDate: '2026-03-11T14:35:53.763802Z'
                  - id: 20260224_181
                    symbol: FPT
                    side: NB
                    orderType: LO
                    orderStatus: Expired
                    price: 95000
                    quantity: 100
                    fillQuantity: 0
                    leaveQuantity: 0
                    canceledQuantity: 100
                    averagePrice: 0
                    loanPackageId: 1372
                    transDate: '2026-02-24'
                    createdDate: '2026-02-26T08:25:18.060101Z'
                    modifiedDate: '2026-02-26T14:41:52.221586Z'
        '400':
          description: Yêu cầu không hợp lệ
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 400
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-003
                    description: Mã lỗi
                  message:
                    type: string
                    example: Thông tin nhập không hợp lệ
                    description: Thông điệp lỗi
              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.