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

> Cung cấp thông tin phiên giao dịch của các sàn theo bảng giao dịch và nhóm sản phẩm thị trường.



## AsyncAPI

````yaml vi/asyncapi/dnse.2026-09-10.asyncapi.yaml tradingSessionStream
id: tradingSessionStream
title: Phiên giao dịch
description: >-
  Cung cấp thông tin phiên giao dịch của các sàn theo bảng giao dịch và nhóm sản
  phẩm thị trường.
servers:
  - id: production
    protocol: wss
    host: ws-openapi.dnse.com.vn
    bindings: []
    variables: []
  - id: sanbox
    protocol: wss
    host: ws-sb-openapi.dnse.com.vn
    bindings: []
    variables: []
address: /v1/stream
parameters: []
bindings:
  - protocol: ws
    version: 0.1.0
    value:
      method: GET
      query:
        type: object
        additionalProperties: false
        required:
          - encoding
        properties:
          encoding:
            type: string
            const: json
            default: json
            description: Định dạng mã hóa dữ liệu WebSocket (`json`, `msgpack`).
    schemaProperties:
      - name: method
        type: string
        description: GET
        required: false
      - name: query
        type: object
        required: false
        properties:
          - name: encoding
            type: string
            description: Định dạng mã hóa dữ liệu WebSocket (`json`, `msgpack`).
            required: true
