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

# Thông tin giao dịch chứng khoán



## OpenAPI

````yaml /vi/openapi/dnse.2026-09-10.openapi.yaml get /price/{symbol}/secdef
openapi: 3.0.0
info:
  title: DNSE OpenAPI (2026-09-10)
  version: 2.0.0
  description: DNSE OpenAPI spec
servers:
  - url: https://openapi.dnse.com.vn
    description: Production
  - url: https://sb-openapi.dnse.com.vn
    description: Sanbox
security: []
tags:
  - name: trading
    description: Xác thực và các hoạt động đặt lệnh.
    x-group: Giao dịch
  - name: account
    description: Tài khoản, số dư, khoản vay, lệnh và vị thế.
    x-group: Tài khoản
  - name: market
    description: Thông tin mã chứng khoán, báo giá, OHLC và giao dịch.
    x-group: Dữ liệu thị trường
paths:
  /price/{symbol}/secdef:
    parameters:
      - name: symbol
        in: path
        required: true
        description: Mã chứng khoán
        deprecated: false
        schema:
          type: string
        example: HPG
    get:
      tags:
        - market
      summary: Thông tin giao dịch chứng khoán
      operationId: symbol_getSecdef
      parameters:
        - $ref: '#/components/parameters/XApiKey'
        - $ref: '#/components/parameters/XAuxDate'
        - $ref: '#/components/parameters/XSignature'
        - name: symbol
          in: path
          required: true
          schema:
            type: string
        - name: boardId
          in: query
          required: false
          description: |-
            Mã bảng giao dịch
            - G1: Lô chẵn
            - G4: Lô lẻ
            - T1: Thỏa thuận trong giờ (9h - 14h45)
            - T3: Thỏa thuận sau giờ (14h45 - 15h)
            - T4: Thỏa thuận lô lẻ trong giờ (9h - 14h45)
            - T6: Thỏa thuận lô lẻ sau giờ  (14h45 - 15h)
          deprecated: false
          schema:
            $ref: '#/components/schemas/BoardId'
          example: G1
      responses:
        '200':
          description: OK
          headers:
            Content-Length:
              $ref: '#/components/headers/ContentLength'
            Date:
              $ref: '#/components/headers/Date'
            Vary:
              $ref: '#/components/headers/Vary'
            X-Ratelimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-Ratelimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-Ratelimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
            X-Tyk-Api-Expires:
              deprecated: false
              schema: {}
              example: Thu, 02 Jan 3000 15:04:00 UTC
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SecdefResponse'
              example:
                - marketId: STO
                  boardId: G1
                  isin: VN000000HPG4
                  symbol: HPG
                  productGrpId: STO
                  securityGroupId: ST
                  basicPrice: 26.8
                  ceilingPrice: 28.65
                  floorPrice: 24.95
                  securityStatus: UNSPECIFIED
                  symbolAdminStatusCode: NRM
                  symbolTradingMethodStatusCode: NRM
                  symbolTradingSanctionStatusCode: NRM
        '400':
          $ref: '#/components/responses/BadRequest'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  parameters:
    XApiKey:
      name: X-Api-Key
      in: header
      required: true
      description: >-
        API key được cấp khi đăng ký dịch vụ DNSE OpenAPI.

        Ví dụ:
        `b3JnOmRuc2UgaWQ6MjdlZTc1MzcxZGFkNTY0NmYzYTM2NDk1ZGE3OGNiOGQgaDptdXJtdXIxMjg=`
      schema:
        type: string
    XAuxDate:
      name: X-Aux-Date
      in: header
      required: true
      description: |-
        Thời gian thực hiện request, dùng trong cơ chế ký request của DNSE.
        Ví dụ: `Sat, 01 May 2026 14:24:23 +0000`
      schema:
        type: string
    XSignature:
      name: X-Signature
      in: header
      required: true
      description: >-
        Chữ ký xác thực request được tạo từ API key secret và X-Aux-Date.

        Ví dụ: `Signature
        keyId="b3JnOmRuc2UgaWQ6MjdlZTc1MzcxZGFkNTY0NmYzYTM2NDk1ZGE3OGNiOGQgaDptdXJtdXIxMjg=",algorithm="hmac-sha256",headers="(request-target)
        x-aux-date",signature="rfbVXHDUi%2B%2FsOkLXle7O17Qm%2F05cbISSR%2BDcFrBHfqQ%3D",nonce="4add8c3264e4492b9f8ecde0cf26b523"`
      schema:
        type: string
  schemas:
    BoardId:
      type: string
      description: |-
        Mã định danh bảng giao dịch.

        - `UNSPECIFIED`: Không xác định
        - `AL`: Tất cả bảng
        - `G1`: Lô chẵn
        - `G3`: Board phiên sau giờ (PLO)
        - `G4`: Lô lẻ
        - `T1`: Thỏa thuận lô chẵn 9h-14h45
        - `T3`: Thỏa thuận lô chẵn 14h45-15h
        - `T4`: Thỏa thuận lô lẻ 9h-14h45
        - `T6`: Thỏa thuận lô lẻ 14h45-15h
      enum:
        - UNSPECIFIED
        - AL
        - G1
        - G3
        - G4
        - T1
        - T3
        - T4
        - T6
      x-enum-descriptions:
        - Không xác định
        - Tất cả bảng
        - Lô chẵn
        - Board phiên sau giờ (PLO)
        - Lô lẻ
        - Thỏa thuận lô chẵn 9h-14h45
        - Thỏa thuận lô chẵn 14h45-15h
        - Thỏa thuận lô lẻ 9h-14h45
        - Thỏa thuận lô lẻ 14h45-15h
      x-enum-varnames:
        - UNSPECIFIED
        - AL
        - G1
        - G3
        - G4
        - T1
        - T3
        - T4
        - T6
      example: G1
    SecdefResponse:
      type: array
      example:
        - marketId: STO
          boardId: G1
          isin: VN000000HPG4
          symbol: HPG
          productGrpId: STO
          securityGroupId: ST
          basicPrice: 26.8
          ceilingPrice: 28.65
          floorPrice: 24.95
          securityStatus: UNSPECIFIED
          symbolAdminStatusCode: NRM
          symbolTradingMethodStatusCode: NRM
          symbolTradingSanctionStatusCode: NRM
      items:
        $ref: '#/components/schemas/SecdefItem'
      description: ''
    SecdefItem:
      type: object
      properties:
        marketId:
          allOf:
            - $ref: '#/components/schemas/MarketId'
          example: STO
          description: |-
            Mã thị trường niêm yết mã chứng khoán
            - DVX: Phái sinh sàn HNX
            - HCX: Trái phiếu doanh nghiệp HNX
            - STO: Cổ phiếu sàn HOSE
            - STX: Cổ phiếu sàn HNX
            - UPX: Cổ phiếu sàn Upcom
        boardId:
          allOf:
            - $ref: '#/components/schemas/BoardId'
          example: G1
          description: |-
            Mã bảng giao dịch
            - G1: Lô chẵn
            - G4: Lô lẻ
            - T1: Thỏa thuận trong giờ (9h - 14h45)
            - T3: Thỏa thuận sau giờ (14h45 - 15h)
            - T4: Thỏa thuận lô lẻ trong giờ (9h - 14h45)
            - T6: Thỏa thuận lô lẻ sau giờ (14h45 - 15h)
        isin:
          type: string
          example: VN000000HPG4
          description: Mã định danh quốc tế
        symbol:
          type: string
          example: HPG
          description: Mã chứng khoán
        productGrpId:
          allOf:
            - $ref: '#/components/schemas/ProductGrpId'
          example: STO
          description: |-
            Nhóm sản phẩm theo thị trường
            -FBX: Hợp đồng tương lai Trái phiếu
            -FIO: Hợp đồng tương lai Chỉ số
            -HCX: Trái phiếu Doanh nghiệp HNX
            -STO: Cổ phiếu sàn HOSE
            -STX: Cổ phiếu sàn HNX
            -UPX: Cổ phiếu sàn Upcom
        securityGroupId:
          allOf:
            - $ref: '#/components/schemas/SecurityGroupId'
          example: ST
          description: |-
            Nhóm chứng khoán
            - BS: Trái phiếu doanh nghiệp
            - EF: Quỹ ETF
            - EW: Chứng quyền
            - FU: Hợp đồng tương lai
            - ST: Cổ phiếu
        basicPrice:
          type: number
          format: double
          example: 26.8
          description: Giá tham chiếu ngày giao dịch
        ceilingPrice:
          type: number
          format: double
          example: 28.65
          description: Giá trần ngày giao dịch
        floorPrice:
          type: number
          format: double
          example: 24.95
          description: Giá sàn ngày giao dịch
        securityStatus:
          allOf:
            - $ref: '#/components/schemas/SecurityStatus'
          example: UNSPECIFIED
          description: |-
            Trạng thái giao dịch của mã chứng khoán
            - HALT: Ngừng giao dịch
            - NO_HALT: Không ngừng giao dịch
        symbolAdminStatusCode:
          allOf:
            - $ref: '#/components/schemas/SymbolAdminStatusCode'
          example: NRM
          description: |-
            Trạng thái quản lý hành chính mã chứng khoán
            - CR: Kiểm soát và hạn chế giao dịch
            - CTR: Kiểm soát
            - NRM: Bình thường
            - RES: Hạn chế giao dịch
            - WFR: Cảnh báo vi phạm BCTC
            - WID: Cảnh báo vi phạm CBTT
            - WOV: Cảnh báo vi phạm khác
        symbolTradingMethodStatusCode:
          allOf:
            - $ref: '#/components/schemas/SymbolTradingMethodStatusCode'
          example: NRM
          description: |-
            Trạng thái cơ chế giao dịch mã chứng khoán
            - NRM: Bình thường
            - NWE: Niêm yết mới (biên độ đặc biệt)
            - NWN: Niêm yết mới (biên độ thường)
            - SLS: Giao dịch đặc biệt sau tạm ngưng
            - SNE: Giao dịch đặc biệt không có giao dịch dài hạn
        symbolTradingSanctionStatusCode:
          allOf:
            - $ref: '#/components/schemas/SymbolTradingSanctionStatusCode'
          example: NRM
          description: |-
            Tình trạng giao dịch của mã chứng khoán
            - NRM: Bình thường
            - SUS: Tạm ngừng giao dịch
            - DTL: Hủy niêm yết để chuyển sàn
            - TFR: Ngưng giao dịch do hạn chế
        finalTradeDate:
          type: string
          example: null
          description: Ngày giao dịch cuối cùng (nếu có)
          nullable: true
        listingDate:
          type: string
          format: date-time
          example: '2007-11-15T00:00:00Z'
          description: Ngày niêm yế
        time:
          type: string
          example: '2026-08-04 08:00:24.008'
          description: Thời gian ghi nhận (YYYY-MM-DD HH:mm:ss.SSS (GMT+7))
    ErrorBody:
      type: object
      required:
        - status
        - code
        - message
      properties:
        status:
          type: integer
          format: int32
          description: Mã HTTP.
          example: 400
        code:
          type: string
          description: Mã lỗi DNSE.
          example: OA-003
        message:
          type: string
          description: Thông điệp lỗi.
          example: Thông tin nhập không hợp lệ
    MarketId:
      type: string
      description: |-
        Mã thị trường.

        - `UNSPECIFIED`: Không xác định
        - `DVX`: Phái sinh sàn HNX
        - `HCX`: Trái phiếu doanh nghiệp sàn HNX
        - `STO`: Cổ phiếu sàn HOSE
        - `STX`: Cổ phiếu sàn HNX
        - `UPX`: Cổ phiếu sàn Upcom
      enum:
        - UNSPECIFIED
        - DVX
        - HCX
        - STO
        - STX
        - UPX
      x-enum-descriptions:
        - Không xác định
        - Phái sinh sàn HNX
        - Trái phiếu doanh nghiệp sàn HNX
        - Cổ phiếu sàn HOSE
        - Cổ phiếu sàn HNX
        - Cổ phiếu sàn Upcom
      x-enum-varnames:
        - UNSPECIFIED
        - DVX
        - HCX
        - STO
        - STX
        - UPX
      example: STO
    ProductGrpId:
      type: string
      description: |-
        Nhóm sản phẩm theo thị trường.

        - `UNSPECIFIED`: Không xác định
        - `FBX`: Hợp đồng tương lai Trái phiếu
        - `FIO`: Hợp đồng tương lai Chỉ số
        - `HCX`: Trái phiếu Doanh nghiệp HNX
        - `STO`: Cổ phiếu sàn HOSE
        - `STX`: Cổ phiếu sàn HNX
        - `UPX`: Cổ phiếu sàn Upcom
      enum:
        - UNSPECIFIED
        - FBX
        - FIO
        - HCX
        - STO
        - STX
        - UPX
      x-enum-descriptions:
        - Không xác định
        - Hợp đồng tương lai Trái phiếu
        - Hợp đồng tương lai Chỉ số
        - Trái phiếu Doanh nghiệp HNX
        - Cổ phiếu sàn HOSE
        - Cổ phiếu sàn HNX
        - Cổ phiếu sàn Upcom
      x-enum-varnames:
        - UNSPECIFIED
        - FBX
        - FIO
        - HCX
        - STO
        - STX
        - UPX
      example: STO
    SecurityGroupId:
      type: string
      description: |-
        Định danh nhóm chứng khoán.

        - `UNSPECIFIED`: Không xác định
        - `BS`: Trái phiếu doanh nghiệp
        - `EF`: Quỹ ETF
        - `EW`: Chứng quyền
        - `FU`: Hợp đồng tương lai
        - `SR`: Quyền mua
        - `ST`: Cổ phiếu
      enum:
        - UNSPECIFIED
        - BS
        - EF
        - EW
        - FU
        - SR
        - ST
      x-enum-descriptions:
        - Không xác định
        - Trái phiếu doanh nghiệp
        - Quỹ ETF
        - Chứng quyền
        - Hợp đồng tương lai
        - Quyền mua
        - Cổ phiếu
      x-enum-varnames:
        - UNSPECIFIED
        - BS
        - EF
        - EW
        - FU
        - SR
        - ST
      example: ST
    SecurityStatus:
      type: string
      description: |-
        Trạng thái của mã chứng khoán.

        - `HALT`: Ngừng giao dịch
        - `NO_HALT`: Không ngừng giao dịch
      enum:
        - UNSPECIFIED
        - HALT
        - NO_HALT
      x-enum-descriptions:
        - Không xác định
        - Ngừng giao dịch
        - Không ngừng giao dịch
      x-enum-varnames:
        - UNSPECIFIED
        - HALT
        - NO_HALT
      example: NO_HALT
    SymbolAdminStatusCode:
      type: string
      description: |-
        Trạng thái quản lý hành chính mã chứng khoán.

        - `UNSPECIFIED`: Không xác định
        - `CR`: Kiểm soát và hạn chế giao dịch
        - `CTR`: Kiểm soát
        - `NRM`: Bình thường
        - `RES`: Hạn chế giao dịch
        - `WFR`: Cảnh báo do vi phạm BCTC
        - `WID`: Cảnh báo do vi phạm CBTT
        - `WOV`: Cảnh báo vi phạm khác
      enum:
        - UNSPECIFIED
        - CR
        - CTR
        - NRM
        - RES
        - WFR
        - WID
        - WOV
      x-enum-descriptions:
        - Không xác định
        - Kiểm soát và hạn chế giao dịch
        - Kiểm soát
        - Bình thường
        - Hạn chế giao dịch
        - Cảnh báo do vi phạm BCTC
        - Cảnh báo do vi phạm CBTT
        - Cảnh báo vi phạm khác
      x-enum-varnames:
        - UNSPECIFIED
        - CR
        - CTR
        - NRM
        - RES
        - WFR
        - WID
        - WOV
      example: NRM
    SymbolTradingMethodStatusCode:
      type: string
      description: |-
        Trạng thái cơ chế giao dịch mã chứng khoán.

        - `UNSPECIFIED`: Không xác định
        - `NRM`: Bình thường
        - `NWE`: Niêm yết mới biên độ đặc biệt
        - `NWN`: Niêm yết mới biên độ thường
        - `SLS`: Giao dịch đặc biệt sau halt
        - `SNE`: Giao dịch đặc biệt
      enum:
        - UNSPECIFIED
        - NRM
        - NWE
        - NWN
        - SLS
        - SNE
      x-enum-descriptions:
        - Không xác định
        - Bình thường
        - Niêm yết mới biên độ đặc biệt
        - Niêm yết mới biên độ thường
        - Giao dịch đặc biệt sau halt
        - Giao dịch đặc biệt
      x-enum-varnames:
        - UNSPECIFIED
        - NRM
        - NWE
        - NWN
        - SLS
        - SNE
      example: NRM
    SymbolTradingSanctionStatusCode:
      type: string
      description: |-
        Tình trạng giao dịch của mã chứng khoán.

        - `UNSPECIFIED`: Không xác định
        - `NRM`: Bình thường
        - `SUS`: Tạm ngừng
        - `DTL`: Hủy niêm yết chuyển sàn
        - `TFR`: Ngưng giao dịch do hạn chế
      enum:
        - UNSPECIFIED
        - NRM
        - SUS
        - DTL
        - TFR
      x-enum-descriptions:
        - Không xác định
        - Bình thường
        - Tạm ngừng
        - Hủy niêm yết chuyển sàn
        - Ngưng giao dịch do hạn chế
      x-enum-varnames:
        - UNSPECIFIED
        - NRM
        - SUS
        - DTL
        - TFR
      example: NRM
  headers:
    ContentLength:
      description: Response body size in bytes.
      schema:
        type: integer
      example: 430
    Date:
      description: Response date from the DNSE gateway.
      schema:
        type: string
      example: Wed, 18 Mar 2026 16:17:35 GMT
    Vary:
      description: >-
        Response header indicating the request headers used for content
        negotiation.
      schema:
        type: string
      example: Origin
    XRateLimitLimit:
      description: Maximum number of requests allowed in the current rate-limit window.
      schema:
        type: integer
      example: 300
    XRateLimitRemaining:
      description: Number of requests remaining in the current rate-limit window.
      schema:
        type: integer
      example: 299
    XRateLimitReset:
      description: Unix timestamp at which the current rate-limit window resets.
      schema:
        type: integer
      example: 1773850655
    XRequestId:
      description: Unique identifier assigned to the request by the DNSE gateway.
      schema:
        type: string
      example: unknown
  responses:
    BadRequest:
      description: Yêu cầu không hợp lệ.
      headers:
        Content-Length:
          $ref: '#/components/headers/ContentLength'
        Date:
          $ref: '#/components/headers/Date'
        Vary:
          $ref: '#/components/headers/Vary'
        X-Ratelimit-Limit:
          $ref: '#/components/headers/XRateLimitLimit'
        X-Ratelimit-Remaining:
          $ref: '#/components/headers/XRateLimitRemaining'
        X-Ratelimit-Reset:
          $ref: '#/components/headers/XRateLimitReset'
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
        X-Tyk-Api-Expires:
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorBody'
          example:
            status: 400
            code: OA-003
            message: Thông tin nhập không hợp lệ
    InternalError:
      description: Lỗi hệ thống.
      headers:
        Content-Length:
          $ref: '#/components/headers/ContentLength'
        Date:
          $ref: '#/components/headers/Date'
        Vary:
          $ref: '#/components/headers/Vary'
        X-Ratelimit-Limit:
          $ref: '#/components/headers/XRateLimitLimit'
        X-Ratelimit-Remaining:
          $ref: '#/components/headers/XRateLimitRemaining'
        X-Ratelimit-Reset:
          $ref: '#/components/headers/XRateLimitReset'
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
        X-Tyk-Api-Expires:
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorBody'
          example:
            status: 500
            code: OA-009
            message: Lỗi hệ thống

````

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