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

# Phiên giao dịch

> Truy vấn thông tin phiên giao dịch hiện tại.



## OpenAPI

````yaml https://cdn.entrade.com.vn/dnse-openapi/doc/dnse-openapi-2026-05-07.yaml get /market/trading-session
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:
  /market/trading-session:
    get:
      tags:
        - market-data
      summary: Phiên giao dịch
      description: Truy vấn thông tin phiên giao dịch hiện tại.
      parameters:
        - name: boardId
          in: query
          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)
          schema:
            type: string
          example: G1
        - name: tscProdGrpId
          in: query
          required: true
          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
          schema:
            type: string
          example: STO
        - name: X-API-Key
          in: header
          required: true
          description: API Key được cấp khi đăng ký dịch vụ
          schema:
            type: string
          example: '{{apiKey}}'
        - name: X-Aux-Date
          in: header
          required: true
          description: Chữ ký xác thực yêu cầu
          schema:
            type: string
          example: '{{date}}'
        - name: X-Signature
          in: header
          required: true
          description: Thời gian thực hiện yêu cầu
          schema:
            type: string
          example: '{{signature}}'
        - name: version
          in: header
          description: 'Phiên bản API '
          schema:
            type: string
          example: '2026-05-07'
      responses:
        '200':
          description: OK
          headers:
            Content-Length:
              schema:
                type: integer
              example: 215
            Date:
              schema:
                type: string
              example: Fri, 26 Jun 2026 08:58:34 GMT
            Vary:
              schema:
                type: string
              example: Origin
            X-Ratelimit-Limit:
              schema:
                type: integer
              example: 1000
            X-Ratelimit-Remaining:
              schema:
                type: integer
              example: 997
            X-Ratelimit-Reset:
              schema:
                type: integer
              example: 1782549856
            X-Tyk-Api-Expires:
              schema:
                type: string
              example: Thu, 02 Jan 3000 15:04:00 UTC
          content:
            application/json:
              schema:
                type: object
                properties:
                  tradingSessions:
                    type: array
                    example:
                      - marketId: STO
                        boardId: G1
                        tscProdGrpId: STO
                        tradingSessionId: '99'
                        eventId: AC2
                        time: '2026-06-26 14:45:00.960'
                    items:
                      type: object
                      properties:
                        marketId:
                          type: string
                          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:
                          type: string
                          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)
                        tscProdGrpId:
                          type: string
                          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
                        tradingSessionId:
                          type: string
                          example: '99'
                          description: |-
                            Mã phiên giao dịch hiện tại
                            - 10: Phiên ATO
                            - 30: Phiên ATC
                            - 40: Phiên liên tục
                            - 80: PCA Mã halt
                            - 99: Đóng bảng
                        eventId:
                          type: string
                          example: AC2
                          description: >-
                            Mã sự kiện chuyển trạng thái phiên giao dịch:

                            - AA1: Mở phiên định kỳ mở cửa

                            - AB1: Mở phiên giao dịch liên tục

                            - AB2: Kết thúc giao dịch của bảng

                            - AC2: Thực hiện khớp lệnh định kỳ đóng cửa

                            - AD1: Bắt đầu nhận lệnh

                            - AD2: Thực hiện khớp lệnh định kỳ

                            - AW8: Nghỉ trưa

                            - AW9: Tiếp tục giao dịch sau nghỉ trưa

                            - AX1: Bảng bắt đầu giao dịch

                            - BB1: Bắt đầu giao dịch phiên liên tục với chứng
                            khoán trạng thái thông thường

                            - BC1: Bắt đầu phiên định kỳ đóng cửa

                            - CC1: Bắt đầu phiên PCA (khớp lệnh định kỳ nhiều
                            đợt) đóng cửa

                            - CD1: Bắt đầu phiên PCA (khớp lệnh định kỳ nhiều
                            đợt)

                            - CD3: Thực hiện khớp lệnh định kỳ nhiều đợt (PCA)
                        time:
                          type: string
                          example: '2026-06-26 14:45:00.960'
                          description: >-
                            Thời gian trong các message giá của sở trả về
                            (YYYY-MM-DD HH:mm:ss.SSS (GMT+7))
                    description: ''
              example:
                tradingSessions:
                  - marketId: STO
                    boardId: G1
                    tscProdGrpId: STO
                    tradingSessionId: '99'
                    eventId: AC2
                    time: '2026-06-26 14:45:00.960'
        '400':
          description: Yêu cầu không hợp lệ
          headers:
            Vary:
              schema:
                type: string
              example: Origin
            X-Generator:
              schema:
                type: string
              example: tyk.io
            X-Tyk-Api-Expires:
              schema:
                type: string
              example: Thu, 02 Jan 3000 15:04:00 UTC
            Date:
              schema:
                type: string
              example: Thu, 16 Apr 2026 06:59:35 GMT
            Content-Length:
              schema:
                type: integer
              example: 116
          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
          headers:
            Vary:
              schema:
                type: string
              example: Origin
            X-Generator:
              schema:
                type: string
              example: tyk.io
            X-Tyk-Api-Expires:
              schema:
                type: string
              example: Thu, 02 Jan 3000 15:04:00 UTC
            Date:
              schema:
                type: string
              example: Thu, 16 Apr 2026 07:02:56 GMT
            Content-Length:
              schema:
                type: integer
              example: 116
          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.