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

# Hủy lệnh

> Gửi yêu cầu hủy lệnh đã đặt theo `orderId.`



## OpenAPI

````yaml https://cdn.entrade.com.vn/dnse-openapi/doc/dnse-openapi-2026-05-07.yaml delete /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
    delete:
      tags:
        - trading
      summary: Hủy lệnh
      description: Gửi yêu cầu hủy lệnh đã đặt theo `orderId.`
      parameters:
        - name: marketType
          in: query
          required: true
          description: |-
            Loại thị trường 
            - STOCK: Đặt lệnh cơ sở
            - DERIVATIVE: Đặt 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
          required: true
          description: API Key được cấp khi đăng ký dịch vụ
          deprecated: false
          schema:
            type: string
          example: '{{apiKey}}'
        - 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: 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: trading-token
          in: header
          required: true
          description: Token đặt lệnh
          deprecated: false
          schema:
            type: string
          example: '{{tradingToken}}'
        - 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: 520
            Date:
              schema:
                type: string
              example: Tue, 24 Mar 2026 04:16:12 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: 1626
                    description: Id lệnh giao dịch
                    format: int32
                  symbol:
                    type: string
                    example: 41I1G4000
                    description: Mã chứng khoán
                  side:
                    type: string
                    example: NS
                    description: |-
                      Chiều đặt lệnh
                      - 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: PendingCancel
                    description: |-
                      Trạng thái lệnh
                      - PendingNew: Chờ gửi
                      - New: Chờ khớp
                      - PendingReplace: Chờ sửa
                      - 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: Giải tỏa trong phiên
                  loanPackageId:
                    type: string
                    example: '2278'
                    description: Mã gói vay
                  price:
                    type: number
                    example: 1851
                    description: Giá đặt
                    format: double
                  averagePrice:
                    type: number
                    example: 0
                    description: Giá khớp trung bình
                    format: float
                  quantity:
                    type: integer
                    example: 3
                    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: 3
                    description: Khối lượng còn lại
                    format: int32
                  accountNo:
                    type: string
                    example: '0001179019'
                    description: Số tiểu khoản
                  orderCategory:
                    type: string
                    example: NORMAL
                    description: Phân loại lệnh thường (mặc định NORMAL)
                  marketType:
                    type: string
                    example: DERIVATIVE
                    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-24T04:09:50.761146893Z'
                    description: Thời điểm tạo
                    format: date-time
                  modifiedDate:
                    type: string
                    example: '2026-03-24T04:16:12.469115348Z'
                    description: Thời điểm cập nhật
                    format: date-time
              example:
                id: 1626
                symbol: 41I1G4000
                side: NS
                orderType: LO
                orderStatus: PendingCancel
                loanPackageId: '2278'
                price: 1851
                averagePrice: 0
                quantity: 3
                fillQuantity: 0
                canceledQuantity: 0
                leaveQuantity: 3
                accountNo: '0001179019'
                orderCategory: NORMAL
                marketType: DERIVATIVE
                transDate: '2026-03-16'
                createdDate: '2026-03-24T04:09:50.761146893Z'
                modifiedDate: '2026-03-24T04:16:12.469115348Z'
        '400':
          description: Yêu cầu không hợp lệ
          headers:
            Content-Length:
              schema:
                type: integer
              example: 104
            Date:
              schema:
                type: string
              example: Wed, 25 Mar 2026 15:36:43 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:
                  status:
                    type: integer
                    example: 400
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: RESOURCE_NOT_FOUND
                    description: Mã lỗi
                  message:
                    type: string
                    example: 'OrderRepository: cannot find object with id: 1626'
                    description: Thông điệp lỗi
              example:
                status: 400
                code: RESOURCE_NOT_FOUND
                message: 'OrderRepository: cannot find object with id: 1626'
        '500':
          description: Lỗi hệ thống
          headers:
            Content-Length:
              schema:
                type: integer
              example: 104
            Date:
              schema:
                type: string
              example: Wed, 25 Mar 2026 15:36:43 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:
                  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.