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

# Dữ liệu nhà đầu tư nước ngoài



## OpenAPI

````yaml /vi/openapi/dnse.2026-09-10.openapi.yaml get /price/{symbol}/foreign-trading
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}/foreign-trading:
    get:
      tags:
        - market
      summary: Dữ liệu nhà đầu tư nước ngoài
      operationId: symbol_getForeignTrading
      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
          schema:
            $ref: '#/components/schemas/BoardId'
          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)
          example: G1
        - name: from
          in: query
          required: true
          schema:
            type: string
          description: Thời gian bắt đầu (timestamp)
          example: '1785729607'
        - name: to
          in: query
          required: true
          schema:
            type: string
          description: Thời gian kết thúc (timestamp) (không vượt quá 1 ngày)
          example: '1785731407'
        - name: limit
          in: query
          schema:
            type: integer
          example: 100
        - name: order
          in: query
          schema:
            type: string
          example: DESC
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForeignTradingResponse'
              example:
                foreigners:
                  - marketId: STO
                    boardId: G1
                    symbol: ACB
                    tradingSessionId: '40'
                    sellVolume: 200
                    sellTradedAmount: 19800000
                    buyVolume: 500
                    buyTradedAmount: 49350000
                    totalSellVolume: 200
                    totalSellTradedAmount: 19800000
                    totalBuyVolume: 500
                    totalBuyTradedAmount: 49350000
                    foreignerOrderLimitQuantity: 62397864
                    foreignerBuyPossibleQuantity: 265119351
                    time: '2026-08-03 11:30:00.091'
                  - marketId: STO
                    boardId: G1
                    symbol: ACB
                    tradingSessionId: '40'
                    sellVolume: 200
                    sellTradedAmount: 19800000
                    buyVolume: 500
                    buyTradedAmount: 49350000
                    totalSellVolume: 200
                    totalSellTradedAmount: 19800000
                    totalBuyVolume: 500
                    totalBuyTradedAmount: 49350000
                    foreignerOrderLimitQuantity: 62397864
                    foreignerBuyPossibleQuantity: 265119351
                    time: '2026-08-03 11:29:00.088'
                  - marketId: STO
                    boardId: G1
                    symbol: ACB
                    tradingSessionId: '40'
                    sellVolume: 200
                    sellTradedAmount: 19800000
                    buyVolume: 500
                    buyTradedAmount: 49350000
                    totalSellVolume: 200
                    totalSellTradedAmount: 19800000
                    totalBuyVolume: 500
                    totalBuyTradedAmount: 49350000
                    foreignerOrderLimitQuantity: 62397864
                    foreignerBuyPossibleQuantity: 265119351
                    time: '2026-08-03 11:28:00.092'
                  - marketId: STO
                    boardId: G1
                    symbol: ACB
                    tradingSessionId: '40'
                    sellVolume: 200
                    sellTradedAmount: 19800000
                    buyVolume: 500
                    buyTradedAmount: 49350000
                    totalSellVolume: 200
                    totalSellTradedAmount: 19800000
                    totalBuyVolume: 500
                    totalBuyTradedAmount: 49350000
                    foreignerOrderLimitQuantity: 62397864
                    foreignerBuyPossibleQuantity: 265119351
                    time: '2026-08-03 11:27:00.089'
                  - marketId: STO
                    boardId: G1
                    symbol: ACB
                    tradingSessionId: '40'
                    sellVolume: 200
                    sellTradedAmount: 19800000
                    buyVolume: 500
                    buyTradedAmount: 49350000
                    totalSellVolume: 200
                    totalSellTradedAmount: 19800000
                    totalBuyVolume: 500
                    totalBuyTradedAmount: 49350000
                    foreignerOrderLimitQuantity: 62397864
                    foreignerBuyPossibleQuantity: 265119351
                    time: '2026-08-03 11:26:00.089'
                  - marketId: STO
                    boardId: G1
                    symbol: ACB
                    tradingSessionId: '40'
                    sellVolume: 200
                    sellTradedAmount: 19800000
                    buyVolume: 500
                    buyTradedAmount: 49350000
                    totalSellVolume: 200
                    totalSellTradedAmount: 19800000
                    totalBuyVolume: 500
                    totalBuyTradedAmount: 49350000
                    foreignerOrderLimitQuantity: 62397864
                    foreignerBuyPossibleQuantity: 265119351
                    time: '2026-08-03 11:25:00.090'
                  - marketId: STO
                    boardId: G1
                    symbol: ACB
                    tradingSessionId: '40'
                    sellVolume: 200
                    sellTradedAmount: 19800000
                    buyVolume: 500
                    buyTradedAmount: 49350000
                    totalSellVolume: 200
                    totalSellTradedAmount: 19800000
                    totalBuyVolume: 500
                    totalBuyTradedAmount: 49350000
                    foreignerOrderLimitQuantity: 62397864
                    foreignerBuyPossibleQuantity: 265119351
                    time: '2026-08-03 11:24:00.090'
                  - marketId: STO
                    boardId: G1
                    symbol: ACB
                    tradingSessionId: '40'
                    sellVolume: 200
                    sellTradedAmount: 19800000
                    buyVolume: 500
                    buyTradedAmount: 49350000
                    totalSellVolume: 200
                    totalSellTradedAmount: 19800000
                    totalBuyVolume: 500
                    totalBuyTradedAmount: 49350000
                    foreignerOrderLimitQuantity: 62397864
                    foreignerBuyPossibleQuantity: 265119351
                    time: '2026-08-03 11:23:00.099'
                  - marketId: STO
                    boardId: G1
                    symbol: ACB
                    tradingSessionId: '40'
                    sellVolume: 200
                    sellTradedAmount: 19800000
                    buyVolume: 500
                    buyTradedAmount: 49350000
                    totalSellVolume: 200
                    totalSellTradedAmount: 19800000
                    totalBuyVolume: 500
                    totalBuyTradedAmount: 49350000
                    foreignerOrderLimitQuantity: 62397864
                    foreignerBuyPossibleQuantity: 265119351
                    time: '2026-08-03 11:22:00.088'
                  - marketId: STO
                    boardId: G1
                    symbol: ACB
                    tradingSessionId: '40'
                    sellVolume: 200
                    sellTradedAmount: 19800000
                    buyVolume: 500
                    buyTradedAmount: 49350000
                    totalSellVolume: 200
                    totalSellTradedAmount: 19800000
                    totalBuyVolume: 500
                    totalBuyTradedAmount: 49350000
                    foreignerOrderLimitQuantity: 62397864
                    foreignerBuyPossibleQuantity: 265119351
                    time: '2026-08-03 11:21:00.090'
                  - marketId: STO
                    boardId: G1
                    symbol: ACB
                    tradingSessionId: '40'
                    sellVolume: 200
                    sellTradedAmount: 19800000
                    buyVolume: 500
                    buyTradedAmount: 49350000
                    totalSellVolume: 200
                    totalSellTradedAmount: 19800000
                    totalBuyVolume: 500
                    totalBuyTradedAmount: 49350000
                    foreignerOrderLimitQuantity: 62397864
                    foreignerBuyPossibleQuantity: 265119351
                    time: '2026-08-03 11:20:00.091'
                  - marketId: STO
                    boardId: G1
                    symbol: ACB
                    tradingSessionId: '40'
                    sellVolume: 200
                    sellTradedAmount: 19800000
                    buyVolume: 500
                    buyTradedAmount: 49350000
                    totalSellVolume: 200
                    totalSellTradedAmount: 19800000
                    totalBuyVolume: 500
                    totalBuyTradedAmount: 49350000
                    foreignerOrderLimitQuantity: 62397864
                    foreignerBuyPossibleQuantity: 265119351
                    time: '2026-08-03 11:19:00.088'
                  - marketId: STO
                    boardId: G1
                    symbol: ACB
                    tradingSessionId: '40'
                    sellVolume: 200
                    sellTradedAmount: 19800000
                    buyVolume: 500
                    buyTradedAmount: 49350000
                    totalSellVolume: 200
                    totalSellTradedAmount: 19800000
                    totalBuyVolume: 500
                    totalBuyTradedAmount: 49350000
                    foreignerOrderLimitQuantity: 62397864
                    foreignerBuyPossibleQuantity: 265119351
                    time: '2026-08-03 11:18:00.091'
                  - marketId: STO
                    boardId: G1
                    symbol: ACB
                    tradingSessionId: '40'
                    sellVolume: 200
                    sellTradedAmount: 19800000
                    buyVolume: 500
                    buyTradedAmount: 49350000
                    totalSellVolume: 200
                    totalSellTradedAmount: 19800000
                    totalBuyVolume: 500
                    totalBuyTradedAmount: 49350000
                    foreignerOrderLimitQuantity: 62397864
                    foreignerBuyPossibleQuantity: 265119351
                    time: '2026-08-03 11:17:00.089'
                  - marketId: STO
                    boardId: G1
                    symbol: ACB
                    tradingSessionId: '40'
                    sellVolume: 200
                    sellTradedAmount: 19800000
                    buyVolume: 500
                    buyTradedAmount: 49350000
                    totalSellVolume: 200
                    totalSellTradedAmount: 19800000
                    totalBuyVolume: 500
                    totalBuyTradedAmount: 49350000
                    foreignerOrderLimitQuantity: 62397864
                    foreignerBuyPossibleQuantity: 265119351
                    time: '2026-08-03 11:16:00.089'
                  - marketId: STO
                    boardId: G1
                    symbol: ACB
                    tradingSessionId: '40'
                    sellVolume: 200
                    sellTradedAmount: 19800000
                    buyVolume: 500
                    buyTradedAmount: 49350000
                    totalSellVolume: 200
                    totalSellTradedAmount: 19800000
                    totalBuyVolume: 500
                    totalBuyTradedAmount: 49350000
                    foreignerOrderLimitQuantity: 62397864
                    foreignerBuyPossibleQuantity: 265119351
                    time: '2026-08-03 11:15:00.089'
                  - marketId: STO
                    boardId: G1
                    symbol: ACB
                    tradingSessionId: '40'
                    sellVolume: 200
                    sellTradedAmount: 19800000
                    buyVolume: 500
                    buyTradedAmount: 49350000
                    totalSellVolume: 200
                    totalSellTradedAmount: 19800000
                    totalBuyVolume: 500
                    totalBuyTradedAmount: 49350000
                    foreignerOrderLimitQuantity: 62397864
                    foreignerBuyPossibleQuantity: 265119351
                    time: '2026-08-03 11:14:00.089'
                  - marketId: STO
                    boardId: G1
                    symbol: ACB
                    tradingSessionId: '40'
                    sellVolume: 200
                    sellTradedAmount: 19800000
                    buyVolume: 500
                    buyTradedAmount: 49350000
                    totalSellVolume: 200
                    totalSellTradedAmount: 19800000
                    totalBuyVolume: 500
                    totalBuyTradedAmount: 49350000
                    foreignerOrderLimitQuantity: 62397864
                    foreignerBuyPossibleQuantity: 265119351
                    time: '2026-08-03 11:13:00.091'
                  - marketId: STO
                    boardId: G1
                    symbol: ACB
                    tradingSessionId: '40'
                    sellVolume: 200
                    sellTradedAmount: 19800000
                    buyVolume: 500
                    buyTradedAmount: 49350000
                    totalSellVolume: 200
                    totalSellTradedAmount: 19800000
                    totalBuyVolume: 500
                    totalBuyTradedAmount: 49350000
                    foreignerOrderLimitQuantity: 62397864
                    foreignerBuyPossibleQuantity: 265119351
                    time: '2026-08-03 11:12:00.092'
                  - marketId: STO
                    boardId: G1
                    symbol: ACB
                    tradingSessionId: '40'
                    sellVolume: 200
                    sellTradedAmount: 19800000
                    buyVolume: 500
                    buyTradedAmount: 49350000
                    totalSellVolume: 200
                    totalSellTradedAmount: 19800000
                    totalBuyVolume: 500
                    totalBuyTradedAmount: 49350000
                    foreignerOrderLimitQuantity: 62397864
                    foreignerBuyPossibleQuantity: 265119351
                    time: '2026-08-03 11:11:00.089'
                  - marketId: STO
                    boardId: G1
                    symbol: ACB
                    tradingSessionId: '40'
                    sellVolume: 200
                    sellTradedAmount: 19800000
                    buyVolume: 500
                    buyTradedAmount: 49350000
                    totalSellVolume: 200
                    totalSellTradedAmount: 19800000
                    totalBuyVolume: 500
                    totalBuyTradedAmount: 49350000
                    foreignerOrderLimitQuantity: 62397864
                    foreignerBuyPossibleQuantity: 265119351
                    time: '2026-08-03 11:10:00.092'
                  - marketId: STO
                    boardId: G1
                    symbol: ACB
                    tradingSessionId: '40'
                    sellVolume: 200
                    sellTradedAmount: 19800000
                    buyVolume: 500
                    buyTradedAmount: 49350000
                    totalSellVolume: 200
                    totalSellTradedAmount: 19800000
                    totalBuyVolume: 500
                    totalBuyTradedAmount: 49350000
                    foreignerOrderLimitQuantity: 62397864
                    foreignerBuyPossibleQuantity: 265119351
                    time: '2026-08-03 11:09:00.090'
                  - marketId: STO
                    boardId: G1
                    symbol: ACB
                    tradingSessionId: '40'
                    sellVolume: 200
                    sellTradedAmount: 19800000
                    buyVolume: 500
                    buyTradedAmount: 49350000
                    totalSellVolume: 200
                    totalSellTradedAmount: 19800000
                    totalBuyVolume: 500
                    totalBuyTradedAmount: 49350000
                    foreignerOrderLimitQuantity: 62397864
                    foreignerBuyPossibleQuantity: 265119351
                    time: '2026-08-03 11:08:00.093'
                  - marketId: STO
                    boardId: G1
                    symbol: ACB
                    tradingSessionId: '40'
                    sellVolume: 200
                    sellTradedAmount: 19800000
                    buyVolume: 500
                    buyTradedAmount: 49350000
                    totalSellVolume: 200
                    totalSellTradedAmount: 19800000
                    totalBuyVolume: 500
                    totalBuyTradedAmount: 49350000
                    foreignerOrderLimitQuantity: 62397864
                    foreignerBuyPossibleQuantity: 265119351
                    time: '2026-08-03 11:07:00.092'
                  - marketId: STO
                    boardId: G1
                    symbol: ACB
                    tradingSessionId: '40'
                    sellVolume: 200
                    sellTradedAmount: 19800000
                    buyVolume: 500
                    buyTradedAmount: 49350000
                    totalSellVolume: 200
                    totalSellTradedAmount: 19800000
                    totalBuyVolume: 500
                    totalBuyTradedAmount: 49350000
                    foreignerOrderLimitQuantity: 62397864
                    foreignerBuyPossibleQuantity: 265119351
                    time: '2026-08-03 11:06:00.093'
                  - marketId: STO
                    boardId: G1
                    symbol: ACB
                    tradingSessionId: '40'
                    sellVolume: 200
                    sellTradedAmount: 19800000
                    buyVolume: 500
                    buyTradedAmount: 49350000
                    totalSellVolume: 200
                    totalSellTradedAmount: 19800000
                    totalBuyVolume: 500
                    totalBuyTradedAmount: 49350000
                    foreignerOrderLimitQuantity: 62397864
                    foreignerBuyPossibleQuantity: 265119351
                    time: '2026-08-03 11:05:00.088'
                  - marketId: STO
                    boardId: G1
                    symbol: ACB
                    tradingSessionId: '40'
                    sellVolume: 200
                    sellTradedAmount: 19800000
                    buyVolume: 500
                    buyTradedAmount: 49350000
                    totalSellVolume: 200
                    totalSellTradedAmount: 19800000
                    totalBuyVolume: 500
                    totalBuyTradedAmount: 49350000
                    foreignerOrderLimitQuantity: 62397864
                    foreignerBuyPossibleQuantity: 265119351
                    time: '2026-08-03 11:04:00.089'
                  - marketId: STO
                    boardId: G1
                    symbol: ACB
                    tradingSessionId: '40'
                    sellVolume: 200
                    sellTradedAmount: 19800000
                    buyVolume: 500
                    buyTradedAmount: 49350000
                    totalSellVolume: 200
                    totalSellTradedAmount: 19800000
                    totalBuyVolume: 500
                    totalBuyTradedAmount: 49350000
                    foreignerOrderLimitQuantity: 62397864
                    foreignerBuyPossibleQuantity: 265119351
                    time: '2026-08-03 11:03:00.095'
                  - marketId: STO
                    boardId: G1
                    symbol: ACB
                    tradingSessionId: '40'
                    sellVolume: 200
                    sellTradedAmount: 19800000
                    buyVolume: 500
                    buyTradedAmount: 49350000
                    totalSellVolume: 200
                    totalSellTradedAmount: 19800000
                    totalBuyVolume: 500
                    totalBuyTradedAmount: 49350000
                    foreignerOrderLimitQuantity: 62397864
                    foreignerBuyPossibleQuantity: 265119351
                    time: '2026-08-03 11:02:00.090'
                  - marketId: STO
                    boardId: G1
                    symbol: ACB
                    tradingSessionId: '40'
                    sellVolume: 200
                    sellTradedAmount: 19800000
                    buyVolume: 500
                    buyTradedAmount: 49350000
                    totalSellVolume: 200
                    totalSellTradedAmount: 19800000
                    totalBuyVolume: 500
                    totalBuyTradedAmount: 49350000
                    foreignerOrderLimitQuantity: 62397864
                    foreignerBuyPossibleQuantity: 265119351
                    time: '2026-08-03 11:01:00.089'
                nextPageToken: Nl8yXzQwX0FDQl8yMDI2LTA2LTExVDA2OjU0OjAwLjM2OFo=
        '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
    ForeignTradingResponse:
      type: object
      additionalProperties: true
      description: ''
      properties:
        foreigners:
          type: array
          description: >-
            Danh sách dữ liệu giao dịch của nhà đầu tư nước ngoài theo mã chứng
            khoán.
          example:
            - marketId: STO
              boardId: G1
              symbol: ACB
              tradingSessionId: '40'
              sellVolume: 200
              sellTradedAmount: 19800000
              buyVolume: 500
              buyTradedAmount: 49350000
              totalSellVolume: 200
              totalSellTradedAmount: 19800000
              totalBuyVolume: 500
              totalBuyTradedAmount: 49350000
              foreignerOrderLimitQuantity: 62397864
              foreignerBuyPossibleQuantity: 265119351
              time: '2026-08-03 11:30:00.091'
          items:
            $ref: '#/components/schemas/ForeignTrading'
        nextPageToken:
          type: string
          example: Nl8yXzQwX0FDQl8yMDI2LTA2LTExVDA2OjU0OjAwLjM2OFo=
          description: >-
            Token dùng để lấy trang dữ liệu tiếp theo. Giá trị null nếu không
            còn dữ liệu.
    ForeignTrading:
      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)
        symbol:
          type: string
          example: ACB
          description: Mã chứng khoán
        tradingSessionId:
          allOf:
            - $ref: '#/components/schemas/TradingSessionId'
          example: '40'
          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
        sellVolume:
          type: integer
          format: int32
          example: 200
          description: Khối lượng bán khớp lệnh của nhà đầu tư nước ngoài trong phiên
        sellTradedAmount:
          type: integer
          format: int32
          example: 19800000
          description: Giá trị bán khớp lệnh của nhà đầu tư nước ngoài trong phiên
        buyVolume:
          type: integer
          format: int32
          example: 500
          description: Khối lượng mua khớp lệnh của nhà đầu tư nước ngoài trong phiên
        buyTradedAmount:
          type: integer
          format: int32
          example: 49350000
          description: Giá trị mua khớp lệnh của nhà đầu tư nước ngoài trong phiên
        totalSellVolume:
          type: integer
          format: int32
          example: 200
          description: Tổng khối lượng bán lũy kế của nhà đầu tư nước ngoài
        totalSellTradedAmount:
          type: integer
          format: int32
          example: 19800000
          description: Tổng giá trị bán lũy kế của nhà đầu tư nước ngoài
        totalBuyVolume:
          type: integer
          format: int32
          example: 500
          description: Tổng khối lượng mua lũy kế của nhà đầu tư nước ngoà
        totalBuyTradedAmount:
          type: integer
          format: int32
          example: 49350000
          description: Tổng giá trị mua lũy kế của nhà đầu tư nước ngoài
        foreignerOrderLimitQuantity:
          type: integer
          format: int32
          example: 62397864
          description: Giới hạn khối lượng sở hữu tối đa dành cho nhà đầu tư nước ngoài
        foreignerBuyPossibleQuantity:
          type: integer
          format: int32
          example: 265119351
          description: Khối lượng còn lại mà nhà đầu tư nước ngoài được phép mua
        time:
          type: string
          example: '2026-08-03 11:30:00.091'
          description: 'Thời gian ghi nhận. Định dạng: 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
    TradingSessionId:
      type: string
      description: |-
        Mã phiên giao dịch theo từng mã.

        - `UNSPECIFIED`: Không xác định
        - `10`: ATO
        - `30`: ATC
        - `40`: Phiên liên tục
        - `80`: PCA mã halt
        - `99`: Đóng bảng
      enum:
        - UNSPECIFIED
        - '10'
        - '30'
        - '40'
        - '80'
        - '99'
      x-enum-descriptions:
        - Không xác định
        - ATO
        - ATC
        - Phiên liên tục
        - PCA mã halt
        - Đóng bảng
      x-enum-varnames:
        - UNSPECIFIED
        - V10
        - V30
        - V40
        - V80
        - V99
      example: '99'
  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
  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

````

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