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

# Thay đổi thông tin lệnh cơ sở

> Client xác thực bằng `authenticate|<BASE64_JSON>`, subscribe topic `STOCK_ORDER`
và gửi heartbeat `ping|1` mỗi 2 giây.



## AsyncAPI

````yaml vi/openapi/tcbs.v1.asyncapi.yaml cashOrderStream
id: cashOrderStream
title: Thay đổi thông tin lệnh cơ sở
description: >-
  Client xác thực bằng `authenticate|<BASE64_JSON>`, subscribe topic
  `STOCK_ORDER`

  và gửi heartbeat `ping|1` mỗi 2 giây.
servers:
  - id: production
    protocol: wss
    host: openapi.tcbs.com.vn
    bindings: []
    variables: []
address: /ws/aither
parameters: []
bindings: []
operations:
  - &ref_2
    id: sendCashOrderCommand
    title: Gửi lệnh điều khiển luồng lệnh cơ sở
    type: receive
    messages:
      - &ref_4
        id: command
        contentType: text/plain
        payload:
          - type: string
            examples: &ref_0
              - subscribe|eyJ0b3BpYyI6IlNUT0NLX09SREVSIn0=
              - ping|1
            x-parser-schema-id: <anonymous-schema-168>
            name: Lệnh điều khiển luồng lệnh
            description: Xác thực, subscribe hoặc heartbeat.
        headers: []
        jsonPayloadSchema:
          type: string
          examples: *ref_0
          x-parser-schema-id: <anonymous-schema-168>
        title: Lệnh điều khiển luồng lệnh
        description: Xác thực, subscribe hoặc heartbeat.
        example: '"subscribe|eyJ0b3BpYyI6IlNUT0NLX09SREVSIn0="'
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: command
    bindings: []
    extensions: &ref_1
      - id: x-parser-unique-object-id
        value: cashOrderStream
  - &ref_3
    id: receiveCashOrderData
    title: Nhận thay đổi lệnh cơ sở
    type: send
    messages:
      - &ref_5
        id: authResult
        contentType: application/json
        payload:
          - name: Kết quả xác thực luồng lệnh
            description: >-
              Trên wire server gửi `authenticate|{JSON_PAYLOAD}`; payload dưới
              đây là phần JSON đã tách prefix.
            type: object
            properties:
              - name: success
                type: boolean
                description: Kết quả xác thực.
                required: true
              - name: error
                type: object
                required: false
                properties:
                  - name: code
                    type: string
                    required: true
                  - name: message
                    type: string
                    required: true
        headers: []
        jsonPayloadSchema:
          type: object
          required:
            - success
          properties:
            success:
              type: boolean
              description: Kết quả xác thực.
              x-parser-schema-id: <anonymous-schema-170>
            error:
              oneOf:
                - type: 'null'
                  x-parser-schema-id: <anonymous-schema-172>
                - type: object
                  required:
                    - code
                    - message
                  properties:
                    code:
                      type: string
                      x-parser-schema-id: <anonymous-schema-174>
                    message:
                      type: string
                      x-parser-schema-id: <anonymous-schema-175>
                  x-parser-schema-id: <anonymous-schema-173>
              x-parser-schema-id: <anonymous-schema-171>
          x-parser-schema-id: <anonymous-schema-169>
        title: Kết quả xác thực luồng lệnh
        description: >-
          Trên wire server gửi `authenticate|{JSON_PAYLOAD}`; payload dưới đây
          là phần JSON đã tách prefix.
        example: |-
          {
            "success": true,
            "error": null
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: authResult
      - &ref_6
        id: orderUpdate
        contentType: application/json
        payload:
          - name: Thay đổi lệnh cơ sở
            description: Trên wire server gửi `message_proto|STOCK_ORDER|{JSON_PAYLOAD}`.
            type: object
            properties:
              - name: object
                type: string
                description: Loại object.
                required: true
              - name: accountNo
                type: string
                description: Số tiểu khoản.
                required: true
              - name: orderId
                type: string
                description: Số hiệu lệnh.
                required: true
              - name: execType
                type: string
                description: Lệnh mua hoặc bán.
                enumValues:
                  - NB
                  - NS
                required: true
              - name: orderQtty
                type: number
                description: Khối lượng đặt.
                required: true
              - name: symbol
                type: string
                description: Mã chứng khoán.
                required: true
              - name: priceType
                type: string
                description: Loại giá.
                required: true
              - name: txTime
                type: string
                description: Giờ đặt lệnh HH:mm:ss.
                required: true
              - name: txDate
                type: string
                description: Ngày đặt lệnh ISO 8601.
                required: true
              - name: expDate
                type: string
                description: Ngày hết hạn.
                required: false
              - name: timeType
                type: string
                description: Hiệu lực trong ngày hoặc nhiều ngày.
                enumValues:
                  - T
                  - G
                required: true
              - name: orStatus
                type: string
                description: Mã trạng thái lệnh.
                enumValues:
                  - '0'
                  - '2'
                  - '3'
                  - '4'
                  - '5'
                  - '8'
                  - '10'
                  - '11'
                  - '12'
                  - A
                  - C
                  - S
                required: true
              - name: limitPrice
                type: number
                description: Giá đặt lệnh.
                required: true
              - name: remainQtty
                type: number
                description: Khối lượng còn lại.
                required: true
              - name: via
                type: string
                description: Kênh giao dịch.
                required: true
              - name: quotePrice
                type: number
                description: Giá quote.
                required: false
              - name: tradePlace
                type: string
                description: Mã sàn giao dịch.
                required: true
              - name: matchType
                type: string
                description: Loại khớp.
                required: false
              - name: isDisposal
                type: string
                description: Lệnh bán xử lý.
                enumValues:
                  - 'Y'
                  - 'N'
                required: false
              - name: isCancel
                type: string
                description: Cho phép hủy.
                enumValues:
                  - 'Y'
                  - 'N'
                required: false
              - name: isAmend
                type: string
                description: Cho phép sửa.
                enumValues:
                  - 'Y'
                  - 'N'
                required: false
              - name: userName
                type: string
                description: User đặt lệnh.
                required: false
              - name: orsOrderId
                type: string
                description: Số hiệu lệnh ORS.
                required: false
              - name: secType
                type: string
                description: Loại chứng khoán.
                required: false
              - name: isFOOrder
                type: string
                description: Lệnh từ FO hoặc BO.
                enumValues:
                  - 'Y'
                  - 'N'
                required: false
              - name: odTimeStamp
                type: string
                description: Thời gian sinh lệnh.
                required: false
        headers: []
        jsonPayloadSchema:
          type: object
          required:
            - object
            - accountNo
            - orderId
            - execType
            - orderQtty
            - symbol
            - priceType
            - txTime
            - txDate
            - timeType
            - orStatus
            - limitPrice
            - remainQtty
            - via
            - tradePlace
          properties:
            object:
              type: string
              const: order
              description: Loại object.
              x-parser-schema-id: <anonymous-schema-177>
            accountNo:
              type: string
              description: Số tiểu khoản.
              x-parser-schema-id: <anonymous-schema-178>
            orderId:
              type: string
              description: Số hiệu lệnh.
              x-parser-schema-id: <anonymous-schema-179>
            execType:
              type: string
              enum:
                - NB
                - NS
              description: Lệnh mua hoặc bán.
              x-parser-schema-id: <anonymous-schema-180>
            orderQtty:
              type: number
              description: Khối lượng đặt.
              x-parser-schema-id: <anonymous-schema-181>
            symbol:
              type: string
              description: Mã chứng khoán.
              x-parser-schema-id: <anonymous-schema-182>
            priceType:
              type: string
              description: Loại giá.
              x-parser-schema-id: <anonymous-schema-183>
            txTime:
              type: string
              description: Giờ đặt lệnh HH:mm:ss.
              x-parser-schema-id: <anonymous-schema-184>
            txDate:
              type: string
              description: Ngày đặt lệnh ISO 8601.
              x-parser-schema-id: <anonymous-schema-185>
            expDate:
              type: string
              description: Ngày hết hạn.
              x-parser-schema-id: <anonymous-schema-186>
            timeType:
              type: string
              enum:
                - T
                - G
              description: Hiệu lực trong ngày hoặc nhiều ngày.
              x-parser-schema-id: <anonymous-schema-187>
            orStatus:
              type: string
              enum:
                - '0'
                - '2'
                - '3'
                - '4'
                - '5'
                - '8'
                - '10'
                - '11'
                - '12'
                - A
                - C
                - S
              description: Mã trạng thái lệnh.
              x-parser-schema-id: <anonymous-schema-188>
            limitPrice:
              type: number
              description: Giá đặt lệnh.
              x-parser-schema-id: <anonymous-schema-189>
            remainQtty:
              type: number
              description: Khối lượng còn lại.
              x-parser-schema-id: <anonymous-schema-190>
            via:
              type: string
              description: Kênh giao dịch.
              x-parser-schema-id: <anonymous-schema-191>
            quotePrice:
              type: number
              description: Giá quote.
              x-parser-schema-id: <anonymous-schema-192>
            tradePlace:
              type: string
              description: Mã sàn giao dịch.
              x-parser-schema-id: <anonymous-schema-193>
            matchType:
              type: string
              description: Loại khớp.
              x-parser-schema-id: <anonymous-schema-194>
            isDisposal:
              type: string
              enum:
                - 'Y'
                - 'N'
              description: Lệnh bán xử lý.
              x-parser-schema-id: <anonymous-schema-195>
            isCancel:
              type: string
              enum:
                - 'Y'
                - 'N'
              description: Cho phép hủy.
              x-parser-schema-id: <anonymous-schema-196>
            isAmend:
              type: string
              enum:
                - 'Y'
                - 'N'
              description: Cho phép sửa.
              x-parser-schema-id: <anonymous-schema-197>
            userName:
              type: string
              description: User đặt lệnh.
              x-parser-schema-id: <anonymous-schema-198>
            orsOrderId:
              type: string
              description: Số hiệu lệnh ORS.
              x-parser-schema-id: <anonymous-schema-199>
            secType:
              type: string
              description: Loại chứng khoán.
              x-parser-schema-id: <anonymous-schema-200>
            isFOOrder:
              type: string
              enum:
                - 'Y'
                - 'N'
              description: Lệnh từ FO hoặc BO.
              x-parser-schema-id: <anonymous-schema-201>
            odTimeStamp:
              type: string
              description: Thời gian sinh lệnh.
              x-parser-schema-id: <anonymous-schema-202>
          x-parser-schema-id: <anonymous-schema-176>
        title: Thay đổi lệnh cơ sở
        description: Trên wire server gửi `message_proto|STOCK_ORDER|{JSON_PAYLOAD}`.
        example: |-
          {
            "object": "order",
            "accountNo": "0001201435",
            "orderId": "9202412270000098858",
            "execType": "NB",
            "orderQtty": 100,
            "symbol": "LUT",
            "priceType": "LO",
            "txTime": "12:04:39",
            "orStatus": "8",
            "limitPrice": 500,
            "remainQtty": 100,
            "via": "O"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: orderUpdate
    bindings: []
    extensions: *ref_1
sendOperations:
  - *ref_2
receiveOperations:
  - *ref_3
sendMessages:
  - *ref_4
receiveMessages:
  - *ref_5
  - *ref_6
extensions:
  - id: x-parser-unique-object-id
    value: cashOrderStream
securitySchemes: []

````

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