operations:
  - &ref_1
    id: onTradingSessionSubscription
    title: Đăng ký luồng phiên giao dịch
    type: receive
    messages:
      - &ref_3
        id: subscribeRequest
        contentType: application/json
        payload:
          - name: Đăng ký luồng phiên giao dịch
            description: Đăng ký topic `session.{market_id}.{market_group}.{encoding}`.
            type: object
            properties:
              - name: action
                type: string
                description: subscribe
                required: true
              - name: channels
                type: array
                required: true
                properties:
                  - name: name
                    type: string
                    description: Topic phiên giao dịch theo thị trường và nhóm sản phẩm.
                    required: true
        headers: []
        jsonPayloadSchema:
          type: object
          additionalProperties: false
          required:
            - action
            - channels
          properties:
            action:
              type: string
              const: subscribe
              x-parser-schema-id: <anonymous-schema-109>
            channels:
              type: array
              minItems: 1
              uniqueItems: true
              items:
                type: object
                additionalProperties: false
                required:
                  - name
                properties:
                  name:
                    type: string
                    description: Topic phiên giao dịch theo thị trường và nhóm sản phẩm.
                    pattern: ^session\.[A-Z0-9]+\.[A-Z0-9]+\.json$
                    x-parser-schema-id: <anonymous-schema-112>
                x-parser-schema-id: <anonymous-schema-111>
              x-parser-schema-id: <anonymous-schema-110>
          x-parser-schema-id: <anonymous-schema-108>
        title: Đăng ký luồng phiên giao dịch
        description: Đăng ký topic `session.{market_id}.{market_group}.{encoding}`.
        example: |-
          {
            "action": "subscribe",
            "channels": [
              {
                "name": "session.STO.G1.json"
              }
            ]
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: subscribeRequest
    bindings: []
    extensions: &ref_0
      - id: x-parser-unique-object-id
        value: tradingSessionStream
  - &ref_2
    id: onTradingSessionUpdates
    title: Nhận cập nhật phiên giao dịch
    type: send
    messages:
      - &ref_4
        id: update
        contentType: application/json
        payload:
          - name: Cập nhật phiên giao dịch
            description: Bản cập nhật trạng thái phiên giao dịch của một nhóm sản phẩm.
            type: object
            properties:
              - name: T
                type: string
                description: Mã loại message phiên giao dịch.
                required: true
              - name: marketId
                type: string
                description: Mã thị trường.
                required: true
              - name: boardId
                type: string
                description: Mã bảng giao dịch.
                required: true
              - name: boardIdOriginal
                type: string
                description: Mã bảng giao dịch gốc.
                required: true
              - name: eventId
                type: string
                description: Mã sự kiện chuyển trạng thái phiên giao dịch.
                required: true
              - name: tradingSessionId
                type: string
                description: Mã phiên giao dịch hiện tại.
                required: true
              - name: tscProdGrpId
                type: string
                description: Mã nhóm sản phẩm thị trường.
                required: true
              - name: multicastReceiveTime
                type: object
                description: Thời gian nhận message qua multicast.
                required: true
                properties:
                  - name: Seconds
                    type: integer
                    description: Unix timestamp tính bằng giây.
                    required: true
                  - name: Nanos
                    type: integer
                    description: Phần nanosecond của timestamp.
                    required: true
              - name: sendingTime
                type: object
                description: Thời gian gửi message.
                required: true
                properties:
                  - name: Seconds
                    type: integer
                    description: Unix timestamp tính bằng giây.
                    required: true
                  - name: Nanos
                    type: integer
                    description: Phần nanosecond của timestamp.
                    required: true
              - name: time
                type: string
                description: Thời điểm cập nhật dữ liệu.
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          description: Dữ liệu cập nhật trạng thái phiên giao dịch.
          required:
            - T
            - marketId
            - boardId
            - eventId
            - tradingSessionId
            - tscProdGrpId
            - boardIdOriginal
            - multicastReceiveTime
            - sendingTime
            - time
          properties:
            T:
              type: string
              description: Mã loại message phiên giao dịch.
              const: s
              x-parser-schema-id: <anonymous-schema-114>
            marketId:
              type: string
              description: Mã thị trường.
              x-parser-schema-id: <anonymous-schema-115>
            boardId:
              type: string
              description: Mã bảng giao dịch.
              x-parser-schema-id: <anonymous-schema-116>
            boardIdOriginal:
              type: string
              description: Mã bảng giao dịch gốc.
              x-parser-schema-id: <anonymous-schema-117>
            eventId:
              type: string
              description: Mã sự kiện chuyển trạng thái phiên giao dịch.
              x-parser-schema-id: <anonymous-schema-118>
            tradingSessionId:
              type: string
              description: Mã phiên giao dịch hiện tại.
              x-parser-schema-id: <anonymous-schema-119>
            tscProdGrpId:
              type: string
              description: Mã nhóm sản phẩm thị trường.
              x-parser-schema-id: <anonymous-schema-120>
            multicastReceiveTime:
              type: object
              description: Thời gian nhận message qua multicast.
              required:
                - Seconds
                - Nanos
              properties:
                Seconds:
                  type: integer
                  format: int64
                  description: Unix timestamp tính bằng giây.
                  x-parser-schema-id: <anonymous-schema-122>
                Nanos:
                  type: integer
                  format: int32
                  description: Phần nanosecond của timestamp.
                  x-parser-schema-id: <anonymous-schema-123>
              x-parser-schema-id: <anonymous-schema-121>
            sendingTime:
              type: object
              description: Thời gian gửi message.
              required:
                - Seconds
                - Nanos
              properties:
                Seconds:
                  type: integer
                  format: int64
                  description: Unix timestamp tính bằng giây.
                  x-parser-schema-id: <anonymous-schema-125>
                Nanos:
                  type: integer
                  format: int32
                  description: Phần nanosecond của timestamp.
                  x-parser-schema-id: <anonymous-schema-126>
              x-parser-schema-id: <anonymous-schema-124>
            time:
              type: string
              format: date-time
              description: Thời điểm cập nhật dữ liệu.
              x-parser-schema-id: <anonymous-schema-127>
          x-parser-schema-id: <anonymous-schema-113>
        title: Cập nhật phiên giao dịch
        description: Bản cập nhật trạng thái phiên giao dịch của một nhóm sản phẩm.
        example: |-
          {
            "T": "s",
            "boardId": "G1",
            "boardIdOriginal": "AL",
            "eventId": "AW8",
            "marketId": "STO",
            "multicastReceiveTime": {
              "Nanos": 660250421,
              "Seconds": 1782966600
            },
            "sendingTime": {
              "Nanos": 662000000,
              "Seconds": 1782966600
            },
            "tradingSessionId": "UNSPECIFIED",
            "tscProdGrpId": "STO"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: update
    bindings: []
    extensions: *ref_0
sendOperations:
  - *ref_1
receiveOperations:
  - *ref_2
sendMessages:
  - *ref_3
receiveMessages:
  - *ref_4
extensions:
  - id: x-parser-unique-object-id
    value: tradingSessionStream
securitySchemes: []

````

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