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

# Room nước ngoài

> Cập nhật room và giao dịch mua/bán của nhà đầu tư nước ngoài.



## AsyncAPI

````yaml vi/asyncapi/ssi.2026-07-29.asyncapi.yaml roomStream
id: roomStream
title: Room nước ngoài
description: Cập nhật room và giao dịch mua/bán của nhà đầu tư nước ngoài.
servers:
  - id: production
    protocol: wss
    host: stream.ssi.com.vn
    bindings: []
    variables: []
address: /ws/v3
parameters: []
bindings: []
operations:
  - &ref_2
    id: onRoomUpdates
    title: Nhận cập nhật room nước ngoài
    type: send
    messages:
      - &ref_4
        id: update
        contentType: application/json
        payload:
          - name: Cập nhật room nước ngoài
            description: Room và giao dịch mua/bán của nhà đầu tư nước ngoài.
            type: object
            properties:
              - name: channel
                type: string
                description: DATA
                required: true
              - name: topic
                type: string
                required: true
              - name: data
                type: object
                required: true
                properties:
                  - name: s
                    type: string
                    description: Mã chứng khoán.
                    required: true
                  - name: t
                    type: string
                    description: Thời gian giao dịch, định dạng `YYYY/MM/DD HH:mi:ss`.
                    required: true
                  - name: tr
                    type: string
                    description: Tổng room ngoại.
                    required: true
                  - name: cr
                    type: string
                    description: Room ngoại còn lại.
                    required: true
                  - name: bq
                    type: string
                    description: Khối lượng mua của khối ngoại.
                    required: true
                  - name: bv
                    type: string
                    description: Giá trị mua của khối ngoại.
                    required: true
                  - name: sq
                    type: string
                    description: Khối lượng bán của khối ngoại.
                    required: true
                  - name: sv
                    type: string
                    description: Giá trị bán của khối ngoại.
                    required: true
        headers: []
        jsonPayloadSchema:
          type: object
          additionalProperties: false
          required:
            - channel
            - topic
            - data
          properties:
            channel:
              type: string
              const: DATA
              x-parser-schema-id: <anonymous-schema-81>
            topic:
              type: string
              pattern: >-
                ^room\.(index|exchange|[A-Za-z0-9_-]+(?:-[A-Za-z0-9_-]+)*|\*)(?:@(tick|1m|5m))?$
              x-parser-schema-id: <anonymous-schema-82>
            data:
              type: object
              additionalProperties: false
              required:
                - s
                - t
                - tr
                - cr
                - bq
                - bv
                - sq
                - sv
              properties:
                s:
                  type: string
                  description: Mã chứng khoán.
                  x-parser-schema-id: <anonymous-schema-84>
                t:
                  type: string
                  description: Thời gian giao dịch, định dạng `YYYY/MM/DD HH:mi:ss`.
                  x-parser-schema-id: <anonymous-schema-85>
                tr:
                  type: string
                  description: Tổng room ngoại.
                  x-parser-schema-id: <anonymous-schema-86>
                cr:
                  type: string
                  description: Room ngoại còn lại.
                  x-parser-schema-id: <anonymous-schema-87>
                bq:
                  type: string
                  description: Khối lượng mua của khối ngoại.
                  x-parser-schema-id: <anonymous-schema-88>
                bv:
                  type: string
                  description: Giá trị mua của khối ngoại.
                  x-parser-schema-id: <anonymous-schema-89>
                sq:
                  type: string
                  description: Khối lượng bán của khối ngoại.
                  x-parser-schema-id: <anonymous-schema-90>
                sv:
                  type: string
                  description: Giá trị bán của khối ngoại.
                  x-parser-schema-id: <anonymous-schema-91>
              x-parser-schema-id: <anonymous-schema-83>
          x-parser-schema-id: <anonymous-schema-80>
        title: Cập nhật room nước ngoài
        description: Room và giao dịch mua/bán của nhà đầu tư nước ngoài.
        example: |-
          {
            "channel": "DATA",
            "topic": "room.SSI@tick",
            "data": {
              "s": "SSI",
              "t": "2026/07/29 09:15:32",
              "tr": "1500000",
              "cr": "980000",
              "bq": "5000",
              "bv": "227500000",
              "sq": "3000",
              "sv": "136500000"
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: update
    bindings: []
    extensions: &ref_0
      - id: x-parser-unique-object-id
        value: roomStream
  - &ref_1
    id: onRoomSubscription
    title: Đăng ký luồng room nước ngoài
    type: receive
    messages:
      - &ref_3
        id: subscribeRequest
        contentType: application/json
        payload:
          - name: Yêu cầu đăng ký market data
            description: Đăng ký các topic trên channel DATA.
            type: object
            properties:
              - name: method
                type: string
                description: SUBSCRIBE
                required: true
              - name: channel
                type: string
                description: DATA
                required: true
              - name: topics
                type: array
                description: Danh sách topic market data; mỗi phần tử là một chuỗi topic.
                required: true
                properties:
                  - name: item
                    type: string
                    required: false
        headers: []
        jsonPayloadSchema:
          type: object
          additionalProperties: false
          required:
            - method
            - channel
            - topics
          properties:
            method:
              type: string
              const: SUBSCRIBE
              x-parser-schema-id: <anonymous-schema-71>
            channel:
              type: string
              const: DATA
              x-parser-schema-id: <anonymous-schema-72>
            topics:
              type: array
              minItems: 1
              uniqueItems: true
              description: Danh sách topic market data; mỗi phần tử là một chuỗi topic.
              items:
                type: string
                minLength: 1
                pattern: >-
                  ^(trade|quote|room|put|oddlot)\.(index|exchange|[A-Za-z0-9_-]+(?:-[A-Za-z0-9_-]+)*|\*)(?:@(tick|1m|5m))?$|^market\.(index|exchange|[A-Za-z0-9_-]+(?:-[A-Za-z0-9_-]+)*|\*)$
                x-parser-schema-id: <anonymous-schema-74>
              x-parser-schema-id: <anonymous-schema-73>
          x-parser-schema-id: <anonymous-schema-70>
        title: Yêu cầu đăng ký market data
        description: Đăng ký các topic trên channel DATA.
        example: |-
          {
            "method": "SUBSCRIBE",
            "channel": "DATA",
            "topics": [
              "trade.SSI",
              "quote.ACB-SSI-GVR-KDH",
              "room.vn30",
              "put.hose",
              "oddlot.SSI",
              "market.hose"
            ]
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: subscribeRequest
    bindings: []
    extensions: *ref_0
sendOperations:
  - *ref_1
receiveOperations:
  - *ref_2
sendMessages:
  - *ref_3
receiveMessages:
  - *ref_4
extensions:
  - id: x-parser-unique-object-id
    value: roomStream
securitySchemes: []

````

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