openapi: 3.0.0
info:
  title: OpenAPI-V2-Spec 260730
  version: 1.0.0
  description: DNSE OpenAPI spec and tests
servers:
  - url: https://openapi-uat.dnse.com.vn
paths:
  /accounts:
    get:
      summary: Tài khoản giao dịch
      parameters:
        - name: X-API-Key
          in: header
          required: true
          description: API Key được cấp khi đăng ký dịch vụ
          deprecated: false
          schema:
            type: string
          example: '{{apiKey}}'
        - name: X-Aux-Date
          in: header
          required: true
          description: Thời gian thực hiện yêu cầu
          deprecated: false
          schema:
            type: string
          example: '{{date}}'
        - name: X-Signature
          in: header
          required: true
          description: Chữ ký xác thực yêu cầu
          deprecated: false
          schema:
            type: string
          example: '{{signature}}'
        - name: version
          in: header
          description: API version (YYYY-MM-DD)
          schema:
            type: string
            format: date
          example: '2026-07-23'
      responses:
        '200':
          description: OK
          headers:
            Content-Length:
              schema:
                type: integer
              example: 430
            Date:
              schema:
                type: string
              example: Wed, 18 Mar 2026 16:17:35 GMT
            Vary:
              schema:
                type: string
              example: Origin
            X-Ratelimit-Limit:
              schema:
                type: integer
              example: 300
            X-Ratelimit-Remaining:
              schema:
                type: integer
              example: 299
            X-Ratelimit-Reset:
              schema:
                type: integer
              example: 1773850655
            X-Tyk-Api-Expires:
              schema:
                type: string
              example: Thu, 02 Jan 3000 15:04:00 UTC
          content:
            application/json:
              schema:
                type: object
                properties:
                  name:
                    type: string
                    example: Phạm Thị Thùy
                    description: Họ tên khách hàng
                  custodyCode:
                    type: string
                    example: 064CSUN032
                    description: Số tài khoản lưu ký tại VSD
                  investorId:
                    type: string
                    example: '1000005917'
                    description: Mã định danh khách hàng tại DNSE
                  accounts:
                    type: array
                    example:
                      - id: '0001179019'
                        dealAccount: true
                        derivativeAccount: true
                        derivative:
                          status: ACTIVE
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          example: '0001179019'
                          description: Số tiểu khoản
                        dealAccount:
                          type: boolean
                          example: true
                          description: Tiểu khoản theo DEAL hoặc không
                        derivativeAccount:
                          type: boolean
                          example: true
                          description: ''
                        derivative:
                          type: object
                          example:
                            status: ACTIVE
                          description: |-
                            Trạng thái tài khoản phái sinh
                            - ACTIVE: Đang hoạt động
                            - INACTIVE: Ngừng hoạt động
                          properties:
                            status:
                              type: string
                              example: ACTIVE
                              description: >-
                                Tiểu khoản được phép giao dịch phái sinh hoặc
                                không
              example:
                name: Phạm Thị Thùy
                custodyCode: 064CSUN032
                investorId: '1000005917'
                accounts:
                  - id: '0001179019'
                    dealAccount: true
                    derivativeAccount: true
                    derivative:
                      status: ACTIVE
                  - id: '0331000126'
                    dealAccount: false
                    derivativeAccount: true
                    derivative:
                      status: ACTIVE
        '400':
          description: Yêu cầu không hợp lệ
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 400
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-003
                    description: Mã lỗi
                  message:
                    type: string
                    example: Thông tin nhập không hợp lệ
                    description: Thông điệp lỗi
              example:
                code: OA-003
                message: Thông tin nhập không hợp lệ
                status: 400
        '500':
          description: Lỗi hệ thống
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 500
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-009
                    description: Mã lỗi
                  message:
                    type: string
                    example: Lỗi hệ thống
                    description: Thông điệp lỗi
              example:
                code: OA-009
                message: Lỗi hệ thống
                status: 500
      tags:
        - account
      description: >-
        Truy vấn thông tin định danh của người dùng cùng danh sách tiểu khoản
        giao dịch, phục vụ cho việc xác định khả năng giao dịch và trạng thái
        hoạt động của tiểu khoản.
  /accounts/{accountNo}/balances:
    get:
      summary: Thông tin tiền
      parameters:
        - name: X-API-Key
          in: header
          required: true
          description: API Key được cấp khi đăng ký dịch vụ
          deprecated: false
          schema:
            type: string
          example: '{{apiKey}}'
        - name: X-Aux-Date
          in: header
          required: true
          description: Thời gian thực hiện yêu cầu
          deprecated: false
          schema:
            type: string
          example: '{{date}}'
        - name: X-Signature
          in: header
          required: true
          description: Chữ ký xác thực yêu cầu
          deprecated: false
          schema:
            type: string
          example: '{{signature}}'
        - name: version
          in: header
          description: API version (YYYY-MM-DD)
          schema:
            type: string
            format: date
          example: '2026-07-23'
      responses:
        '200':
          description: OK
          headers:
            Access-Control-Allow-Credentials:
              schema:
                type: boolean
              example: true
            Access-Control-Allow-Headers:
              schema:
                type: string
              example: >-
                Content-Type, Authorization, X-Request-ID, Accept, Origin,
                X-Requested-With
            Access-Control-Allow-Methods:
              schema:
                type: string
              example: GET, POST, PUT, DELETE, OPTIONS, PATCH
            Access-Control-Allow-Origin:
              schema:
                type: string
              example: '*'
            Access-Control-Max-Age:
              schema:
                type: integer
              example: 86400
            Content-Length:
              schema:
                type: integer
              example: 464
            Date:
              schema:
                type: string
              example: Tue, 24 Mar 2026 03:14:00 GMT
            Vary:
              schema:
                type: string
              example: Origin
            X-Ratelimit-Limit:
              schema:
                type: integer
              example: 300
            X-Ratelimit-Remaining:
              schema:
                type: integer
              example: 299
            X-Ratelimit-Reset:
              schema:
                type: integer
              example: 1774322040
            X-Request-Id:
              schema:
                type: string
              example: unknown
            X-Tyk-Api-Expires:
              schema:
                type: string
              example: Thu, 02 Jan 3000 15:04:00 UTC
          content:
            application/json:
              schema:
                type: object
                properties:
                  stock:
                    type: object
                    description: Thông tin tài sản chứng khoán cơ sở
                    properties:
                      totalCash:
                        type: integer
                        format: int32
                        example: 316338724
                        description: >-
                          Tổng tiền (Tiền mặt + Lãi tiền gửi + Tiền bán chờ về +
                          Tiền cổ tức chờ về - Tiền mua trong ngày)
                      availableCash:
                        type: integer
                        format: int32
                        example: 316341327
                        description: Tiền mặt hiện có
                      depositInterest:
                        type: integer
                        format: int32
                        example: 71570
                        description: Lãi tiền gửi không kỳ hạn
                      totalDebt:
                        type: integer
                        format: int32
                        example: 9491548
                        description: Tổng nợ (Nợ margin tạm thu + Nợ margin còn lại)
                      depositFeeAmount:
                        type: integer
                        format: int32
                        example: 4122
                        description: Phí lưu ký.
                      secureAmount:
                        type: integer
                        format: int32
                        example: 11174173
                        description: Tổng tiền ký quỹ.
                      orderSecured:
                        type: integer
                        format: int32
                        example: 7903713
                        description: Số tiền đang được phong tỏa cho các lệnh giao dịch.
                      withdrawableCash:
                        type: integer
                        format: int32
                        example: 312369318
                        description: Tiền có thể rút.
                      cashDividendReceiving:
                        type: integer
                        format: int32
                        example: 11100000
                        description: Tiền cổ tức chờ về.
                    example:
                      totalCash: 316338724
                      availableCash: 316341327
                      depositInterest: 71570
                      totalDebt: 9491548
                      depositFeeAmount: 4122
                      secureAmount: 11174173
                      orderSecured: 7903713
                      withdrawableCash: 312369318
                      cashDividendReceiving: 11100000
                  derivative:
                    type: object
                    description: Thông tin tài sản chứng khoán phái sinh.
                    properties:
                      pendingDepositWithdraw:
                        type: integer
                        format: int32
                        example: 826996062
                        description: Tiền nộp/rút cọc chờ xử lý
                      remainSecure:
                        type: integer
                        format: int64
                        example: 120234072489
                        description: Cọc còn lại
                      usedSecure:
                        type: integer
                        format: int32
                        example: 307491492
                        description: Cọc đã sử dụng
                      pendingSecure:
                        type: integer
                        format: int32
                        example: 826996062
                        description: Cọc chờ duyệt
                      holdTaxAndFee:
                        type: integer
                        format: int32
                        example: 0
                        description: Thuế và phí tạm giữ
                      totalLoanDebt:
                        type: integer
                        format: int32
                        example: 4907500
                        description: Khoản ứng chưa hoàn
                    example:
                      pendingDepositWithdraw: 826996062
                      remainSecure: 120234072489
                      usedSecure: 307491492
                      pendingSecure: 826996062
                      holdTaxAndFee: 0
                      totalLoanDebt: 4907500
                  bond:
                    type: object
                    description: Thông tin tài sản trái phiếu
                    properties:
                      totalValue:
                        type: integer
                        format: int64
                        example: 40102762100
                        description: Tổng giá trị tài sản trái phiếu
                    example:
                      totalValue: 40102762100
                  egg:
                    type: object
                    description: Thông tin tài sản trứng vàng
                    properties:
                      totalValue:
                        type: integer
                        format: int32
                        example: 6849005
                        description: Tổng giá trị tài sản trứng
                    example:
                      totalValue: 6849005
              example:
                stock:
                  totalCash: 316338724
                  availableCash: 316341327
                  depositInterest: 71570
                  totalDebt: 9491548
                  depositFeeAmount: 4122
                  secureAmount: 11174173
                  orderSecured: 7903713
                  withdrawableCash: 312369318
                  cashDividendReceiving: 11100000
                derivative:
                  pendingDepositWithdraw: 826996062
                  remainSecure: 120234072489
                  usedSecure: 307491492
                  pendingSecure: 826996062
                  holdTaxAndFee: 0
                  totalLoanDebt: 4907500
                bond:
                  totalValue: 40102762100
                egg:
                  totalValue: 6849005
        '400':
          description: Yêu cầu không hợp lệ
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 400
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-003
                    description: Mã lỗi
                  message:
                    type: string
                    example: Thông tin nhập không hợp lệ
                    description: Thông điệp lỗi
              example:
                code: OA-003
                message: Thông tin nhập không hợp lệ
                status: 400
        '500':
          description: Lỗi hệ thống
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 500
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-009
                    description: Mã lỗi
                  message:
                    type: string
                    example: Lỗi hệ thống
                    description: Thông điệp lỗi
              example:
                code: OA-009
                message: Lỗi hệ thống
                status: 500
      tags:
        - account
      description: Cung cấp thông tin số dư tài khoản
    parameters:
      - name: accountNo
        in: path
        required: true
        description: Số tiểu khoản
        deprecated: false
        schema:
          type: string
        example: '0001179019'
  /accounts/{accountNo}/loan-packages:
    get:
      summary: Danh sách gói vay
      parameters:
        - name: marketType
          in: query
          required: true
          description: |-
            Loại thị trường 
            - STOCK: Gói vay giao dịch cơ sở
            - DERIVATIVE: Gói vay giao dịch phái sinh
            - BOND: Gói vay giao dịch trái phiếu
          deprecated: false
          schema:
            type: string
          example: STOCK
        - name: symbol
          in: query
          required: true
          description: Mã chứng khoán
          deprecated: false
          schema:
            type: string
          example: ACB
        - 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: Thời gian thực hiện yêu cầu
          schema:
            type: string
          example: '{{date}}'
        - name: X-Signature
          in: header
          required: true
          description: Chữ ký xác thực yêu cầu
          schema:
            type: string
          example: '{{signature}}'
        - name: version
          in: header
          description: API version (YYYY-MM-DD)
          schema:
            type: string
            format: date
          example: '2026-07-23'
      responses:
        '200':
          description: STOCK
          headers:
            Date:
              deprecated: false
              schema: {}
              example: Thu, 30 Jul 2026 04:44:20 GMT
            Vary:
              deprecated: false
              schema: {}
              example: Origin
            X-Ratelimit-Limit:
              deprecated: false
              schema: {}
              example: '-1'
            X-Ratelimit-Remaining:
              deprecated: false
              schema: {}
              example: '0'
            X-Ratelimit-Reset:
              deprecated: false
              schema: {}
              example: '1784800448'
            X-Tyk-Api-Expires:
              deprecated: false
              schema: {}
              example: Thu, 02 Jan 3000 15:04:00 UTC
            Transfer-Encoding:
              deprecated: false
              schema: {}
              example: chunked
          content:
            application/json:
              schema:
                type: object
                properties:
                  symbol:
                    type: string
                    example: ACB
                    description: Mã chứng khoán
                  marketType:
                    type: string
                    example: STOCK
                    description: |-
                      Loại thị trường
                      - STOCK: Gói vay giao dịch cơ sở
                      - DERIVATIVE: Gói vay giao dịch phái sinh
                  loanPackages:
                    type: array
                    example:
                      - id: 1775
                        name: GD Tiền mặt
                        initialRate: 1
                        interestRate: 0.125
                        liquidRate: 0.3
                        maintenanceRate: 0.4
                        type: M
                        brokerFirmBuyingFeeRate: 0
                        brokerFirmSellingFeeRate: 0
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          format: int32
                          example: 1775
                          description: Id gói vay
                        name:
                          type: string
                          example: GD Tiền mặt
                          description: Tên gói vay
                        initialRate:
                          type: integer
                          format: int32
                          example: 1
                          description: Tỷ lệ ban đầu
                        interestRate:
                          type: number
                          format: float
                          example: 0.125
                          description: Tỷ lệ lãi vay
                        liquidRate:
                          type: number
                          format: double
                          example: 0.3
                          description: Tỷ lệ xử lý (force sell)
                        maintenanceRate:
                          type: number
                          format: double
                          example: 0.4
                          description: Tỷ lệ duy trì (call margin)
                        type:
                          type: string
                          example: M
                          description: Loại gói vay
                        brokerFirmBuyingFeeRate:
                          type: number
                          format: double
                          example: 0
                          description: Phí giao dịch chiều mua công ty chứng khoán thu
                        brokerFirmSellingFeeRate:
                          type: number
                          format: double
                          example: 0
                          description: Phí giao dịch chiều bán công ty chứng khoán thu
                    description: ''
              examples:
                STOCK:
                  value:
                    symbol: ACB
                    marketType: STOCK
                    loanPackages:
                      - id: 1775
                        name: GD Tiền mặt
                        initialRate: 1
                        interestRate: 0.125
                        liquidRate: 0.3
                        maintenanceRate: 0.4
                        type: M
                        brokerFirmBuyingFeeRate: 0
                        brokerFirmSellingFeeRate: 0
                      - id: 1769
                        name: RocketX
                        initialRate: 0.5
                        interestRate: 0.125
                        liquidRate: 0.3
                        maintenanceRate: 0.4
                        type: M
                        brokerFirmBuyingFeeRate: 0.00045
                        brokerFirmSellingFeeRate: 0.00045
                DERIVATIVE:
                  value:
                    symbolType: VN30F1M
                    marketType: DERIVATIVE
                    loanPackages:
                      - id: 2279
                        name: Gói giao dịch 02
                        initialRate: 0.1848
                        maintenanceRate: 0.1735
                        liquidRate: 0.1731
                        tradingFee:
                          id: 2404
                          name: 2000/HĐ
                          scope: PRODUCT
                          channel: ALL
                          schemaType: FIXED
                          createdDate: '2022-12-13T08:22:12.530837Z'
                          modifiedDate: '2022-12-13T08:22:12.530837Z'
                          fixedTradingFee: 2000
                          fixedDailyCloseTradingFee: 2000
                      - id: 5058
                        name: Test Phái sinh 1212
                        initialRate: 0.1
                        maintenanceRate: 0.03
                        liquidRate: 0.02
                        tradingFee:
                          id: 5057
                          name: 1500/HĐ
                          scope: PRODUCT
                          channel: ALL
                          schemaType: FIXED
                          createdDate: '2023-12-12T03:55:37.22881Z'
                          modifiedDate: '2023-12-12T03:55:37.22881Z'
                          fixedTradingFee: 1500
                          fixedDailyCloseTradingFee: 1500
                      - id: 2278
                        name: Gói giao dịch 01
                        initialRate: 0.2065
                        maintenanceRate: 0.1979
                        liquidRate: 0.1938
                        tradingFee:
                          id: 2436
                          name: Miễn phí
                          scope: PRODUCT
                          channel: ALL
                          schemaType: FIXED
                          createdDate: '2023-02-02T04:22:56.199278Z'
                          modifiedDate: '2023-02-02T04:22:56.199278Z'
                          fixedTradingFee: 2000
                          fixedDailyCloseTradingFee: 2000
                      - id: 9990
                        name: Linhpham test
                        initialRate: 0.2065
                        maintenanceRate: 0.1979
                        liquidRate: 0.1938
                        tradingFee:
                          id: 9989
                          name: fdfhv
                          scope: PRODUCT
                          channel: ALL
                          schemaType: PROGRESSIVE
                          createdDate: '2026-01-16T09:09:15.556640382Z'
                          modifiedDate: '2026-01-16T09:09:15.556640382Z'
                          progressTradingFee:
                            - fromQuantity: 1
                              toQuantity: 2000
                              fee: 1500
                          progressDailyCloseTradingFee:
                            - fromQuantity: 2001
                              toQuantity: 3000
                              fee: 2196
        '400':
          description: Yêu cầu không hợp lệ
          headers:
            Date:
              schema:
                type: string
              example: Wed, 25 Mar 2026 16:03:33 GMT
            Vary:
              schema:
                type: string
              example: Origin
            X-Ratelimit-Limit:
              schema:
                type: integer
              example: 300
            X-Ratelimit-Remaining:
              schema:
                type: integer
              example: 294
            X-Ratelimit-Reset:
              schema:
                type: integer
              example: 1774540931
            X-Tyk-Api-Expires:
              schema:
                type: string
              example: Thu, 02 Jan 3000 15:04:00 UTC
            Transfer-Encoding:
              schema:
                type: string
              example: chunked
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 400
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: INVALID_INPUT
                    description: Mã lỗi
                  message:
                    type: string
                    example: marketType is invalid
                    description: Thông điệp lỗi
              example:
                status: 400
                code: INVALID_INPUT
                message: marketType is invalid
        '500':
          description: Lỗi hệ thống
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 500
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-009
                    description: Mã lỗi
                  message:
                    type: string
                    example: Lỗi hệ thống
                    description: Thông điệp lỗi
              example:
                code: OA-009
                message: Lỗi hệ thống
                status: 500
      tags:
        - account
      description: >-
        Truy vấn danh sách gói vay để đặt lệnh theo từng mã chứng khoán.


        Với giao dịch cơ sở, trả về **tối đa 2 gói vay** bao gồm:


        - Gói tiền mặt: Tỷ lệ ký quỹ tiền mặt 100%, không sử dụng tiền vay
        margin (`initialRate` = 1)
            
        - Gói vay ký quỹ (margin): Tỷ lệ ký quỹ dưới 100%, có sử dụng đòn bẩy
        tiền vay margin (`initialRate` ≠ 1)
            

        Với giao dịch phái sinh, tài khoản thường chỉ áp dụng **một gói vay duy
        nhất** cho tất cả các mã, với bộ tỷ lệ ký quỹ và phí cố định.
    parameters:
      - name: accountNo
        in: path
        required: true
        description: Số tiểu khoản
        deprecated: false
        schema:
          type: string
        example: '0001179019'
  /accounts/{accountNo}/ppse:
    get:
      summary: Sức mua, sức bán
      parameters:
        - name: marketType
          in: query
          required: true
          description: |-
            Loại thị trường 
            - STOCK: Giao dịch cơ sở
            - DERIVATIVE: Giao dịch phái sinh
            - BOND: Giao dịch trái phiếu
          deprecated: false
          schema:
            type: string
          example: STOCK
        - name: symbol
          in: query
          required: true
          description: Mã chứng khoán
          deprecated: false
          schema:
            type: string
          example: ACB
        - name: loanPackageId
          in: query
          required: true
          description: Id gói vay
          deprecated: false
          schema:
            type: string
          example: '5757'
        - name: price
          in: query
          required: true
          description: Giá đặt lệnh
          deprecated: false
          schema:
            type: string
          example: '23000'
        - name: X-API-Key
          in: header
          required: true
          description: API Key được cấp khi đăng ký dịch vụ
          deprecated: false
          schema:
            type: string
          example: '{{apiKey}}'
        - name: X-Aux-Date
          in: header
          required: true
          description: Thời gian thực hiện yêu cầu
          deprecated: false
          schema:
            type: string
          example: '{{date}}'
        - name: X-Signature
          in: header
          required: true
          description: Chữ ký xác thực yêu cầu
          deprecated: false
          schema:
            type: string
          example: '{{signature}}'
        - name: version
          in: header
          description: API version (YYYY-MM-DD)
          schema:
            type: string
            format: date
          example: '2026-07-23'
      responses:
        '200':
          description: OK
          headers:
            Content-Length:
              schema:
                type: integer
              example: 58
            Date:
              schema:
                type: string
              example: Wed, 18 Mar 2026 16:11:20 GMT
            Vary:
              schema:
                type: string
              example: Origin
            X-Ratelimit-Limit:
              schema:
                type: integer
              example: -1
            X-Ratelimit-Remaining:
              schema:
                type: integer
              example: 0
            X-Ratelimit-Reset:
              schema:
                type: integer
              example: 0
            X-Tyk-Api-Expires:
              schema:
                type: string
              example: Thu, 02 Jan 3000 15:04:00 UTC
          content:
            application/json:
              schema:
                type: object
                properties:
                  qmaxBuy:
                    type: integer
                    description: Khối lượng mua tối đa
                    format: int32
                  qmaxSell:
                    type: integer
                    description: Khối lượng bán tối đa
                    format: int32
                  price:
                    type: number
                    description: Giá đặt
                    format: double
                  pp0Buy:
                    type: integer
                    description: Giá trị sức mua còn lại
                    format: int32
              example:
                qmaxBuy: 13264
                qmaxSell: 6190
                price: 23000
                pp0Buy: 305167154
        '400':
          description: Yêu cầu không hợp lệ
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 400
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-003
                    description: Mã lỗi
                  message:
                    type: string
                    example: Thông tin nhập không hợp lệ
                    description: Thông điệp lỗi
              example:
                code: OA-003
                message: Thông tin nhập không hợp lệ
                status: 400
        '500':
          description: Lỗi hệ thống
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 500
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-009
                    description: Mã lỗi
                  message:
                    type: string
                    example: Lỗi hệ thống
                    description: Thông điệp lỗi
              example:
                code: OA-009
                message: Lỗi hệ thống
                status: 500
      tags:
        - account
      description: >-
        Lấy thông tin sức mua và sức bán của tiểu khoản theo mã chứng khoán và
        gói vay để kiểm tra khả năng đặt lệnh trước khi giao dịch.
    parameters:
      - name: accountNo
        in: path
        required: true
        description: Số tiểu khoản
        schema:
          type: string
        example: '0001179019'
  /accounts/{accountNo}/orders:
    get:
      summary: Sổ lệnh
      parameters:
        - name: marketType
          in: query
          required: true
          description: |-
            Loại thị trường 
            - STOCK: Giao dịch cơ sở
            - DERIVATIVE: Giao dịch phái sinh
            - BOND: Giao dịch trái phiếu
          deprecated: false
          schema:
            type: string
          example: STOCK
        - name: orderCategory
          in: query
          required: true
          description: |-
            Phân loại lệnh 
            - NORMAL: lệnh thường  (cơ sở, phái sinh, trái phiếu)
            - STOP: lệnh dừng có điều kiện (cơ sở, phái sinh)
            - OCO: lệnh OCO (phái sinh)
          deprecated: false
          schema:
            type: string
          example: NORMAL
        - name: pageIndex
          in: query
          required: true
          description: 'Kích thước trang dữ liệu '
          schema:
            type: integer
          example: 0
        - name: pageSize
          in: query
          required: true
          description: Số bản ghi trên mỗi trang
          schema:
            type: integer
          example: 10
        - 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: Thời gian thực hiện yêu cầu
          schema:
            type: string
          example: '{{date}}'
        - name: X-Signature
          in: header
          required: true
          description: Chữ ký xác thực yêu cầu
          schema:
            type: string
          example: '{{signature}}'
        - name: version
          in: header
          required: false
          description: API version (YYYY-MM-DD)
          deprecated: false
          schema:
            type: string
            format: date
          example: '2026-07-23'
      responses:
        '200':
          description: OK
          headers:
            Content-Length:
              schema:
                type: integer
              example: 641
            Date:
              schema:
                type: string
              example: Tue, 24 Mar 2026 03:32:29 GMT
            Vary:
              schema:
                type: string
              example: Origin
            X-Ratelimit-Limit:
              schema:
                type: integer
              example: -1
            X-Ratelimit-Remaining:
              schema:
                type: integer
              example: 0
            X-Ratelimit-Reset:
              schema:
                type: integer
              example: 0
            X-Tyk-Api-Expires:
              schema:
                type: string
              example: Thu, 02 Jan 3000 15:04:00 UTC
          content:
            application/json:
              schema:
                type: object
                properties:
                  orders:
                    type: array
                    example:
                      - id: 141
                        side: NB
                        accountNo: '0001179019'
                        symbol: BCM
                        price: 51200
                        priceSecure: 51200
                        averagePrice: 0
                        quantity: 300
                        fillQuantity: 0
                        canceledQuantity: 0
                        leaveQuantity: 300
                        orderType: LO
                        orderCategory: NORMAL
                        orderStatus: New
                        loanPackageId: 7937
                        marketType: STOCK
                        transDate: '2026-03-16'
                        createdDate: '2026-03-24T03:15:22.226297778Z'
                        modifiedDate: '2026-03-24T03:15:22.358568266Z'
                    description: Danh sách lệnh giao dịch
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 141
                          description: Id lệnh giao dịch
                          format: int32
                        side:
                          type: string
                          example: NB
                          description: |-
                            Chiều giao dịch
                            NB: Mua
                            NS: Bán
                        accountNo:
                          type: string
                          example: '0001179019'
                          description: Số tiểu khoản
                        symbol:
                          type: string
                          example: BCM
                          description: Mã chứng khoán
                        price:
                          type: number
                          example: 51200
                          description: Giá đặt
                          format: double
                        priceSecure:
                          type: number
                          example: 51200
                          description: Giá dùng để kiểm tra sức mua/đặt lệnh
                          format: double
                        averagePrice:
                          type: number
                          example: 0
                          description: Giá khớp trung bình
                          format: double
                        quantity:
                          type: integer
                          example: 300
                          description: Khối lượng đặt
                          format: int32
                        fillQuantity:
                          type: integer
                          example: 0
                          description: Khối lượng đã khớp
                          format: int32
                        canceledQuantity:
                          type: integer
                          example: 0
                          description: Khối lượng đã hủy
                          format: int32
                        leaveQuantity:
                          type: integer
                          example: 300
                          description: Khối lượng còn lại
                          format: int32
                        orderType:
                          type: string
                          example: LO
                          description: |-
                            Loại lệnh
                            - LO: Lệnh giới hạn
                            - MOK/MAK/MTL: Lệnh thị trường
                            - ATO/ATC: Lệnh phiên định kỳ mở cửa/đóng cửa
                            - PLO: Lệnh khớp lệnh sau giờ
                        orderCategory:
                          type: string
                          example: NORMAL
                          description: |-
                            Phân loại lệnh 
                            - NORMAL: lệnh thường  (cơ sở, phái sinh, trái phiếu)
                            - STOP: lệnh dừng có điều kiện (cơ sở, phái sinh)
                            - OCO: lệnh OCO (phái sinh)
                        orderStatus:
                          type: string
                          example: New
                          description: >-
                            Trạng thái lệnh NORMAL:

                              - Pending/PendingNew: Chờ gửi

                              - New: Chờ khớp

                              - PendingReplace: Chờ sửa

                              - PendingCancel: Chờ hủy

                              - PartiallyFilled: Khớp một phần

                              - Filled: Khớp toàn bộ

                              - Canceled: Đã hủy

                              - Rejected: Bị từ chối

                              - Expired: Hết hạn trong phiên

                              - DoneForDay: Lệnh được giải tỏa do không khớp trong phiên

                            Trạng thái lệnh STOP/OCO:

                              - New: Chờ kích hoạt                              
                              - Activated: Đã kích hoạt
                              - Cancelled: Đã hủy
                              - Expired: Hết hiệu lực
                              - Rejected: Bị từ chối
                              - Failed: Lệnh thất bại

                        loanPackageId:
                          type: integer
                          example: 7937
                          description: Gói vay áp dụng cho mã chứng khoán
                          format: int32
                        marketType:
                          type: string
                          example: STOCK
                          description: |-
                            Loại thị trường
                            - STOCK: Lệnh cơ sở
                            - DERIVATIVE: Lệnh phái sinh
                        transDate:
                          type: string
                          example: '2026-03-16'
                          description: Ngày giao dịch
                        createdDate:
                          type: string
                          example: '2026-03-24T03:15:22.226297778Z'
                          description: Thời điểm tạo
                          format: date-time
                        modifiedDate:
                          type: string
                          example: '2026-03-24T03:15:22.358568266Z'
                          description: Thời điểm cập nhật
                          format: date-time
              examples:
                NORMAL - STOCK:
                  value:
                    orders:
                      - id: 141
                        side: NB
                        accountNo: '0001179019'
                        symbol: BCM
                        price: 51200
                        priceSecure: 51200
                        averagePrice: 0
                        quantity: 300
                        fillQuantity: 0
                        canceledQuantity: 0
                        leaveQuantity: 300
                        orderType: LO
                        orderCategory: NORMAL
                        orderStatus: New
                        loanPackageId: 7937
                        marketType: STOCK
                        transDate: '2026-03-16'
                        createdDate: '2026-03-24T03:15:22.226297778Z'
                        modifiedDate: '2026-03-24T03:15:22.358568266Z'
                    pageIndex: 0
                    pageSize: 10
                    totalPages: 1
                    totalRecords: 1    
                NORMAL - DERIVATIVE:
                  value:
                    orders:
                      - id: 2286
                        side: NB
                        accountNo: '0001179019'
                        symbol: 41I1G9000
                        price: 1990.0
                        priceSecure: 1990.0
                        averagePrice: 0.0
                        quantity: 3
                        fillQuantity: 0
                        canceledQuantity: 0
                        leaveQuantity: 3
                        orderType: LO
                        orderCategory: NORMAL
                        orderStatus: New
                        loanPackageId: 2278
                        marketType: DERIVATIVE
                        transDate: '2026-07-31'
                        createdDate: '2026-07-31T03:15:22.226297778Z'
                        modifiedDate: '2026-07-31T03:15:22.358568266Z'
                    pageIndex: 0
                    pageSize: 10
                    totalPages: 1
                    totalRecords: 1                                                 
                STOP - DERIVATIVE:
                  value:
                    orders:
                      - accountNo: '0001179019'
                        conditionOperator: '>='
                        createdDate: '2026-07-30T15:07:17.616863Z'
                        durationDateTime: '2026-08-20T07:30:00Z'
                        durationType: GTD
                        id: d9lmh9fqs0csemaoe8tg
                        loanPackageId: 1306
                        marketType: DERIVATIVE
                        modifiedDate: '2026-07-30T15:07:17.616863Z'
                        orderCategory: STOP
                        orderStatus: New
                        orderType: LO
                        price: 1900
                        quantity: 3
                        side: NS
                        stopPrice: 1700
                        symbol: 41I1G8000
                      - accountNo: '0001179019'
                        conditionOperator: '>='
                        createdDate: '2026-07-30T10:43:31.246312Z'
                        durationDateTime: '2026-07-31T07:30:00Z'
                        durationType: GTD
                        id: d9lilkvqs0csemaodq3g
                        loanPackageId: 1306
                        marketType: DERIVATIVE
                        modifiedDate: '2026-07-30T10:43:31.246312Z'
                        orderCategory: STOP
                        orderStatus: New
                        orderType: LO
                        price: 1980.5
                        quantity: 1
                        side: NB
                        stopPrice: 2000
                        symbol: 41I1G8000
                    pageIndex: 0
                    pageSize: 2
                    totalPages: 4
                    totalRecords: 8
                OCO - DERIVATIVE:
                  value:
                    orders:
                      - accountNo: '0001179019'
                        createdDate: '2026-07-22T07:41:30.357676Z'
                        durationType: DAY
                        id: d9g78ahqn51s72sdntt0
                        loanPackageId: 2278
                        marketType: DERIVATIVE
                        modifiedDate: '2026-07-22T07:41:30.427436Z'
                        orderCategory: OCO
                        orderStatus: Expired
                        orderType: LO
                        price: 1990
                        quantity: 3
                        side: NB
                        stopOrderPrice: 2005
                        stopPrice: 2000
                        symbol: 41I1G8000
                    pageIndex: 0
                    pageSize: 10
                    totalPages: 1
                    totalRecords: 1
        '400':
          description: Yêu cầu không hợp lệ
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 400
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-003
                    description: Mã lỗi
                  message:
                    type: string
                    example: Thông tin nhập không hợp lệ
                    description: Thông điệp lỗi
              example:
                status: 400
                code: OA-003
                message: Thông tin nhập không hợp lệ
        '500':
          description: Lỗi hệ thống
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 500
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-009
                    description: Mã lỗi
                  message:
                    type: string
                    example: Lỗi hệ thống
                    description: Thông điệp lỗi
              example:
                code: OA-009
                message: Lỗi hệ thống
                status: 500
      tags:
        - account
      description: >-
        Lấy sổ lệnh giao dịch theo từng loại lệnh tương ứng thị trường cơ sở,
        phái sinh hay trái phiếu, bao gồm trạng thái và thông tin xử lý của từng
        lệnh.


        - Cơ sở (STOCK): lệnh thường (NORMAL), lệnh dừng có điều kiện (STOP)
            
        - Phái sinh (DERIVATIVE): lệnh thường (NORMAL), lệnh dừng có điều kiện
        (STOP), lệnh OCO (OCO)
            
        - Trái phiếu (BOND): lệnh thường (NORMAL)
    parameters:
      - name: accountNo
        in: path
        required: true
        description: Số tiểu khoản
        schema:
          type: string
        example: '0001179019'
    post:
      summary: Đặt lệnh
      parameters:
        - name: marketType
          in: query
          required: true
          description: |-
            Loại thị trường 
            - STOCK: Giao dịch cơ sở
            - DERIVATIVE: Giao dịch phái sinh
            - BOND: Giao dịch trái phiếu
          schema:
            type: string
          example: DERIVATIVE
        - name: orderCategory
          in: query
          required: true
          description: |-
            Phân loại lệnh 
            - NORMAL: lệnh thường  (cơ sở, phái sinh, trái phiếu)
            - STOP: lệnh dừng có điều kiện (cơ sở, phái sinh)
            - OCO: lệnh OCO (phái sinh)
          schema:
            type: string
          example: STOP
        - 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-Signature
          in: header
          required: true
          description: Chữ ký xác thực yêu cầu
          schema:
            type: string
          example: '{{signature}}'
        - name: X-Aux-Date
          in: header
          required: true
          description: Thời gian thực hiện yêu cầu
          schema:
            type: string
          example: '{{date}}'
        - name: trading-token
          in: header
          required: true
          description: Token đặt lệnh
          schema:
            type: string
          example: '{{tradingToken}}'
        - name: version
          in: header
          required: true
          description: API version (YYYY-MM-DD)
          schema:
            type: string
            format: date
          example: '2026-07-23'
      responses:
        '200':
          description: OK
          headers:
            Content-Length:
              schema:
                type: integer
              example: 487
            Date:
              schema:
                type: string
              example: Tue, 24 Mar 2026 04:09:50 GMT
            Vary:
              schema:
                type: string
              example: Origin
            X-Ratelimit-Limit:
              schema:
                type: integer
              example: -1
            X-Ratelimit-Remaining:
              schema:
                type: integer
              example: 0
            X-Ratelimit-Reset:
              schema:
                type: integer
              example: 0
            X-Tyk-Api-Expires:
              schema:
                type: string
              example: Thu, 02 Jan 3000 15:04:00 UTC
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    example: '1631'
                    description: Id lệnh giao dịch
                  accountNo:
                    type: string
                    example: '0001179019'
                    description: Số tiểu khoản
                  orderCategory:
                    type: string
                    example: NORMAL
                    description: |-
                      Phân loại lệnh
                      - NORMAL: Lệnh thường
                      - STOP: Lệnh dừng có điều kiện
                      - OCO: Lệnh OCO phái sinh
                  marketType:
                    type: string
                    example: STOCK
                    description: |-
                      Loại thị trường
                      - STOCK: Giao dịch cơ sở
                      - DERIVATIVE: Giao dịch phái sinh
                      - BOND: Giao dịch trái phiếu
                  symbol:
                    type: string
                    example: MBS
                    description: Mã chứng khoán
                  side:
                    type: string
                    example: NB
                    description: |-
                      Chiều đặt lệnh
                      - NB: Mua
                      - NS: Bán
                  orderType:
                    type: string
                    example: LO
                    description: |-
                      Loại lệnh
                      - LO: Lệnh giới hạn
                      - MOK/MAK/MTL: Lệnh thị trường
                      - ATO/ATC: Lệnh phiên định kỳ mở cửa/đóng cửa
                      - PLO: Lệnh khớp lệnh sau giờ
                  orderStatus:
                    type: string
                    example: Pending
                    description: |-
                      Trạng thái lệnh khi đặt thành công
                      - PendingNew: Chờ gửi (lệnh thường NORMAL)
                      - New: Chờ kích hoạt (lệnh STOP/OCO)
                  price:
                    type: number
                    format: double
                    example: 18600
                    description: Giá đặt
                  quantity:
                    type: integer
                    format: int32
                    example: 300
                    description: Khối lượng đặt
                  loanPackageId:
                    type: integer
                    format: int32
                    example: 1036
                    description: ID gói vay
                  transDate:
                    type: string
                    format: date
                    example: '2026-01-29'
                    description: Ngày giao dịch
                  createdDate:
                    type: string
                    format: date-time
                    example: '2026-08-03T07:27:34.272131175Z'
                    description: Thời điểm tạo lệnh
                  modifiedDate:
                    type: string
                    format: date-time
                    example: '2026-08-03T07:27:34.272132175Z'
                    description: Thời điểm cập nhật lệnh
              examples:
                NORMAL - STOCK:
                  value:
                      id: '1631'
                      accountNo: '0001179019'
                      orderCategory: NORMAL
                      marketType: STOCK
                      symbol: MBS
                      side: NB
                      orderType: LO
                      orderStatus: PendingNew
                      price: 18600
                      quantity: 300
                      loanPackageId: 5757
                      transDate: '2026-01-29'
                      createdDate: '2026-08-03T07:27:34.272131175Z'
                      modifiedDate: '2026-08-03T07:27:34.272132175Z'
                NORMAL - DERIVATIVE:
                  value:
                      id: '2230'
                      accountNo: '0001179019'
                      orderCategory: NORMAL
                      marketType: DERIVATIVE
                      symbol: 41I1G9000
                      side: NB
                      orderType: LO
                      orderStatus: PendingNew
                      price: 1990
                      quantity: 3
                      loanPackageId: 5757
                      transDate: '2026-08-03'
                      createdDate: '2026-08-03T07:27:34.272131175Z'
                      modifiedDate: '2026-08-03T07:27:34.272132175Z'
        '201':
          description: OK
          headers:
            Content-Length:
              schema:
                type: integer
              example: 413
            Date:
              schema:
                type: string
              example: Thu, 16 Jul 2026 07:46:52 GMT
            Vary:
              schema:
                type: string
              example: Origin
            X-Ratelimit-Limit:
              schema:
                type: integer
              example: -1
            X-Ratelimit-Remaining:
              schema:
                type: integer
              example: 0
            X-Ratelimit-Reset:
              schema:
                type: integer
              example: 1782966202
            X-Request-Id:
              schema:
                type: string
              example: OOvwkrZHakuuFwXsZNRNLnqfWJoMNBrT
            X-Tyk-Api-Expires:
              schema:
                type: string
              example: Thu, 02 Jan 3000 15:04:00 UTC
          content:
            application/json:
              schema:
                type: object
                description: Thông tin lệnh điều kiện.
                properties:
                  id:
                    type: string
                    description: Id lệnh giao dịch.
                  accountNo:
                    type: string
                    description: Số tiểu khoản.
                  orderCategory:
                    type: string
                    description: |
                      Phân loại lệnh
                      - NORMAL: Lệnh thường
                      - STOP: Lệnh dừng có điều kiện
                      - OCO: Lệnh OCO phái sinh
                  marketType:
                    type: string
                    description: |
                      Loại thị trường
                      - STOCK: Lệnh cơ sở
                      - DERIVATIVE: Lệnh phái sinh
                  symbol:
                    type: string
                    description: Mã chứng khoán
                  side:
                    type: string
                    description: |
                      Chiều đặt lệnh
                      - NB: Mua
                      - NS: Bán
                  orderType:
                    type: string
                    description: |
                      Loại lệnh đặt cho lệnh dừng (lệnh STOP/OCO)
                      - LO: Lệnh giới hạn
                      - MTL: Lệnh thị trường            
                  orderStatus:
                    type: string
                    description: |
                      Trạng thái lệnh khi đặt thành công
                      - PendingNew: Chờ gửi (lệnh thường NORMAL)
                      - New: Chờ kích hoạt (lệnh STOP/OCO)
                  price:
                    type: integer
                    description: Giá đặt
                  quantity:
                    type: integer
                    description: Khối lượng đặt
                  loanPackageId:
                    type: integer
                    description: ID gói vay
                  stopPrice:
                    type: integer
                    description: Giá điều kiện kích hoạt lệnh dừng
                  conditionOperator:
                    type: string
                    description: |
                      Điều kiện kích hoạt lệnh dừng (chỉ áp dụng với lệnh STOP)

                      - `>=`: Kích hoạt khi giá thị trường lớn hơn hoặc bằng giá điều kiện

                      - `<=`: Kích hoạt khi giá thị trường nhỏ hơn hoặc bằng giá điều kiện
                  durationType:
                    type: string
                    description: |
                      Thời hạn hiệu lực của lệnh
                      - DAY: Lệnh có hiệu lực trong ngày (lệnh OCO)
                      - GTD: Có hiệu lực đến ngày, giờ chỉ định (lệnh STOP)
                  durationDateTime:
                    type: string
                    description: Thời điểm hết hiệu lực của lệnh khi durationType là GTD (lệnh STOP).
                    format: date-time
                  createdDate:
                    type: string
                    description: Thời điểm tạo lệnh.
                    format: date-time
                  modifiedDate:
                    type: string
                    description: Thời điểm cập nhật lệnh.
                    format: date-time
              examples:
                STOP - DERIVATIVE:
                  value:
                    id: d9guo2d1j9cc72osmg1g
                    accountNo: '0001179019'
                    orderCategory: STOP
                    marketType: DERIVATIVE
                    symbol: 41I1G8000
                    side: NB
                    orderType: LO
                    orderStatus: New
                    price: 1990
                    quantity: 3
                    loanPackageId: 2278
                    stopPrice: 2000
                    conditionOperator: '>='
                    durationType: GTD
                    durationDateTime: '2026-08-01T07:30:00+07:00'
                    createdDate: '2026-07-23T10:25:13.251588Z'
                    modifiedDate: '2026-07-23T10:25:13.251588Z'
                OCO - DERIVATIVE:
                  value:
                    accountNo: '0001179019'
                    createdDate: '2026-08-04T02:24:40.055903Z'
                    durationType: DAY
                    id: d9okqq13qkqc72rbl930
                    loanPackageId: 2278
                    marketType: DERIVATIVE
                    modifiedDate: '2026-08-04T02:24:40.055903Z'
                    orderCategory: OCO
                    orderStatus: New
                    orderType: LO
                    price: 1916
                    quantity: 3
                    side: NS
                    stopOrderPrice: 1907
                    stopPrice: 1910
                    symbol: 41I1G9000
        '400':
          description: Yêu cầu không hợp lệ
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 400
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-003
                    description: Mã lỗi
                  message:
                    type: string
                    example: Thông tin nhập không hợp lệ
                    description: Thông điệp lỗi
              example:
                status: 400
                code: OA-003
                message: Thông tin nhập không hợp lệ
        '500':
          description: Lỗi hệ thống
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 500
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-009
                    description: Mã lỗi
                  message:
                    type: string
                    example: Lỗi hệ thống
                    description: Thông điệp lỗi
              example:
                code: OA-009
                message: Lỗi hệ thống
                status: 500
      tags:
        - trading
      description: >-
        Gửi yêu cầu đặt lệnh giao dịch trên tài khoản.
        Hỗ trợ các loại lệnh: 
      
        - Lệnh thường NORMAL: Cơ sở, Phái sinh, Trái phiếu            
      
        - Lệnh STOP: Cơ sở, Phái sinh
            
        - Lệnh OCO: Phái sinh
            

        Body request sẽ gồm các trường bắt buộc và khác nhau theo từng loại
        lệnh. Người dùng tham khảo hướng dẫn đặt lệnh ([tại đây](https://developers.dnse.com.vn/docs/guide/trading-api/trading_order))
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                symbol:
                  type: string
                  example: 41I1G8000
                  description: Mã chứng khoán cần đặt lệnh
                loanPackageId:
                  type: integer
                  format: int32
                  example: 2278
                  description: Mã gói vay theo mã chứng khoán
                orderType:
                  type: string
                  example: LO
                  description: >-
                    - Loại lệnh với NORMAL: LO (lệnh giới hạn), MOK/MAK/MTL
                    (lệnh thị trường), ATO/ATC (lệnh phiên định kỳ mở/đóng cửa),
                    PLO (lệnh sau giờ)

                    - Loại lệnh với STOP: LO (lệnh giới hạn), MTL (lệnh thị
                    trường)

                    - Loại lệnh với OCO: LO (lệnh giới hạn)
                price:
                  type: number
                  format: double
                  example: 1990
                  description: |-
                    - Lệnh NORMAL: Giá đặt
                    - Lệnh STOP: Giá đặt lệnh dừng
                    - Lệnh OCO: Giá đặt lệnh chốt lời 
                quantity:
                  type: integer
                  format: int32
                  example: 3
                  description: Khối lượng đặt
                side:
                  type: string
                  example: NB
                  description: |-
                    Chiều đặt lệnh
                    - NB: Mua
                    - NS: Bán
                stopPrice:
                  type: number
                  format: double
                  example: 2000
                  description: Giá điều kiện dùng để kích hoạt lệnh dừng (lệnh STOP, OCO)
                stopOrderPrice:
                  type: number
                  format: double
                  example: 2005
                  description: Giá đặt của lệnh cắt lỗ (chỉ áp dụng với lệnh OCO)
                conditionOperator:
                  type: string
                  example: '>='
                  description: >-
                    Điều kiện kích hoạt lệnh dừng (chỉ áp dụng với lệnh STOP)

                    - `>=`: Kích hoạt khi giá thị trường lớn hơn hoặc bằng
                    giá điều kiện

                    - `<=`: Kích hoạt khi giá thị trường nhỏ hơn hoặc bằng
                    giá điều kiện
                durationType:
                  type: string
                  example: GTD
                  description: |-
                    Hiệu lực của lệnh
                    - GTD: Có hiệu lực đến ngày, giờ chỉ định (lệnh STOP)
                    - DAY: Lệnh có hiệu lực trong ngày (lệnh OCO)
                durationDateTime:
                  type: string
                  format: date-time
                  example: '2026-08-01T07:30:00.000+07:00'
                  description: >-
                    Ngày, giờ hết hiệu lực của lệnh. Chỉ áp dụng khi
                    durationType = GTD (lệnh STOP)
            examples:
                NORMAL - STOCK:
                  value:                                
                    symbol: MBS
                    loanPackageId: 5757
                    orderType: LO
                    price: 18600
                    quantity: 300
                    side: NB            
                STOP - DERIVATIVE:
                  value:                                
                    symbol: 41I1G8000
                    loanPackageId: 2278
                    orderType: LO
                    price: 1990
                    quantity: 3
                    side: NB
                    stopPrice: 2000
                    conditionOperator: '>='
                    durationType: GTD
                    durationDateTime: '2026-08-01T07:30:00.000+07:00'
                OCO - DERIVATIVE:
                  value:                                
                    symbol: 41I1G9000
                    loanPackageId: 2278
                    orderType: LO
                    price: 1916
                    quantity: 3
                    side: NS
                    stopPrice: 1910
                    stopOrderPrice: 1907
                    durationType: DAY               
  /accounts/{accountNo}/orders/{orderId}:
    get:
      summary: Chi tiết lệnh theo ID
      parameters:
        - name: marketType
          in: query
          required: true
          description: |-
            Loại thị trường 
            - STOCK: Giao dịch cơ sở
            - DERIVATIVE: Giao dịch phái sinh
            - BOND: Giao dịch trái phiếu
          deprecated: false
          schema:
            type: string
          example: BOND
        - name: orderCategory
          in: query
          required: true
          description: Phân loại lệnh thường, lệnh điều kiện (mặc định NORMAL)
          deprecated: false
          schema:
            type: string
          example: NORMAL
        - name: X-API-Key
          in: header
          required: true
          description: API Key được cấp khi đăng ký dịch vụ
          deprecated: false
          schema:
            type: string
          example: '{{apiKey}}'
        - name: X-Aux-Date
          in: header
          required: true
          description: Thời gian thực hiện yêu cầu
          deprecated: false
          schema:
            type: string
          example: '{{date}}'
        - name: X-Signature
          in: header
          required: true
          description: Chữ ký xác thực yêu cầu
          deprecated: false
          schema:
            type: string
          example: '{{signature}}'
        - name: version
          in: header
          required: true
          description: API version (YYYY-MM-DD)
          schema:
            type: string
            format: date
          example: '2026-07-23'
      responses:
        '200':
          description: OK
          headers:
            Content-Length:
              schema:
                type: integer
              example: 966
            Date:
              schema:
                type: string
              example: Tue, 24 Mar 2026 03:35:03 GMT
            Vary:
              schema:
                type: string
              example: Origin
            X-Ratelimit-Limit:
              schema:
                type: integer
              example: -1
            X-Ratelimit-Remaining:
              schema:
                type: integer
              example: 0
            X-Ratelimit-Reset:
              schema:
                type: integer
              example: 0
            X-Tyk-Api-Expires:
              schema:
                type: string
              example: Thu, 02 Jan 3000 15:04:00 UTC
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: integer
                    example: 966
                    description: ID lệnh
                    format: int32
                  side:
                    type: string
                    example: NS
                    description: |-
                      Chiều giao dịch
                      - NB: Mua
                      - NS: Bán
                  accountNo:
                    type: string
                    example: '0001179019'
                    description: Số tiểu khoản
                  symbol:
                    type: string
                    example: 41I1G4000
                    description: Mã hợp đồng phái sinh
                  price:
                    type: number
                    example: 1706.1
                    description: Giá đặt lệnh
                    format: double
                  quantity:
                    type: integer
                    example: 5
                    description: Khối lượng đặt lệnh
                    format: int32
                  orderType:
                    type: string
                    example: LO
                    description: |-
                      Loại lệnh
                      - LO: Lệnh giới hạn
                      - MOK/MAK/MTL: Lệnh thị trường
                      - ATO/ATC: Lệnh phiên định kỳ mở cửa/đóng cửa
                      - PLO: Lệnh khớp lệnh sau giờ
                  loanPackageId:
                    type: integer
                    example: 2278
                    description: Mã gói vay
                    format: int32
                  orderCategory:
                    type: string
                    example: NORMAL
                    description: Phân loại lệnh (mặc định NORMAL)
                  orderStatus:
                    type: string
                    example: Filled
                    description: |-
                      Trạng thái lệnh
                      - Pending/PendingNew: Chờ gửi
                      - New: Chờ khớp
                      - PartiallyFilled: Khớp một phần
                      - Filled: Khớp toàn bộ
                      - Rejected: Bị từ chối
                      - Expired: Hết hạn trong phiên
                      - DoneForDay: Lệnh được giải tỏa do không khớp trong phiên
                  fillQuantity:
                    type: integer
                    example: 5
                    description: Khối lượng đã khớp
                    format: int32
                  lastQuantity:
                    type: integer
                    example: 2
                    description: Khối lượng khớp gần nhất
                    format: int32
                  lastPrice:
                    type: number
                    example: 1706.1
                    description: Giá khớp gần nhất
                    format: double
                  averagePrice:
                    type: number
                    example: 1750.96
                    description: Giá khớp trung bình
                    format: double
                  transDate:
                    type: string
                    example: '2026-03-16'
                    description: Ngày giao dịch
                  taxRate:
                    type: integer
                    example: 0
                    description: Tỷ lệ thuế
                    format: int32
                  exchangeFeeRate:
                    type: integer
                    example: 0
                    description: Tỷ lệ phí trả Sở giao dịch
                    format: int32
                  feeRate:
                    type: integer
                    example: 0
                    description: Tổng tỷ lệ phí của lệnh
                    format: int32
                  leaveQuantity:
                    type: integer
                    example: 0
                    description: Khối lượng còn lại chưa khớp
                    format: int32
                  canceledQuantity:
                    type: integer
                    example: 0
                    description: Khối lượng đã hủy
                    format: int32
                  error:
                    type: string
                    example: ''
                    description: Mã lỗi nếu lệnh bị từ chối
                  marketType:
                    type: string
                    example: DERIVATIVE
                    description: |-
                      Loại thị trường
                      - STOCK: Sổ lệnh cơ sở
                      - DERIVATIVE: Sổ lệnh phái sinh
                  priceSecure:
                    type: number
                    example: 1706.1
                    description: Giá dùng để kiểm tra sức mua/đặt lệnh
                    format: double
                  createdDate:
                    type: string
                    example: '2026-03-23T03:10:06.556826794Z'
                    description: Thời điểm tạo lệnh
                    format: date-time
                  modifiedDate:
                    type: string
                    example: '2026-03-23T04:07:45.683977124Z'
                    description: Thời điểm cập nhật lệnh
                    format: date-time
                  metadata:
                    type: string
                    example: >-
                      {"orderSession":"OPEN","dealId":"1.77410795472387E14","releaseSecureOnFilled":"false","originMaker":"1000005917-close_deal_177410795472387","dtaAccountNo":"D000113702","isForeigner":false,"probType":"CUSTOMER","eventNo":5}
                    description: Thông tin bổ sung của lệnh
              example:
                id: 966
                side: NS
                accountNo: '0001179019'
                symbol: 41I1G4000
                price: 1706.1
                quantity: 5
                orderType: LO
                loanPackageId: 2278
                orderCategory: NORMAL
                orderStatus: Filled
                fillQuantity: 5
                lastQuantity: 2
                lastPrice: 1706.1
                averagePrice: 1750.96
                transDate: '2026-03-16'
                taxRate: 0
                exchangeFeeRate: 0
                feeRate: 0
                leaveQuantity: 0
                canceledQuantity: 0
                error: ''
                marketType: DERIVATIVE
                priceSecure: 1706.1
                createdDate: '2026-03-23T03:10:06.556826794Z'
                modifiedDate: '2026-03-23T04:07:45.683977124Z'
                metadata: >-
                  {"orderSession":"OPEN","dealId":"1.77410795472387E14","releaseSecureOnFilled":"false","originMaker":"1000005917-close_deal_177410795472387","dtaAccountNo":"D000113702","isForeigner":false,"probType":"CUSTOMER","eventNo":5}
        '400':
          description: Yêu cầu không hợp lệ
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 400
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-003
                    description: Mã lỗi
                  message:
                    type: string
                    example: Thông tin nhập không hợp lệ
                    description: Thông điệp lỗi
              example:
                status: 400
                code: OA-003
                message: Thông tin nhập không hợp lệ
        '500':
          description: Lỗi hệ thống
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 500
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-009
                    description: Mã lỗi
                  message:
                    type: string
                    example: Lỗi hệ thống
                    description: Thông điệp lỗi
              example:
                code: OA-009
                message: Lỗi hệ thống
                status: 500
      tags:
        - account
      description: "Lấy thông tin chi tiết của một lệnh thường (NORMAL) theo\_`orderId`, bao gồm trạng thái, khối lượng, giá và các thông tin liên quan."
    parameters:
      - name: accountNo
        in: path
        required: true
        description: Số tiểu khoản
        deprecated: false
        schema:
          type: string
        example: '0001179019'
      - name: orderId
        in: path
        required: true
        description: Mã lệnh giao dịch
        deprecated: false
        schema:
          type: integer
        example: '966'
    put:
      summary: Sửa lệnh
      parameters:
        - name: marketType
          in: query
          required: true
          description: |-
            Loại thị trường 
            - STOCK: Giao dịch cơ sở
            - DERIVATIVE: Giao dịch phái sinh
            - BOND: Giao dịch trái phiếu
          deprecated: false
          schema:
            type: string
          example: DERIVATIVE
        - name: orderCategory
          in: query
          required: true
          description: Phân loại lệnh thường (mặc định NORMAL)
          deprecated: false
          schema:
            type: string
          example: NORMAL
        - 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-Signature
          in: header
          required: true
          description: Chữ ký xác thực yêu cầu
          schema:
            type: string
          example: '{{signature}}'
        - name: X-Aux-Date
          in: header
          required: true
          description: Thời gian thực hiện yêu cầu
          schema:
            type: string
          example: '{{date}}'
        - name: trading-token
          in: header
          required: true
          description: Token đặt lệnh
          schema:
            type: string
          example: '{{tradingToken}}'
        - name: version
          in: header
          description: API version (YYYY-MM-DD)
          schema:
            type: string
            format: date
          example: '2026-07-23'
      responses:
        '200':
          description: OK
          headers:
            Content-Length:
              schema:
                type: integer
              example: 435
            Date:
              schema:
                type: string
              example: Tue, 24 Mar 2026 04:14:21 GMT
            Vary:
              schema:
                type: string
              example: Origin
            X-Ratelimit-Limit:
              schema:
                type: integer
              example: -1
            X-Ratelimit-Remaining:
              schema:
                type: integer
              example: 0
            X-Ratelimit-Reset:
              schema:
                type: integer
              example: 0
            X-Tyk-Api-Expires:
              schema:
                type: string
              example: Thu, 02 Jan 3000 15:04:00 UTC
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: integer
                    example: 1626
                    description: Id lệnh giao dịch
                    format: int32
                  accountNo:
                    type: string
                    example: '0001179019'
                    description: Số tiểu khoản
                  side:
                    type: string
                    example: NS
                    description: |-
                      Chiều đặt lệnh
                      - NB: Mua
                      - NS: Bán
                  loanPackageId:
                    type: integer
                    example: 2278
                    description: Mã gói vay
                    format: int32
                  symbol:
                    type: string
                    example: 41I1G4000
                    description: Mã chứng khoán
                  orderType:
                    type: string
                    example: LO
                    description: |-
                      Loại lệnh
                      - LO: Lệnh giới hạn
                      - MOK/MAK/MTL: Lệnh thị trường
                      - ATO/ATC: Lệnh phiên định kỳ mở cửa/đóng cửa
                      - PLO: Lệnh khớp lệnh sau giờ
                  orderCategory:
                    type: string
                    example: NORMAL
                    description: Phân loại lệnh thường (mặc định NORMAL)
                  price:
                    type: number
                    example: 1851
                    description: Giá đặt
                    format: double
                  quantity:
                    type: integer
                    example: 3
                    description: Khối lượng đặt
                    format: int32
                  fillQuantity:
                    type: integer
                    example: 0
                    description: Khối lượng khớp
                    format: int32
                  canceledQuantity:
                    type: integer
                    example: 0
                    description: Khối lượng đã hủy
                    format: int32
                  marketType:
                    type: string
                    example: DERIVATIVE
                    description: |-
                      Loại thị trường
                      - STOCK: Lệnh cơ sở
                      - DERIVATIVE: Lệnh phái sinh
                  transDate:
                    type: string
                    example: '2026-03-16'
                    description: Ngày giao dịch
                  createdDate:
                    type: string
                    example: '2026-03-24T04:09:50.761146893Z'
                    description: Thời điểm tạo
                    format: date-time
                  modifiedDate:
                    type: string
                    example: '2026-03-24T04:14:21.004856492Z'
                    description: Thời điểm cập nhật
                    format: date-time
              example:
                id: 1626
                accountNo: '0001179019'
                side: NS
                loanPackageId: 2278
                symbol: 41I1G4000
                orderType: LO
                orderCategory: NORMAL
                price: 1851
                quantity: 3
                fillQuantity: 0
                canceledQuantity: 0
                marketType: DERIVATIVE
                transDate: '2026-03-16'
                createdDate: '2026-03-24T04:09:50.761146893Z'
                modifiedDate: '2026-03-24T04:14:21.004856492Z'
        '400':
          description: Yêu cầu không hợp lệ
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 400
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-003
                    description: Mã lỗi
                  message:
                    type: string
                    example: Thông tin nhập không hợp lệ
                    description: Thông điệp lỗi
              example:
                status: 400
                code: OA-003
                message: Thông tin nhập không hợp lệ
        '500':
          description: Lỗi hệ thống
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 500
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-009
                    description: Mã lỗi
                  message:
                    type: string
                    example: Lỗi hệ thống
                    description: Thông điệp lỗi
              example:
                code: OA-009
                message: Lỗi hệ thống
                status: 500
      tags:
        - trading
      description: "Gửi yêu cầu sửa lệnh đã đặt theo\_`orderId`.\n\n- Với cơ sở, lệnh sửa thành công đồng nghĩa với hủy lệnh cũ và đặt lại lệnh mới, người dùng có thể sửa đồng thời giá và khối lượng.\n    \n- Với phái sinh, người dùng chỉ có thể sửa hoặc giá hoặc khối lượng. Khối lượng sửa phải lớn hơn khối lượng đã khớp (nếu có)."
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                price:
                  type: number
                  example: 1851
                  description: >-
                    Giá mới cho lệnh LO

                    - Đối với lệnh cơ sở, có thể sửa cả giá và khối lượng

                    - Đối với lệnh phái sinh, chỉ được sửa hoặc giá hoặc khối
                    lượng
                  format: double
                quantity:
                  type: integer
                  example: 3
                  description: >-
                    Khối lượng mới

                    - Đối với lệnh phái sinh, khối lượng mới phải lớn hơn khối
                    lượng đã khớp (nếu có) của lệnh đã đặt
                  format: int32
            example:
              price: 1851
              quantity: 3
    delete:
      summary: Hủy lệnh
      parameters:
        - name: marketType
          in: query
          required: true
          description: |-
            Loại thị trường 
            - STOCK: Đặt lệnh cơ sở
            - DERIVATIVE: Đặt lệnh phái sinh
          deprecated: false
          schema:
            type: string
          example: DERIVATIVE
        - name: orderCategory
          in: query
          required: true
          description: |-
            Phân loại lệnh 
            - NORMAL: lệnh thường  (cơ sở, phái sinh, trái phiếu)
            - STOP: lệnh dừng có điều kiện (cơ sở, phái sinh)
            - OCO: lệnh OCO (phái sinh)
          deprecated: false
          schema:
            type: string
          example: STOP
        - 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-Signature
          in: header
          required: true
          description: Chữ ký xác thực yêu cầu
          schema:
            type: string
          example: '{{signature}}'
        - name: X-Aux-Date
          in: header
          required: true
          description: Thời gian thực hiện yêu cầu
          schema:
            type: string
          example: '{{date}}'
        - name: trading-token
          in: header
          required: true
          description: Token đặt lệnh
          schema:
            type: string
          example: '{{tradingToken}}'
        - name: version
          in: header
          required: true
          description: API version (YYYY-MM-DD)
          schema:
            type: string
            format: date
          example: '2026-07-23'
      responses:
        '200':
          description: OK
          headers:
            Date:
              deprecated: false
              schema: {}
              example: Tue, 04 Aug 2026 02:53:09 GMT
            Vary:
              deprecated: false
              schema: {}
              example: Origin
            X-Ratelimit-Limit:
              deprecated: false
              schema: {}
              example: '-1'
            X-Ratelimit-Remaining:
              deprecated: false
              schema: {}
              example: '0'
            X-Ratelimit-Reset:
              deprecated: false
              schema: {}
              example: '1784794513'
            X-Tyk-Api-Expires:
              deprecated: false
              schema: {}
              example: Thu, 02 Jan 3000 15:04:00 UTC
            Transfer-Encoding:
              deprecated: false
              schema: {}
              example: chunked
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    example: '741'
                    description: Id lệnh giao dịch
                  accountNo:
                    type: string
                    example: '0001179019'
                    description: Số tiểu khoản
                  orderCategory:
                    type: string
                    example: NORMAL
                    description: |-
                      Phân loại lệnh 
                      - NORMAL: lệnh thường  (cơ sở, phái sinh, trái phiếu)
                      - STOP: lệnh dừng có điều kiện (cơ sở, phái sinh)
                      - OCO: lệnh OCO (phái sinh)                      
                  marketType:
                    type: string
                    example: STOCK
                    description: |-
                      Loại thị trường
                      - STOCK: Lệnh cơ sở
                      - DERIVATIVE: Lệnh phái sinh
                      - BOND: Lệnh phái sinh
                  symbol:
                    type: string
                    example: SHS
                    description: Mã chứng khoán
                  side:
                    type: string
                    example: NB
                    description: |-
                      Chiều đặt lệnh
                      - NB: Mua
                      - NS: Bán
                  orderType:
                    type: string
                    example: LO
                    description: |-
                      Loại lệnh
                      - LO: Lệnh giới hạn
                      - MOK/MAK/MTL: Lệnh thị trường
                      - ATO/ATC: Lệnh phiên định kỳ mở cửa/đóng cửa
                      - PLO: Lệnh khớp lệnh sau giờ
                  orderStatus:
                    type: string
                    example: PendingCancel
                    description: |-
                            Trạng thái lệnh NORMAL:

                              - Pending/PendingNew: Chờ gửi

                              - New: Chờ khớp

                              - PendingReplace: Chờ sửa

                              - PendingCancel: Chờ hủy

                              - PartiallyFilled: Khớp một phần

                              - Filled: Khớp toàn bộ

                              - Canceled: Đã hủy

                              - Rejected: Bị từ chối

                              - Expired: Hết hạn trong phiên

                              - DoneForDay: Lệnh được giải tỏa do không khớp trong phiên

                            Trạng thái lệnh STOP/OCO:

                              - New: Chờ kích hoạt                              
                              - Activated: Đã kích hoạt
                              - Cancelled: Đã hủy
                              - Expired: Hết hiệu lực
                              - Rejected: Bị từ chối
                              - Failed: Lệnh thất bại
                  price:
                    type: integer
                    format: int32
                    example: 15600
                    description: Giá đặt
                  quantity:
                    type: integer
                    format: int32
                    example: 800
                    description: Khối lượng đặt
                  loanPackageId:
                    type: integer
                    format: int32
                    example: 1372
                    description: Mã gói vay
                  priceSecure:
                    type: integer
                    format: int32
                    example: 15600
                    description: Giá bảo đảm
                  averagePrice:
                    type: integer
                    format: int32
                    example: 0
                    description: Giá khớp trung bình
                  fillQuantity:
                    type: integer
                    format: int32
                    example: 0
                    description: Khối lượng khớp
                  canceledQuantity:
                    type: integer
                    format: int32
                    example: 0
                    description: Khối lượng đã hủy
                  leaveQuantity:
                    type: integer
                    format: int32
                    example: 800
                    description: Khối lượng còn lại
                  transDate:
                    type: string
                    example: '2026-01-30'
                    description: Ngày giao dịch
                  createdDate:
                    type: string
                    format: date-time
                    example: '2026-08-04T02:52:57.305213488Z'
                    description: Thời điểm tạo
                  modifiedDate:
                    type: string
                    format: date-time
                    example: '2026-08-04T02:53:09.831996595Z'
                    description: Thời điểm cập nhật
              examples:
                NORMAL - STOCK:
                  value:
                    id: '741'
                    accountNo: '0001179019'
                    orderCategory: NORMAL
                    marketType: STOCK
                    symbol: SHS
                    side: NB
                    orderType: LO
                    orderStatus: PendingCancel
                    price: 15600
                    quantity: 800
                    loanPackageId: 1372
                    priceSecure: 15600
                    averagePrice: 0
                    fillQuantity: 0
                    canceledQuantity: 0
                    leaveQuantity: 800
                    transDate: '2026-01-30'
                    createdDate: '2026-08-04T02:52:57.305213488Z'
                    modifiedDate: '2026-08-04T02:53:09.831996595Z'
                STOP - DERIVATIVE:
                  value:
                    accountNo: '0001179019'
                    conditionOperator: '>='
                    createdDate: '2026-08-04T02:56:19.530727Z'
                    durationDateTime: '2026-08-08T07:30:00Z'
                    durationType: GTD
                    id: d9ol9kq0cvks72pfqiug
                    loanPackageId: 2278
                    marketType: DERIVATIVE
                    modifiedDate: '2026-08-04T02:56:43.821292Z'
                    orderCategory: STOP
                    orderStatus: Canceled
                    orderType: LO
                    price: 1991
                    quantity: 4
                    side: NS
                    stopPrice: 1990
                    symbol: 41I1G9000
        '400':
          description: Yêu cầu không hợp lệ
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 400
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-003
                    description: Mã lỗi
                  message:
                    type: string
                    example: Thông tin nhập không hợp lệ
                    description: Thông điệp lỗi
              example:
                status: 400
                code: OA-003
                message: Thông tin nhập không hợp lệ
        '500':
          description: Lỗi hệ thống
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 500
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-009
                    description: Mã lỗi
                  message:
                    type: string
                    example: Lỗi hệ thống
                    description: Thông điệp lỗi
              example:
                code: OA-009
                message: Lỗi hệ thống
                status: 500
      tags:
        - trading
      description: "Gửi yêu cầu hủy lệnh đã đặt theo\_`orderId.`\n\nHỗ trợ hủy các loại lệnh:\n\n- Lệnh thường NORMAL có trạng thái: chờ gửi, chờ khớp hoặc đã khớp 1 phần trong thời gian quy định\n    \n- Lệnh STOP /OCO có trạng thái: chờ kích hoạt"
  /accounts/{accountNo}/executions/{orderId}:
    get:
      summary: Chi tiết trạng thái lệnh
      parameters:
        - name: marketType
          in: query
          required: true
          description: |-
            Loại thị trường 
            - STOCK: Lệnh cơ sở
            - DERIVATIVE: Lệnh phái sinh
            - BOND: Lệnh trái phiếu
          schema:
            type: string
          example: DERIVATIVE
        - name: orderCategory
          in: query
          required: true
          description: Phân loại lệnh thường (mặc định NORMAL)
          schema:
            type: string
          example: NORMAL
        - 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: Thời gian thực hiện yêu cầu
          schema:
            type: string
          example: '{{date}}'
        - name: X-Signature
          in: header
          required: true
          description: Chữ ký xác thực yêu cầu
          schema:
            type: string
          example: '{{signature}}'
        - name: version
          in: header
          description: API version (YYYY-MM-DD)
          schema:
            type: string
            format: date
          example: '2026-07-23'
      responses:
        '200':
          description: OK
          headers:
            Content-Length:
              schema:
                type: integer
              example: 2628
            Date:
              schema:
                type: string
              example: Wed, 08 Apr 2026 06:28:59 GMT
            Vary:
              schema:
                type: string
              example: Origin
            X-Ratelimit-Limit:
              schema:
                type: integer
              example: 100000
            X-Ratelimit-Remaining:
              schema:
                type: integer
              example: 99998
            X-Ratelimit-Reset:
              schema:
                type: integer
              example: 1775715087
            X-Tyk-Api-Expires:
              schema:
                type: string
              example: Thu, 02 Jan 3000 15:04:00 UTC
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: integer
                    format: int32
                    example: 1651
                    description: ID lệnh
                  side:
                    type: string
                    example: NB
                    description: |-
                      Chiều giao dịch
                      - NB: Mua
                      - NS: Bán
                  accountNo:
                    type: string
                    example: '0001179019'
                    description: Số tiểu khoản
                  symbol:
                    type: string
                    example: HPG
                    description: Mã chứng khoán
                  price:
                    type: integer
                    format: int32
                    example: 24250
                    description: Giá đặt lệnh
                  quantity:
                    type: integer
                    format: int32
                    example: 500
                    description: Khối lượng đặt lệnh
                  orderType:
                    type: string
                    example: LO
                    description: |-
                      Loại lệnh
                      - LO: Lệnh giới hạn
                      - MOK/MAK/MTL: Lệnh thị trường
                      - ATO/ATC: Lệnh phiên định kỳ mở cửa/đóng cửa
                      - PLO: Lệnh khớp lệnh sau giờ
                  loanPackageId:
                    type: integer
                    format: int32
                    example: 5757
                    description: Mã gói vay
                  orderCategory:
                    type: string
                    example: NORMAL
                    description: Phân loại lệnh (mặc định NORMAL)
                  orderStatus:
                    type: string
                    example: PartiallyFilled
                    description: |-
                      Trạng thái lệnh
                      - Pending/PendingNew: Chờ gửi
                      - New: Chờ khớp
                      - PartiallyFilled: Khớp một phần
                      - Filled: Khớp toàn bộ
                      - Rejected: Bị từ chối
                      - Expired: Hết hạn trong phiên
                      - DoneForDay: Lệnh được giải tỏa do không khớp trong phiên
                  fillQuantity:
                    type: integer
                    format: int32
                    example: 200
                    description: Khối lượng đã khớp
                  lastQuantity:
                    type: integer
                    format: int32
                    example: 100
                    description: Khối lượng khớp gần nhất
                  lastPrice:
                    type: integer
                    format: int32
                    example: 24250
                    description: Giá khớp gần nhất
                  averagePrice:
                    type: integer
                    format: int32
                    example: 24250
                    description: Giá khớp trung bình
                  transDate:
                    type: string
                    example: '2026-07-13'
                    description: Ngày giao dịch
                  taxRate:
                    type: integer
                    format: int32
                    example: 0
                    description: Tỷ lệ thuế
                  exchangeFeeRate:
                    type: number
                    format: double
                    example: 0.00027
                    description: Tỷ lệ phí trả Sở giao dịch
                  feeRate:
                    type: number
                    format: double
                    example: 0.00027
                    description: Tổng tỷ lệ phí của lệnh
                  leaveQuantity:
                    type: integer
                    format: int32
                    example: 300
                    description: Khối lượng còn lại chưa khớp
                  canceledQuantity:
                    type: integer
                    format: int32
                    example: 0
                    description: Khối lượng đã hủy
                  error:
                    type: string
                    example: ''
                    description: Mã lỗi nếu lệnh bị từ chối
                  marketType:
                    type: string
                    example: STOCK
                    description: |-
                      Loại thị trường
                      - STOCK: Lệnh cơ sở
                      - DERIVATIVE: Lệnh phái sinh
                  priceSecure:
                    type: integer
                    format: int32
                    example: 24250
                    description: Giá dùng để kiểm tra sức mua/đặt lệnh
                  createdDate:
                    type: string
                    format: date-time
                    example: '2026-07-13T06:50:36.532741Z'
                    description: Thời điểm tạo lệnh
                  modifiedDate:
                    type: string
                    format: date-time
                    example: '2026-07-13T06:50:59.052768Z'
                    description: Thời điểm cập nhật lệnh
                  metadata:
                    type: string
                    example: >-
                      {"orderSession":"OPEN","ip":"202.60.110.58","maker":"1000005917","isForeigner":false,"reqId":"24534","probType":"CUSTOMER_8000","eventNo":4.0}
                    description: Thông tin bổ sung của lệnh
                  reports:
                    type: array
                    description: Danh sách trạng thái lệnh theo từng lần cập nhật
                    example:
                      - id: 1651
                        side: NB
                        accountNo: '0001179019'
                        symbol: HPG
                        price: 24250
                        quantity: 500
                        orderType: LO
                        orderStatus: PartiallyFilled
                        fillQuantity: 100
                        lastQuantity: 100
                        lastPrice: 24250
                        averagePrice: 24250
                        transDate: '2026-07-13'
                        createdDate: '2026-07-13T06:50:36.532741Z'
                        modifiedDate: '2026-07-13T06:50:51.613222Z'
                        taxRate: 0
                        exchangeFeeRate: 0
                        feeRate: 0.00027
                        leaveQuantity: 400
                        canceledQuantity: 0
                        error: ''
                        priceSecure: 24250
                        metadata: >-
                          {"orderSession":"OPEN","ip":"202.60.110.58","maker":"1000005917","isForeigner":false,"reqId":"24534","probType":"CUSTOMER_8000","eventNo":3}
                        loanPackageId: 5757
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          format: int32
                          example: 1651
                          description: ID lệnh
                        side:
                          type: string
                          example: NB
                          description: |-
                            Chiều giao dịch
                            - NB: Mua
                            - NS: Bán
                        accountNo:
                          type: string
                          example: '0001179019'
                          description: Số tiểu khoản
                        symbol:
                          type: string
                          example: HPG
                          description: Mã chứng khoán
                        price:
                          type: integer
                          format: int32
                          example: 24250
                          description: Giá đặt lệnh
                        quantity:
                          type: integer
                          format: int32
                          example: 500
                          description: Khối lượng đặt lệnh
                        orderType:
                          type: string
                          example: LO
                          description: |-
                            Loại lệnh
                            - LO: Lệnh giới hạn
                            - MOK/MAK/MTL: Lệnh thị trường
                            - ATO/ATC: Lệnh phiên định kỳ mở cửa/đóng cửa
                            - PLO: Lệnh khớp lệnh sau giờ
                        orderStatus:
                          type: string
                          example: PartiallyFilled
                          description: >-
                            Trạng thái lệnh

                            - Pending/PendingNew: Chờ gửi

                            - New: Chờ khớp

                            - PartiallyFilled: Khớp một phần

                            - Filled: Khớp toàn bộ

                            - Rejected: Bị từ chối

                            - Expired: Hết hạn trong phiên

                            - DoneForDay: Lệnh được giải tỏa do không khớp trong
                            phiên
                        fillQuantity:
                          type: integer
                          format: int32
                          example: 100
                          description: Khối lượng đã khớp
                        lastQuantity:
                          type: integer
                          format: int32
                          example: 100
                          description: Khối lượng khớp gần nhất
                        lastPrice:
                          type: integer
                          format: int32
                          example: 24250
                          description: Giá khớp gần nhất
                        averagePrice:
                          type: integer
                          format: int32
                          example: 24250
                          description: Giá khớp trung bình
                        transDate:
                          type: string
                          example: '2026-07-13'
                          description: Ngày giao dịch
                        createdDate:
                          type: string
                          format: date-time
                          example: '2026-07-13T06:50:36.532741Z'
                          description: Thời điểm tạo lệnh
                        modifiedDate:
                          type: string
                          format: date-time
                          example: '2026-07-13T06:50:51.613222Z'
                          description: Thời điểm cập nhật lệnh
                        taxRate:
                          type: integer
                          format: int32
                          example: 0
                          description: Tỷ lệ thuế
                        exchangeFeeRate:
                          type: integer
                          format: int32
                          example: 0
                          description: Tỷ lệ phí trả Sở giao dịch
                        feeRate:
                          type: number
                          format: double
                          example: 0.00027
                          description: Tổng tỷ lệ phí của lệnh
                        leaveQuantity:
                          type: integer
                          format: int32
                          example: 400
                          description: Khối lượng còn lại chưa khớp
                        canceledQuantity:
                          type: integer
                          format: int32
                          example: 0
                          description: Khối lượng đã hủy
                        error:
                          type: string
                          example: ''
                          description: Mã lỗi nếu lệnh bị từ chối
                        priceSecure:
                          type: integer
                          format: int32
                          example: 24250
                          description: Giá dùng để kiểm tra sức mua/đặt lệnh
                        metadata:
                          type: string
                          example: >-
                            {"orderSession":"OPEN","ip":"202.60.110.58","maker":"1000005917","isForeigner":false,"reqId":"24534","probType":"CUSTOMER_8000","eventNo":3}
                          description: Thông tin bổ sung của lệnh
                        loanPackageId:
                          type: integer
                          format: int32
                          example: 5757
                          description: ID gói vay
              examples:
                STOCK:
                  value:
                    id: 1651
                    side: NB
                    accountNo: '0001179019'
                    symbol: HPG
                    price: 24250
                    quantity: 500
                    orderType: LO
                    loanPackageId: 5757
                    orderCategory: NORMAL
                    orderStatus: PartiallyFilled
                    fillQuantity: 200
                    lastQuantity: 100
                    lastPrice: 24250
                    averagePrice: 24250
                    transDate: '2026-07-13'
                    taxRate: 0
                    exchangeFeeRate: 0.00027
                    feeRate: 0.00027
                    leaveQuantity: 300
                    canceledQuantity: 0
                    error: ''
                    marketType: STOCK
                    priceSecure: 24250
                    createdDate: '2026-07-13T06:50:36.532741Z'
                    modifiedDate: '2026-07-13T06:50:59.052768Z'
                    metadata: >-
                      {"orderSession":"OPEN","ip":"202.60.110.58","maker":"1000005917","isForeigner":false,"reqId":"24534","probType":"CUSTOMER_8000","eventNo":4.0}
                    reports:
                      - id: 1651
                        side: NB
                        accountNo: '0001179019'
                        symbol: HPG
                        price: 24250
                        quantity: 500
                        orderType: LO
                        orderStatus: PartiallyFilled
                        fillQuantity: 100
                        lastQuantity: 100
                        lastPrice: 24250
                        averagePrice: 24250
                        transDate: '2026-07-13'
                        createdDate: '2026-07-13T06:50:36.532741Z'
                        modifiedDate: '2026-07-13T06:50:51.613222Z'
                        taxRate: 0
                        exchangeFeeRate: 0
                        feeRate: 0.00027
                        leaveQuantity: 400
                        canceledQuantity: 0
                        error: ''
                        priceSecure: 24250
                        metadata: >-
                          {"orderSession":"OPEN","ip":"202.60.110.58","maker":"1000005917","isForeigner":false,"reqId":"24534","probType":"CUSTOMER_8000","eventNo":3}
                        loanPackageId: 5757
                      - id: 1651
                        side: NB
                        accountNo: '0001179019'
                        symbol: HPG
                        price: 24250
                        quantity: 500
                        orderType: LO
                        orderStatus: PartiallyFilled
                        fillQuantity: 100
                        lastQuantity: 100
                        lastPrice: 24250
                        averagePrice: 24250
                        transDate: '2026-07-13'
                        createdDate: '2026-07-13T06:50:36.532741Z'
                        modifiedDate: '2026-07-13T06:50:51.613222Z'
                        taxRate: 0
                        exchangeFeeRate: 0
                        feeRate: 0.00027
                        leaveQuantity: 400
                        canceledQuantity: 0
                        error: ''
                        priceSecure: 24250
                        metadata: >-
                          {"orderSession":"OPEN","ip":"202.60.110.58","maker":"1000005917","isForeigner":false,"reqId":"24534","probType":"CUSTOMER_8000","eventNo":3}
                        loanPackageId: 5757
                      - id: 1651
                        side: NB
                        accountNo: '0001179019'
                        symbol: HPG
                        price: 24250
                        quantity: 500
                        orderType: LO
                        orderStatus: PendingNew
                        fillQuantity: 0
                        lastQuantity: 0
                        lastPrice: 0
                        averagePrice: 0
                        transDate: '2026-07-13'
                        createdDate: '2026-07-13T06:50:36.532741Z'
                        modifiedDate: '2026-07-13T06:50:36.532743Z'
                        taxRate: 0
                        exchangeFeeRate: 0
                        feeRate: 0.00027
                        leaveQuantity: 500
                        canceledQuantity: 0
                        error: <no value>
                        priceSecure: 24250
                        metadata: >-
                          {"orderSession":"OPEN","ip":"202.60.110.58","maker":"1000005917","isForeigner":false,"reqId":"24534","probType":"CUSTOMER_8000","eventNo":1}
                        loanPackageId: 5757
                      - id: 1651
                        side: NB
                        accountNo: '0001179019'
                        symbol: HPG
                        price: 24250
                        quantity: 500
                        orderType: LO
                        orderStatus: New
                        fillQuantity: 0
                        lastQuantity: 0
                        lastPrice: 0
                        averagePrice: 0
                        transDate: '2026-07-13'
                        createdDate: '2026-07-13T06:50:36.532741Z'
                        modifiedDate: '2026-07-13T06:50:36.545128Z'
                        taxRate: 0
                        exchangeFeeRate: 0
                        feeRate: 0.00027
                        leaveQuantity: 500
                        canceledQuantity: 0
                        error: ''
                        priceSecure: 24250
                        metadata: >-
                          {"orderSession":"OPEN","ip":"202.60.110.58","maker":"1000005917","isForeigner":false,"reqId":"24534","probType":"CUSTOMER_8000","eventNo":2}
                        loanPackageId: 5757
                      - id: 1651
                        side: NB
                        accountNo: '0001179019'
                        symbol: HPG
                        price: 24250
                        quantity: 500
                        orderType: LO
                        orderStatus: PartiallyFilled
                        fillQuantity: 200
                        lastQuantity: 100
                        lastPrice: 24250
                        averagePrice: 24250
                        transDate: '2026-07-13'
                        createdDate: '2026-07-13T06:50:36.532741Z'
                        modifiedDate: '2026-07-13T06:50:59.052768Z'
                        taxRate: 0
                        exchangeFeeRate: 0
                        feeRate: 0.00027
                        leaveQuantity: 300
                        canceledQuantity: 0
                        error: ''
                        priceSecure: 24250
                        metadata: >-
                          {"orderSession":"OPEN","ip":"202.60.110.58","maker":"1000005917","isForeigner":false,"reqId":"24534","probType":"CUSTOMER_8000","eventNo":4}
                        loanPackageId: 5757
                DERIVATIVE:
                  value:
                    id: 26
                    side: NB
                    accountNo: '0001179019'
                    symbol: 41I1G9000
                    price: 2003
                    quantity: 2
                    orderType: LO
                    loanPackageId: 2279
                    orderCategory: NORMAL
                    orderStatus: Filled
                    fillQuantity: 2
                    lastQuantity: 2
                    lastPrice: 2003
                    averagePrice: 2003
                    transDate: '2026-07-31'
                    taxRate: 0
                    exchangeFeeRate: 0
                    feeRate: 0
                    leaveQuantity: 0
                    canceledQuantity: 0
                    error: ''
                    marketType: DERIVATIVE
                    priceSecure: 2003
                    createdDate: '2026-08-04T02:00:02.855824889Z'
                    modifiedDate: '2026-08-04T02:50:30.56129326Z'
                    metadata: >-
                      {"orderSession":"ATO","dealId":178488852178882,"releaseSecureOnFilled":false,"originMaker":"risk-management","dtaAccountNo":"D000113702","maker":"risk-management","isForeigner":false,"probType":"CUSTOMER_8000","eventNo":3}
                    reports:
                      - id: 26
                        side: NB
                        accountNo: '0001179019'
                        symbol: 41I1G9000
                        price: 2003
                        quantity: 2
                        orderType: LO
                        orderStatus: PendingNew
                        fillQuantity: 0
                        lastQuantity: 0
                        lastPrice: 0
                        averagePrice: 0
                        transDate: '2026-07-31'
                        createdDate: '2026-08-04T02:00:02.855824889Z'
                        modifiedDate: '2026-08-04T02:00:02.855825105Z'
                        taxRate: 0
                        exchangeFeeRate: 0
                        feeRate: 0
                        leaveQuantity: 2
                        canceledQuantity: 0
                        error: <no value>
                        priceSecure: 2003
                        metadata: >-
                          {"orderSession":"ATO","dealId":178488852178882,"releaseSecureOnFilled":false,"originMaker":"risk-management","dtaAccountNo":"D000113702","maker":"risk-management","isForeigner":false,"probType":"CUSTOMER_8000","eventNo":1}
                        loanPackageId: 2279
                      - id: 26
                        side: NB
                        accountNo: '0001179019'
                        symbol: 41I1G9000
                        price: 2003
                        quantity: 2
                        orderType: LO
                        orderStatus: New
                        fillQuantity: 0
                        lastQuantity: 0
                        lastPrice: 0
                        averagePrice: 0
                        transDate: '2026-07-31'
                        createdDate: '2026-08-04T02:00:02.855824889Z'
                        modifiedDate: '2026-08-04T02:00:02.938935544Z'
                        taxRate: 0
                        exchangeFeeRate: 0
                        feeRate: 0
                        leaveQuantity: 2
                        canceledQuantity: 0
                        error: ''
                        priceSecure: 2003
                        metadata: >-
                          {"orderSession":"ATO","dealId":178488852178882,"releaseSecureOnFilled":false,"originMaker":"risk-management","dtaAccountNo":"D000113702","maker":"risk-management","isForeigner":false,"probType":"CUSTOMER_8000","eventNo":2}
                        loanPackageId: 2279
                      - id: 26
                        side: NB
                        accountNo: '0001179019'
                        symbol: 41I1G9000
                        price: 2003
                        quantity: 2
                        orderType: LO
                        orderStatus: Filled
                        fillQuantity: 2
                        lastQuantity: 2
                        lastPrice: 2003
                        averagePrice: 2003
                        transDate: '2026-07-31'
                        createdDate: '2026-08-04T02:00:02.855824889Z'
                        modifiedDate: '2026-08-04T02:50:30.56129326Z'
                        taxRate: 0
                        exchangeFeeRate: 0
                        feeRate: 0
                        leaveQuantity: 0
                        canceledQuantity: 0
                        error: ''
                        priceSecure: 2003
                        metadata: >-
                          {"orderSession":"ATO","dealId":178488852178882,"releaseSecureOnFilled":false,"originMaker":"risk-management","dtaAccountNo":"D000113702","maker":"risk-management","isForeigner":false,"probType":"CUSTOMER_8000","eventNo":3}
                        loanPackageId: 2279
        '400':
          description: Yêu cầu không hợp lệ
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 400
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-003
                    description: Mã lỗi
                  message:
                    type: string
                    example: Thông tin nhập không hợp lệ
                    description: Thông điệp lỗi
              example:
                status: 400
                code: OA-003
                message: Thông tin nhập không hợp lệ
        '500':
          description: Lỗi hệ thống
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 500
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-009
                    description: Mã lỗi
                  message:
                    type: string
                    example: Lỗi hệ thống
                    description: Thông điệp lỗi
              example:
                code: OA-009
                message: Lỗi hệ thống
                status: 500
      tags:
        - account
      description: >-
        Lấy lịch sử các lần cập nhật trạng thái hay khớp từng phần của một lệnh
        giao dịch theo `orderId` , chỉ áp dụng cho lệnh thường thị trường cơ sở
        và phái sinh, trái phiếu.
    parameters:
      - name: accountNo
        in: path
        required: true
        description: Số tiểu khoản
        schema:
          type: string
        example: '0001179019'
      - name: orderId
        in: path
        required: true
        description: Id lệnh giao dịch
        schema:
          type: integer
        example: 26
  /accounts/{accountNo}/orders/history:
    get:
      summary: Lịch sử lệnh
      parameters:
        - name: marketType
          in: query
          required: true
          description: |-
            Loại thị trường 
            - STOCK: Gói vay giao dịch cơ sở
            - DERIVATIVE: Gói vay giao dịch phái sinh
          deprecated: false
          schema:
            type: string
          example: STOCK
        - name: from
          in: query
          required: true
          description: |-
            Ngày bắt đầu (yyyy-mm-dd) 
            - Thời gian tra cứu tối đa trong 1 năm tính từ ngày hiện tại
          deprecated: false
          schema:
            type: string
          example: '2026-02-15'
        - name: to
          in: query
          required: true
          description: |-
            Ngày kết thúc (yyyy-mm-dd) 
            - Lớn hơn hoặc bằng ngày bắt đầu và không vượt quá ngày hiện tại
          deprecated: false
          schema:
            type: string
          example: '2026-03-18'
        - name: X-API-Key
          in: header
          required: true
          description: API Key được cấp khi đăng ký dịch vụ
          deprecated: false
          schema:
            type: string
          example: '{{apiKey}}'
        - name: X-Aux-Date
          in: header
          required: true
          description: Thời gian thực hiện yêu cầu
          deprecated: false
          schema:
            type: string
          example: '{{date}}'
        - name: X-Signature
          in: header
          required: true
          description: Chữ ký xác thực yêu cầu
          deprecated: false
          schema:
            type: string
          example: '{{signature}}'
        - name: version
          in: header
          description: API version (YYYY-MM-DD)
          schema:
            type: string
          example: '2026-07-23'
      responses:
        '200':
          description: OK
          headers:
            Content-Length:
              schema:
                type: integer
              example: 4093
            Date:
              schema:
                type: string
              example: Tue, 24 Mar 2026 03:40:59 GMT
            Vary:
              schema:
                type: string
              example: Origin
            X-Ratelimit-Limit:
              schema:
                type: integer
              example: -1
            X-Ratelimit-Remaining:
              schema:
                type: integer
              example: 0
            X-Ratelimit-Reset:
              schema:
                type: integer
              example: 0
            X-Tyk-Api-Expires:
              schema:
                type: string
              example: Thu, 02 Jan 3000 15:04:00 UTC
          content:
            application/json:
              schema:
                type: object
                properties:
                  accountNo:
                    type: string
                    example: '0001179019'
                    description: Số tiểu khoản
                  fillQuantity:
                    type: integer
                    example: 0
                    description: Tổng khối lượng đã khớp
                    format: int32
                  total:
                    type: integer
                    example: 8
                    description: Tổng số bản ghi
                    format: int32
                  start:
                    type: integer
                    example: 0
                    description: Vị trí bắt đầu của tập bản ghi được trả về
                    format: int32
                  end:
                    type: integer
                    example: 8
                    description: Vị trí kết thúc của tập bản ghi được trả về
                    format: int32
                  marketType:
                    type: string
                    example: STOCK
                    description: |-
                      Loại thị trường
                      - STOCK: Gói vay giao dịch cơ sở
                      - DERIVATIVE: Gói vay giao dịch phái sinh
                  data:
                    type: array
                    example:
                      - id: '20260312_241'
                        symbol: HPG
                        side: NB
                        orderType: LO
                        orderStatus: Expired
                        price: 27200
                        quantity: 200
                        fillQuantity: 0
                        leaveQuantity: 0
                        canceledQuantity: 200
                        averagePrice: 0
                        loanPackageId: 5765
                        transDate: '2026-03-12'
                        createdDate: '2026-03-17T06:44:18.813804Z'
                        modifiedDate: '2026-03-18T15:28:24.44026Z'
                    description: Danh sách lệnh giao dịch
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          example: '20260312_241'
                          description: ID lệnh trên hệ thống
                        symbol:
                          type: string
                          example: HPG
                          description: Mã chứng khoán
                        side:
                          type: string
                          example: NB
                          description: |-
                            Chiều giao dịch
                            NB: Mua
                            NS: Bán
                        orderType:
                          type: string
                          example: LO
                          description: |-
                            Loại lệnh
                            - LO: Lệnh giới hạn
                            - MOK/MAK/MTL: Lệnh thị trường
                            - ATO/ATC: Lệnh phiên định kỳ mở cửa/đóng cửa
                            - PLO: Lệnh khớp lệnh sau giờ
                        orderStatus:
                          type: string
                          example: Expired
                          description: >-
                            Trạng thái lệnh

                            - Pending/PendingNew: Chờ gửi

                            - New: Chờ khớp

                            - PartiallyFilled: Khớp một phần

                            - Filled: Khớp toàn bộ

                            - Rejected: Bị từ chối

                            - Expired: Hết hạn trong phiên

                            - DoneForDay: Lệnh được giải tỏa do không khớp trong
                            phiên
                        price:
                          type: integer
                          example: 27200
                          description: Giá đặt
                          format: int32
                        quantity:
                          type: integer
                          example: 200
                          description: Khối lượng đặt
                          format: int32
                        fillQuantity:
                          type: integer
                          example: 0
                          description: Khối lượng đã khớp
                          format: int32
                        leaveQuantity:
                          type: integer
                          example: 0
                          description: Khối lượng còn lại
                          format: int32
                        canceledQuantity:
                          type: integer
                          example: 200
                          description: Khối lượng đã huỷ
                          format: int32
                        averagePrice:
                          type: integer
                          example: 0
                          description: Giá khớp trung bình
                          format: int32
                        loanPackageId:
                          type: integer
                          example: 5765
                          description: ID gói vay
                          format: int32
                        transDate:
                          type: string
                          example: '2026-03-12'
                          description: Ngày giao dịch
                        createdDate:
                          type: string
                          example: '2026-03-17T06:44:18.813804Z'
                          description: Thời điểm tạo
                          format: date-time
                        modifiedDate:
                          type: string
                          example: '2026-03-18T15:28:24.44026Z'
                          description: Thời điểm cập nhật
                          format: date-time
              example:
                accountNo: '0001179019'
                fillQuantity: 0
                total: 8
                start: 0
                end: 8
                marketType: STOCK
                data:
                  - id: '20260312_241'
                    symbol: HPG
                    side: NB
                    orderType: LO
                    orderStatus: Expired
                    price: 27200
                    quantity: 200
                    fillQuantity: 0
                    leaveQuantity: 0
                    canceledQuantity: 200
                    averagePrice: 0
                    loanPackageId: 5765
                    transDate: '2026-03-12'
                    createdDate: '2026-03-17T06:44:18.813804Z'
                    modifiedDate: '2026-03-18T15:28:24.44026Z'
                  - id: '20260312_201'
                    symbol: HPG
                    side: NB
                    orderType: LO
                    orderStatus: Canceled
                    price: 27200
                    quantity: 100
                    fillQuantity: 0
                    leaveQuantity: 0
                    canceledQuantity: 100
                    averagePrice: 0
                    loanPackageId: 5765
                    transDate: '2026-03-12'
                    createdDate: '2026-03-17T04:38:39.589764Z'
                    modifiedDate: '2026-03-17T06:44:18.80718Z'
                  - id: '20260312_191'
                    symbol: HPG
                    side: NB
                    orderType: LO
                    orderStatus: Canceled
                    price: 27000
                    quantity: 100
                    fillQuantity: 0
                    leaveQuantity: 0
                    canceledQuantity: 100
                    averagePrice: 0
                    loanPackageId: 5765
                    transDate: '2026-03-12'
                    createdDate: '2026-03-17T04:37:55.076343Z'
                    modifiedDate: '2026-03-17T04:38:39.58558Z'
                  - id: '20260312_171'
                    symbol: HPG
                    side: NB
                    orderType: LO
                    orderStatus: Rejected
                    price: 27200
                    quantity: 300
                    fillQuantity: 0
                    leaveQuantity: 0
                    canceledQuantity: 300
                    averagePrice: 0
                    loanPackageId: 5765
                    transDate: '2026-03-12'
                    createdDate: '2026-03-17T04:27:07.160028Z'
                    modifiedDate: '2026-03-17T04:27:07.16518Z'
                  - id: '20260312_161'
                    symbol: HPG
                    side: NB
                    orderType: LO
                    orderStatus: Canceled
                    price: 27200
                    quantity: 200
                    fillQuantity: 0
                    leaveQuantity: 0
                    canceledQuantity: 200
                    averagePrice: 0
                    loanPackageId: 5765
                    transDate: '2026-03-12'
                    createdDate: '2026-03-17T04:26:29.007723Z'
                    modifiedDate: '2026-03-17T04:27:07.156301Z'
                  - id: '20260312_151'
                    symbol: HPG
                    side: NB
                    orderType: LO
                    orderStatus: Canceled
                    price: 27100
                    quantity: 100
                    fillQuantity: 0
                    leaveQuantity: 0
                    canceledQuantity: 100
                    averagePrice: 0
                    loanPackageId: 5765
                    transDate: '2026-03-12'
                    createdDate: '2026-03-17T04:22:19.045725Z'
                    modifiedDate: '2026-03-17T04:26:28.9999Z'
                  - id: '20260305_61'
                    symbol: ACB
                    side: NB
                    orderType: LO
                    orderStatus: Expired
                    price: 23200
                    quantity: 100
                    fillQuantity: 0
                    leaveQuantity: 0
                    canceledQuantity: 100
                    averagePrice: 0
                    loanPackageId: 5757
                    transDate: '2026-03-05'
                    createdDate: '2026-03-11T08:32:01.401474Z'
                    modifiedDate: '2026-03-11T14:35:53.763802Z'
                  - id: '20260224_181'
                    symbol: FPT
                    side: NB
                    orderType: LO
                    orderStatus: Expired
                    price: 95000
                    quantity: 100
                    fillQuantity: 0
                    leaveQuantity: 0
                    canceledQuantity: 100
                    averagePrice: 0
                    loanPackageId: 1372
                    transDate: '2026-02-24'
                    createdDate: '2026-02-26T08:25:18.060101Z'
                    modifiedDate: '2026-02-26T14:41:52.221586Z'
        '400':
          description: Yêu cầu không hợp lệ
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 400
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-003
                    description: Mã lỗi
                  message:
                    type: string
                    example: Thông tin nhập không hợp lệ
                    description: Thông điệp lỗi
              example:
                status: 400
                code: OA-003
                message: Thông tin nhập không hợp lệ
        '500':
          description: Lỗi hệ thống
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 500
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-009
                    description: Mã lỗi
                  message:
                    type: string
                    example: Lỗi hệ thống
                    description: Thông điệp lỗi
              example:
                code: OA-009
                message: Lỗi hệ thống
                status: 500
      tags:
        - account
      description: >-
        Lấy danh sách lệnh thường đã đặt trong một khoảng thời gian nhất định.
        Thời gian tra cứu tối đa trong vòng 1 năm kể từ ngày hiện tại.
    parameters:
      - name: accountNo
        in: path
        required: true
        description: Số tiểu khoản
        deprecated: false
        schema:
          type: string
        example: '0001179019'
  /accounts/{accountNo}/positions:
    get:
      summary: Vị thế nắm giữ
      parameters:
        - name: marketType
          in: query
          required: true
          description: |-
            Loại thị trường 
            - STOCK: Danh sách vị thế cơ sở
            - DERIVATIVE: Danh sách vị thế phái sinh
          deprecated: false
          schema:
            type: string
          example: STOCK
        - name: pageSize
          in: query
          description: Kích thước trang dữ liệu (page size)
          deprecated: false
          schema:
            type: string
          example: '20'
        - name: X-API-Key
          in: header
          required: true
          description: API Key được cấp khi đăng ký dịch vụ
          deprecated: false
          schema:
            type: string
          example: '{{apiKey}}'
        - name: X-Aux-Date
          in: header
          required: true
          description: Thời gian thực hiện yêu cầu
          deprecated: false
          schema:
            type: string
          example: '{{date}}'
        - name: X-Signature
          in: header
          required: true
          description: Chữ ký xác thực yêu cầu
          deprecated: false
          schema:
            type: string
          example: '{{signature}}'
        - name: version
          in: header
          description: API version (YYYY-MM-DD)
          schema:
            type: string
          example: '2026-07-23'
      responses:
        '200':
          description: OK
          headers:
            Content-Length:
              schema:
                type: integer
              example: 654
            Date:
              schema:
                type: string
              example: Tue, 24 Mar 2026 03:39:12 GMT
            Vary:
              schema:
                type: string
              example: Origin
            X-Ratelimit-Limit:
              schema:
                type: integer
              example: -1
            X-Ratelimit-Remaining:
              schema:
                type: integer
              example: 0
            X-Ratelimit-Reset:
              schema:
                type: integer
              example: 0
            X-Tyk-Api-Expires:
              schema:
                type: string
              example: Thu, 02 Jan 3000 15:04:00 UTC
          content:
            application/json:
              schema:
                type: object
                properties:
                  positions:
                    type: array
                    example:
                      - id: 177410795472387
                        symbol: 41I1G4000
                        accountNo: '0001179019'
                        status: OPEN
                        loanPackageId: 2278
                        side: NB
                        accumulateQuantity: 6
                        tradeQuantity: 1
                        closedQuantity: 5
                        openQuantity: 1
                        overNightQuantity: 0
                        costPrice: 1834.5
                        marketPrice: 1706.1
                        breakEvenPrice: 1834.95691
                        createdDate: '2026-03-23T03:08:32.773651Z'
                        modifiedDate: '2026-03-23T04:07:45.692156Z'
                    description: ''
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 177410795472387
                          description: ID vị thế
                          format: int64
                        symbol:
                          type: string
                          example: 41I1G4000
                          description: Mã chứng khoán
                        marketType:
                          type: string
                          example: DERIVATIVE
                          description: |-
                            Loại thị trường
                            - STOCK: Gói vay giao dịch cơ sở
                            - DERIVATIVE: Gói vay giao dịch phái sinh
                        accountNo:
                          type: string
                          example: '0001179019'
                          description: Số tiểu khoản
                        status:
                          type: string
                          example: OPEN
                          description: |-
                            Trạng thái của vị thế
                            - OPEN: Đang mở
                            - PENDING_CLOSE: Chờ đóng
                            - CLOSED: Đã đóng
                            - ODD_LOT: Lô lẻ (cơ sở)
                        loanPackageId:
                          type: integer
                          example: 2278
                          description: Gói vay cơ sở hoặc phái sinh
                          format: int32
                        side:
                          type: string
                          example: NB
                          description: |-
                            Loại vị thế
                            - NB: Mua
                            - NS: Bán
                        accumulateQuantity:
                          type: integer
                          example: 6
                          description: Khối lượng cộng dồn
                          format: int32
                        tradeQuantity:
                          type: integer
                          example: 1
                          description: Khối lượng được giao dịch
                          format: int32
                        closedQuantity:
                          type: integer
                          example: 5
                          description: Khối lượng đã đóng
                          format: int32
                        openQuantity:
                          type: integer
                          example: 1
                          description: Khối lượng mở
                          format: int32
                        overNightQuantity:
                          type: integer
                          example: 0
                          description: Khối lượng mở qua đêm (dành cho phái sinh)
                          format: int32
                        costPrice:
                          type: number
                          example: 1834.5
                          description: Giá vốn trung bình của khối lượng mở
                          format: float
                        marketPrice:
                          type: number
                          example: 1706.1
                          description: Giá thị trường
                          format: double
                        breakEvenPrice:
                          type: number
                          example: 1834.95691
                          description: Giá hòa vốn
                          format: double
                        createdDate:
                          type: string
                          example: '2026-03-23T03:08:32.773651Z'
                          description: Thời điểm mở
                          format: date-time
                        modifiedDate:
                          type: string
                          example: '2026-03-23T04:07:45.692156Z'
                          description: Thời điểm cập nhật
                          format: date-time
                  pageIndex:
                    type: integer
                    example: 0
                    description: Kích thước trang dữ liệu (dành cho phái sinh)
                    format: int32
                  pageSize:
                    type: integer
                    example: 20
                    description: Số bản ghi trên 1 trang (dành cho phái sinh)
                    format: int32
                  pageNumber:
                    type: integer
                    example: 1
                    description: Số trang (chỉ dành cho phái sinh)
                    format: int32
                  total:
                    type: integer
                    example: 1
                    description: Tổng số vị thế (chỉ dành cho phái sinh)
                    format: int32
              example:
                positions:
                  - id: 177410795472387
                    symbol: 41I1G4000
                    accountNo: '0001179019'
                    marketType: DERIVATIVE
                    status: OPEN
                    loanPackageId: 2278
                    side: NB
                    accumulateQuantity: 6
                    tradeQuantity: 1
                    closedQuantity: 5
                    openQuantity: 1
                    overNightQuantity: 0
                    costPrice: 1834.5
                    marketPrice: 1706.1
                    breakEvenPrice: 1834.95691
                    createdDate: '2026-03-23T03:08:32.773651Z'
                    modifiedDate: '2026-03-23T04:07:45.692156Z'
                pageIndex: 0
                pageSize: 20
                pageNumber: 1
                total: 1
        '400':
          description: Yêu cầu không hợp lệ
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 400
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-003
                    description: Mã lỗi
                  message:
                    type: string
                    example: Thông tin nhập không hợp lệ
                    description: Thông điệp lỗi
              example:
                code: OA-003
                message: Thông tin nhập không hợp lệ
                status: 400
        '500':
          description: Lỗi hệ thống
          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
      tags:
        - account
      description: >-
        Lấy danh sách các vị thế đang nắm giữ trên tài khoản, bao gồm thông tin
        mã chứng khoán, khối lượng, giá vốn, và các thông tin khác.
    parameters:
      - name: accountNo
        in: path
        required: true
        description: Số tiểu khoản
        deprecated: false
        schema:
          type: string
        example: '0001179019'
  /positions/{positionId}:
    get:
      summary: Chi tiết vị thế theo ID
      parameters:
        - name: marketType
          in: query
          required: true
          description: |-
            Loại thị trường 
            - STOCK: Vị thế cơ sở
            - DERIVATIVE: Vị thế phái sinh
          schema:
            type: string
          example: DERIVATIVE
        - 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: Thời gian thực hiện yêu cầu
          schema:
            type: string
          example: '{{date}}'
        - name: X-Signature
          in: header
          required: true
          description: Chữ ký xác thực yêu cầu
          schema:
            type: string
          example: '{{signature}}'
        - name: version
          in: header
          description: API version (YYYY-MM-DD)
          schema:
            type: string
            format: date
          example: '2026-07-23'
      responses:
        '200':
          description: OK
          headers:
            Content-Length:
              deprecated: false
              schema: {}
              example: '456'
            Vary:
              deprecated: false
              schema: {}
              example: Origin
            X-Ratelimit-Limit:
              deprecated: false
              schema: {}
              example: '-1'
            X-Ratelimit-Remaining:
              deprecated: false
              schema: {}
              example: '0'
            X-Ratelimit-Reset:
              deprecated: false
              schema: {}
              example: '1784795976'
            X-Tyk-Api-Expires:
              deprecated: false
              schema: {}
              example: Thu, 02 Jan 3000 15:04:00 UTC
            Date:
              deprecated: false
              schema: {}
              example: Fri, 31 Jul 2026 10:53:55 GMT
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: integer
                    format: int32
                    example: 9589
                    description: ID vị thế
                  symbol:
                    type: string
                    example: BVS
                    description: Mã chứng khoán
                  accountNo:
                    type: string
                    example: '0001179019'
                    description: Số tiểu khoản
                  status:
                    type: string
                    example: OPEN
                    description: |-
                      Trạng thái của vị thế
                      - OPEN: Đang mở
                      - PENDING_CLOSE: Chờ đóng
                      - CLOSED: Đã đóng
                      - ODD_LOT: Lô lẻ (cơ sở)
                  loanPackageId:
                    type: integer
                    format: int32
                    example: 5757
                    description: Gói vay cơ sở hoặc phái sinh
                  side:
                    type: string
                    example: NB
                    description: |-
                      Loại vị thế
                      - NB: Mua
                      - NS: Bán
                  accumulateQuantity:
                    type: integer
                    format: int32
                    example: 3400
                    description: Khối lượng cộng dồn
                  tradeQuantity:
                    type: integer
                    format: int32
                    example: 3400
                    description: Khối lượng được giao dịch
                  closedQuantity:
                    type: integer
                    format: int32
                    example: 0
                    description: Khối lượng đã đóng
                  openQuantity:
                    type: integer
                    format: int32
                    example: 3400
                    description: Khối lượng mở
                  costPrice:
                    type: integer
                    format: int32
                    example: 28000
                    description: Giá vốn trung bình của khối lượng mở
                  averageCostPrice:
                    type: integer
                    format: int32
                    example: 28000
                    description: Giá vốn trung bình
                  averageClosePrice:
                    type: integer
                    format: int32
                    example: 0
                    description: Giá đóng trung bình
                  marketPrice:
                    type: integer
                    format: int32
                    example: 25200
                    description: Giá thị trường
                  breakEvenPrice:
                    type: number
                    format: double
                    example: 28043.4752
                    description: Giá hòa vốn
                  createdDate:
                    type: string
                    format: date-time
                    example: '2026-07-20T04:22:38.904283Z'
                    description: Thời điểm mở
                  modifiedDate:
                    type: string
                    format: date-time
                    example: '2026-07-30T11:20:44.65933Z'
                    description: Thời điểm cập nhật
              examples:
                STOCK:
                  value:
                    id: 9589
                    symbol: BVS
                    accountNo: '0001179019'
                    status: OPEN
                    loanPackageId: 5757
                    side: NB
                    accumulateQuantity: 3400
                    tradeQuantity: 3400
                    closedQuantity: 0
                    openQuantity: 3400
                    costPrice: 28000
                    averageCostPrice: 28000
                    averageClosePrice: 0
                    marketPrice: 25200
                    breakEvenPrice: 28043.4752
                    createdDate: '2026-07-20T04:22:38.904283Z'
                    modifiedDate: '2026-07-30T11:20:44.65933Z'
                DERIVATIVE:
                  value:
                    id: 178488852178882
                    symbol: 41I1G9000
                    marketType: DERIVATIVE
                    accountNo: '0001179019'
                    status: OPEN
                    loanPackageId: 2279
                    side: NS
                    accumulateQuantity: 12
                    tradeQuantity: 10
                    closedQuantity: 2
                    openQuantity: 10
                    overNightQuantity: 10
                    costPrice: 1855.4
                    averageCostPrice: 1855.4
                    averageClosePrice: 1931
                    marketPrice: 1931.5
                    breakEvenPrice: 1854.93962
                    createdDate: '2026-07-30T07:27:30.375891Z'
                    modifiedDate: '2026-07-30T15:41:24.838062Z'
        '400':
          description: Yêu cầu không hợp lệ
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 400
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-003
                    description: Mã lỗi
                  message:
                    type: string
                    example: Thông tin nhập không hợp lệ
                    description: Thông điệp lỗi
              example:
                status: 400
                code: OA-003
                message: Thông tin nhập không hợp lệ
        '500':
          description: Lỗi hệ thống
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 500
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-009
                    description: Mã lỗi
                  message:
                    type: string
                    example: Lỗi hệ thống
                    description: Thông điệp lỗi
              example:
                code: OA-009
                message: Lỗi hệ thống
                status: 500
      tags:
        - account
      description: "Lấy thông tin chi tiết của một vị thế cơ sở hoặc phái sinh đang mở theo\_`positionId.`"
    parameters:
      - name: positionId
        in: path
        required: true
        description: Id vị thế
        schema:
          type: integer
        example: 178488852178882
  /accounts/{accountNo}/corporate-action-history:
    get:
      summary: Lịch sử sự kiện quyền
      parameters:
        - name: symbol
          in: query
          description: Mã chứng khoán
          schema:
            type: string
          example: MSB
        - name: caType
          in: query
          description: |-
            Phân loại sự kiện quyền 
            - cashDividend: Sự kiện quyền trả cổ tức bằng tiền
            - stockDividend: Sự kiện quyền trả cổ tức cổ phiếu
            - stockBonus: Sự kiện quyền trả cổ phiếu thưởng 
            - rightsOffering: Sự kiện quyền mua cổ phiếu phát hành thêm
          schema:
            type: string
          example: stockDividend
        - name: caStatus
          in: query
          description: |-
            Trạng thái xử lý sự kiện quyền 
            - pending: Quyền đang chờ xử lý hoặc đang được thực hiện
            - completed: Quyền đã được xử lý hoàn tất
            - canceled: Quyền đã hủy thành công
          schema:
            type: string
          example: pending
        - name: pageIndex
          in: query
          description: Trang hiện tại
          schema:
            type: integer
          example: 0
        - name: pageSize
          in: query
          description: Số lượng bản ghi trên mỗi trang
          schema:
            type: integer
          example: 30
        - name: X-API-Key
          in: header
          description: API Key được cấp khi đăng ký dịch vụ
          schema:
            type: string
          example: '{{apiKey}}'
        - name: X-Aux-Date
          in: header
          description: Thời gian thực hiện yêu cầu
          schema:
            type: string
          example: '{{date}}'
        - name: X-Signature
          in: header
          description: Chữ ký xác thực yêu cầu
          schema:
            type: string
          example: '{{signature}}'
        - name: version
          in: header
          description: API version (YYYY-MM-DD)
          schema:
            type: string
          example: '2026-07-23'
      responses:
        '200':
          description: OK
          headers:
            Cache-Control:
              schema:
                type: string
              example: no-cache, no-store, max-age=0, must-revalidate
            Date:
              schema:
                type: string
              example: Mon, 25 May 2026 08:14:19 GMT
            Expires:
              schema:
                type: integer
              example: 0
            Pragma:
              schema:
                type: string
              example: no-cache
            Vary:
              schema:
                type: string
              example: Origin
            X-Content-Type-Options:
              schema:
                type: string
              example: nosniff
            X-Ratelimit-Limit:
              schema:
                type: integer
              example: 10000
            X-Ratelimit-Remaining:
              schema:
                type: integer
              example: 9995
            X-Ratelimit-Reset:
              schema:
                type: integer
              example: 1779782259
            X-Tyk-Api-Expires:
              schema:
                type: string
              example: Thu, 02 Jan 3000 15:04:00 UTC
            X-Xss-Protection:
              schema:
                type: integer
              example: 0
            Transfer-Encoding:
              schema:
                type: string
              example: chunked
          content:
            application/json:
              schema:
                type: object
                properties:
                  accountNo:
                    type: string
                    example: '0001179019'
                    description: Số tiểu khoản
                  data:
                    type: object
                    description: >-
                      Danh sách quyền chứng khoán của tiểu khoản, được phân loại
                      theo từng loại quyền
                    properties:
                      cashDividend:
                        type: array
                        description: Danh sách quyền trả cổ tức bằng tiền
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 617210
                              description: ID sự kiện quyền
                              format: int32
                            symbol:
                              type: string
                              example: MSB
                              description: Mã chứng khoán
                            caStatus:
                              type: string
                              example: pending
                              description: >-
                                Trạng thái xử lý sự kiện quyền

                                - pending: Quyền đang chờ xử lý hoặc đang được
                                thực hiện

                                - completed: Quyền đã được xử lý hoàn tất

                                - canceled: Quyền đã hủy thành công
                            recordDate:
                              type: string
                              example: '2026-04-24'
                              description: Ngày đăng ký cuối cùng sự kiện quyền
                            processDate:
                              type: string
                              example: '2026-05-13'
                              description: Ngày thanh toán dự kiến
                            holdingQuantity:
                              type: integer
                              example: 600
                              description: Số lượng chứng khoán sở hữu tại ngày chốt quyền
                              format: int32
                            dividendValue:
                              type: integer
                              example: 500
                              description: Giá trị cổ tức trên mỗi cổ phiếu
                              format: int32
                            grossAmount:
                              type: integer
                              example: 300000
                              description: Tổng giá trị tiền cổ tức trước thuế
                              format: int32
                            taxAmount:
                              type: integer
                              example: 15000
                              description: Số tiền thuế bị khấu trừ
                              format: int32
                            netAmount:
                              type: integer
                              example: 285000
                              description: Số tiền thực nhận sau thuế
                              format: int32
                      stockDividend:
                        type: array
                        description: Danh sách quyền trả cổ tức bằng cổ phiếu
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 618949
                              description: ID sự kiện quyền
                              format: int32
                            symbol:
                              type: string
                              example: OIL
                              description: Mã chứng khoán
                            caStatus:
                              type: string
                              example: pending
                              description: >-
                                Trạng thái xử lý sự kiện quyền

                                - pending: Quyền đang chờ xử lý hoặc đang được
                                thực hiện

                                - completed: Quyền đã được xử lý hoàn tất

                                - canceled: Quyền đã hủy thành công
                            recordDate:
                              type: string
                              example: '2026-04-29'
                              description: Ngày đăng ký cuối cùng sự kiện quyền
                            processDate:
                              type: string
                              example: '2026-05-14'
                              description: Ngày phân phối cổ phiếu cổ tức dự kiến
                            holdingQuantity:
                              type: integer
                              example: 3211
                              description: Số lượng chứng khoán sở hữu tại ngày chốt quyền
                              format: int32
                            ratio:
                              type: string
                              example: 5/3
                              description: Tỷ lệ thực hiện quyền nhận cổ tức bằng cổ phiếu
                            receivedQuantity:
                              type: integer
                              example: 1926
                              description: Số lượng cổ phiếu cổ tức được nhận
                              format: int32
                      stockBonus:
                        type: array
                        description: Danh sách quyền trả cổ phiếu thưởng
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 617276
                              description: ID sự kiện quyền
                              format: int32
                            symbol:
                              type: string
                              example: MSB
                              description: Mã chứng khoán
                            caStatus:
                              type: string
                              example: completed
                              description: >-
                                Trạng thái xử lý sự kiện quyền

                                - pending: Quyền đang chờ xử lý hoặc đang được
                                thực hiện

                                - completed: Quyền đã được xử lý hoàn tất

                                - canceled: Quyền đã hủy thành công
                            recordDate:
                              type: string
                              example: '2026-04-24'
                              description: Ngày đăng ký cuối cùng sự kiện quyền
                            processDate:
                              type: string
                              example: '2026-05-13'
                              description: Ngày phân phối cổ phiếu thưởng dự kiến
                            holdingQuantity:
                              type: integer
                              example: 600
                              description: Số lượng chứng khoán sở hữu tại ngày chốt quyền
                              format: int32
                            ratio:
                              type: string
                              example: 15/6
                              description: Tỷ lệ thực hiện quyền nhận cổ phiếu thưởng
                            receivedQuantity:
                              type: integer
                              example: 240
                              description: Số lượng cổ phiếu thưởng khách hàng được nhận
                              format: int32
                      rightsOffering:
                        type: array
                        description: Danh sách quyền mua cổ phiếu phát hành thêm
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 623428
                              description: ID sự kiện quyền
                              format: int32
                            symbol:
                              type: string
                              example: OIL
                              description: Mã chứng khoán
                            caStatus:
                              type: string
                              example: pending
                              description: >-
                                Trạng thái xử lý sự kiện quyền

                                - pending: Quyền đang chờ xử lý hoặc đang được
                                thực hiện

                                - completed: Quyền đã được xử lý hoàn tất

                                - canceled: Quyền đã hủy thành công
                            recordDate:
                              type: string
                              example: '2026-04-29'
                              description: >-
                                Ngày đăng ký cuối cùng sự kiện quyền để xác định
                                quyền mua
                            processDate:
                              type: string
                              example: '2026-05-14'
                              description: Ngày phân phối cổ phiếu quyền mua dự kiến
                            holdingQuantity:
                              type: integer
                              example: 5137
                              description: Số lượng chứng khoán sở hữu tại ngày chốt quyền
                              format: int32
                            ratio:
                              type: string
                              example: 3/1
                              description: Tỷ lệ thực hiện quyền mua cổ phiếu
                            rightPrice:
                              type: integer
                              example: 11000
                              description: Giá đăng ký mua cổ phiếu phát hành thêm
                              format: int32
                            rightsQuantity:
                              type: integer
                              example: 1712
                              description: Số lượng quyền mua được phân bổ trên tài khoản
                              format: int32
                            registeredQuantity:
                              type: integer
                              example: 170
                              description: Số lượng cổ phiếu phát hành thêm đã đăng ký mua
                              format: int32
                            startDateTransfer:
                              type: string
                              example: '2026-05-04'
                              description: Ngày bắt đầu được phép chuyển nhượng quyền mua
                            endDateTransfer:
                              type: string
                              example: '2026-05-13'
                              description: Ngày kết thúc chuyển nhượng quyền mua
                            startDateSubscription:
                              type: string
                              example: '2026-05-04'
                              description: Ngày bắt đầu đăng ký thực hiện quyền mua
                            endDateSubscription:
                              type: string
                              example: '2026-05-13'
                              description: Ngày kết thúc đăng ký thực hiện quyền mua
                  pagination:
                    type: object
                    description: Thông tin phân trang dữ liệu
                    properties:
                      pageIndex:
                        type: integer
                        example: 0
                        description: Trang hiện tại
                        format: int32
                      pageSize:
                        type: integer
                        example: 100
                        description: Số lượng bản ghi trên mỗi trang
                        format: int32
                      totalRecords:
                        type: integer
                        example: 100
                        description: Tổng số bản ghi
                        format: int32
              example:
                accountNo: '0001179019'
                data:
                  cashDividend:
                    - id: 617210
                      symbol: MSB
                      caStatus: pending
                      recordDate: '2026-04-24'
                      processDate: '2026-05-13'
                      holdingQuantity: 600
                      dividendValue: 500
                      grossAmount: 300000
                      taxAmount: 15000
                      netAmount: 285000
                    - id: 615389
                      symbol: LPB
                      caStatus: pending
                      recordDate: '2026-04-06'
                      processDate: '2026-04-21'
                      holdingQuantity: 56300
                      dividendValue: 500
                      grossAmount: 28150000
                      taxAmount: 1407500
                      netAmount: 26742500
                    - id: 611467
                      symbol: SSI
                      caStatus: pending
                      recordDate: '2026-03-31'
                      processDate: '2026-06-26'
                      holdingQuantity: 75081
                      dividendValue: 20000
                      grossAmount: 1501620000
                      taxAmount: 75081000
                      netAmount: 1426539000
                    - id: 606314
                      symbol: DSE
                      caStatus: pending
                      recordDate: '2026-03-03'
                      processDate: '2026-03-19'
                      holdingQuantity: 580
                      dividendValue: 600
                      grossAmount: 348000
                      taxAmount: 17400
                      netAmount: 330600
                    - id: 605284
                      symbol: MBS
                      caStatus: pending
                      recordDate: '2026-03-03'
                      processDate: '2026-03-12'
                      holdingQuantity: 44204
                      dividendValue: 600
                      grossAmount: 26522400
                      taxAmount: 1326120
                      netAmount: 25196280
                    - id: 590256
                      symbol: VPB
                      caStatus: pending
                      recordDate: '2026-03-02'
                      processDate: '2030-03-21'
                      holdingQuantity: 5614
                      dividendValue: 100
                      grossAmount: 561400
                      taxAmount: 28070
                      netAmount: 533330
                    - id: 588953
                      symbol: VNM
                      caStatus: pending
                      recordDate: '2026-03-02'
                      processDate: '2030-04-29'
                      holdingQuantity: 97
                      dividendValue: 100
                      grossAmount: 9700
                      taxAmount: 485
                      netAmount: 9215
                    - id: 591943
                      symbol: VND
                      caStatus: pending
                      recordDate: '2026-03-02'
                      processDate: '2030-03-14'
                      holdingQuantity: 3023
                      dividendValue: 100
                      grossAmount: 302300
                      taxAmount: 15115
                      netAmount: 287185
                    - id: 588478
                      symbol: VNM
                      caStatus: pending
                      recordDate: '2026-03-02'
                      processDate: '2030-07-03'
                      holdingQuantity: 97
                      dividendValue: 100
                      grossAmount: 9700
                      taxAmount: 485
                      netAmount: 9215
                    - id: 577057
                      symbol: ACB
                      caStatus: completed
                      recordDate: '2026-02-25'
                      processDate: '2026-03-02'
                      holdingQuantity: 214485
                      dividendValue: 5000
                      grossAmount: 1072425000
                      taxAmount: 53621250
                      netAmount: 1018803750
                    - id: 558017
                      symbol: FPT
                      caStatus: completed
                      recordDate: '2025-10-27'
                      processDate: '2025-11-04'
                      holdingQuantity: 8363
                      dividendValue: 10000
                      grossAmount: 83630000
                      taxAmount: 4181500
                      netAmount: 79448500
                    - id: 541265
                      symbol: SHS
                      caStatus: pending
                      recordDate: '2025-08-25'
                      processDate: '2025-08-27'
                      holdingQuantity: 152905
                      dividendValue: 5000
                      grossAmount: 764525000
                      taxAmount: 38226250
                      netAmount: 726298750
                    - id: 498682
                      symbol: MBS
                      caStatus: completed
                      recordDate: '2025-01-15'
                      processDate: '2025-01-16'
                      holdingQuantity: 34204
                      dividendValue: 600
                      grossAmount: 20522400
                      taxAmount: 1026120
                      netAmount: 19496280
                    - id: 496796
                      symbol: BID
                      caStatus: pending
                      recordDate: '2025-01-13'
                      processDate: '2025-01-15'
                      holdingQuantity: 629842
                      dividendValue: 1179
                      grossAmount: 742583718
                      taxAmount: 37129186
                      netAmount: 705454532
                    - id: 496030
                      symbol: BID
                      caStatus: pending
                      recordDate: '2025-01-09'
                      processDate: '2025-01-10'
                      holdingQuantity: 629842
                      dividendValue: 11000
                      grossAmount: 6928262000
                      taxAmount: 346413100
                      netAmount: 6581848900
                    - id: 496223
                      symbol: BID
                      caStatus: pending
                      recordDate: '2025-01-08'
                      processDate: '2025-01-09'
                      holdingQuantity: 629842
                      dividendValue: 11000
                      grossAmount: 6928262000
                      taxAmount: 346413100
                      netAmount: 6581848900
                    - id: 484453
                      symbol: ACB
                      caStatus: completed
                      recordDate: '2024-11-25'
                      processDate: '2024-11-26'
                      holdingQuantity: 147171
                      dividendValue: 500
                      grossAmount: 73585500
                      taxAmount: 3679275
                      netAmount: 69906225
                    - id: 498119
                      symbol: FPT
                      caStatus: pending
                      recordDate: '2024-10-07'
                      processDate: '2024-12-02'
                      holdingQuantity: 2923
                      dividendValue: 10000
                      grossAmount: 29230000
                      taxAmount: 1461500
                      netAmount: 27768500
                    - id: 453002
                      symbol: MBB
                      caStatus: pending
                      recordDate: '2024-09-20'
                      processDate: '2024-10-30'
                      holdingQuantity: 33900
                      dividendValue: 500
                      grossAmount: 16950000
                      taxAmount: 847500
                      netAmount: 16102500
                    - id: 418832
                      symbol: SHS
                      caStatus: pending
                      recordDate: '2024-07-16'
                      processDate: '2024-07-17'
                      holdingQuantity: 148002
                      dividendValue: 5000
                      grossAmount: 740010000
                      taxAmount: 37000500
                      netAmount: 703009500
                    - id: 381553
                      symbol: CII42013
                      caStatus: pending
                      recordDate: '2024-04-10'
                      processDate: '2024-04-10'
                      holdingQuantity: 1
                      dividendValue: 12000
                      grossAmount: 12000
                      taxAmount: 600
                      netAmount: 11400
                    - id: 381560
                      symbol: VCB12108
                      caStatus: pending
                      recordDate: '2024-04-10'
                      processDate: '2024-04-10'
                      holdingQuantity: 2000
                      dividendValue: 13000
                      grossAmount: 26000000
                      taxAmount: 1300000
                      netAmount: 24700000
                    - id: 382892
                      symbol: VIB12216
                      caStatus: completed
                      recordDate: '2024-04-09'
                      processDate: '2024-04-10'
                      holdingQuantity: 2000
                      dividendValue: 14000
                      grossAmount: 28000000
                      taxAmount: 1400000
                      netAmount: 26600000
                    - id: 370881
                      symbol: FPT
                      caStatus: pending
                      recordDate: '2024-04-04'
                      processDate: '2024-04-05'
                      holdingQuantity: 5300
                      dividendValue: 1000
                      grossAmount: 5300000
                      taxAmount: 265000
                      netAmount: 5035000
                    - id: 375553
                      symbol: CII42013
                      caStatus: pending
                      recordDate: '2024-04-03'
                      processDate: '2024-04-10'
                      holdingQuantity: 1
                      dividendValue: 2000
                      grossAmount: 2000
                      taxAmount: 100
                      netAmount: 1900
                    - id: 368809
                      symbol: PVS
                      caStatus: pending
                      recordDate: '2024-04-03'
                      processDate: '2024-04-04'
                      holdingQuantity: 328256
                      dividendValue: 900
                      grossAmount: 295430400
                      taxAmount: 14771520
                      netAmount: 280658880
                    - id: 367375
                      symbol: SSI
                      caStatus: pending
                      recordDate: '2024-04-01'
                      processDate: '2024-04-15'
                      holdingQuantity: 45135
                      dividendValue: 400
                      grossAmount: 18054000
                      taxAmount: 902700
                      netAmount: 17151300
                    - id: 351961
                      symbol: CTG
                      caStatus: pending
                      recordDate: '2024-03-05'
                      processDate: '2024-03-15'
                      holdingQuantity: 189
                      dividendValue: 1000
                      grossAmount: 189000
                      taxAmount: 9450
                      netAmount: 179550
                    - id: 342682
                      symbol: MBS
                      caStatus: pending
                      recordDate: '2024-01-25'
                      processDate: '2024-01-26'
                      holdingQuantity: 34206
                      dividendValue: 8000
                      grossAmount: 273648000
                      taxAmount: 13682400
                      netAmount: 259965600
                    - id: 334303
                      symbol: HPG
                      caStatus: completed
                      recordDate: '2023-10-20'
                      processDate: '2023-10-23'
                      holdingQuantity: 1950
                      dividendValue: 2000
                      grossAmount: 3900000
                      taxAmount: 195000
                      netAmount: 3705000
                    - id: 317826
                      symbol: BID
                      caStatus: completed
                      recordDate: '2023-10-10'
                      processDate: '2024-03-04'
                      holdingQuantity: 31036
                      dividendValue: 5000
                      grossAmount: 155180000
                      taxAmount: 7759000
                      netAmount: 147421000
                    - id: 312046
                      symbol: SSI
                      caStatus: completed
                      recordDate: '2023-08-31'
                      processDate: '2023-09-19'
                      holdingQuantity: 71934
                      dividendValue: 10000
                      grossAmount: 719340000
                      taxAmount: 35967000
                      netAmount: 683373000
                    - id: 302766
                      symbol: SHS
                      caStatus: completed
                      recordDate: '2023-08-30'
                      processDate: '2023-08-31'
                      holdingQuantity: 155494
                      dividendValue: 3000
                      grossAmount: 466482000
                      taxAmount: 23324100
                      netAmount: 443157900
                    - id: 293753
                      symbol: SSI
                      caStatus: pending
                      recordDate: '2023-07-27'
                      processDate: '2023-07-27'
                      holdingQuantity: 62234
                      dividendValue: 1000
                      grossAmount: 62234000
                      taxAmount: 3111700
                      netAmount: 59122300
                    - id: 273102
                      symbol: AAA
                      caStatus: pending
                      recordDate: '2023-02-27'
                      processDate: '2023-02-28'
                      holdingQuantity: 20400
                      dividendValue: 1100
                      grossAmount: 22440000
                      taxAmount: 1122000
                      netAmount: 21318000
                    - id: 241764
                      symbol: SSI
                      caStatus: completed
                      recordDate: '2023-02-17'
                      processDate: '2023-02-20'
                      holdingQuantity: 56200
                      dividendValue: 1200
                      grossAmount: 67440000
                      taxAmount: 3372000
                      netAmount: 64068000
                    - id: 265253
                      symbol: ACB
                      caStatus: pending
                      recordDate: '2023-02-16'
                      processDate: '2023-02-17'
                      holdingQuantity: 340
                      dividendValue: 500
                      grossAmount: 170000
                      taxAmount: 8500
                      netAmount: 161500
                  stockDividend:
                    - id: 618949
                      symbol: OIL
                      caStatus: pending
                      recordDate: '2026-04-29'
                      processDate: '2026-05-14'
                      holdingQuantity: 3211
                      ratio: 5/3
                      receivedQuantity: 1926
                    - id: 612209
                      symbol: SSI
                      caStatus: pending
                      recordDate: '2026-03-31'
                      processDate: '2026-06-26'
                      holdingQuantity: 75081
                      ratio: 4/1
                      receivedQuantity: 18771
                    - id: 607392
                      symbol: MBS
                      caStatus: pending
                      recordDate: '2026-03-03'
                      processDate: '2026-03-12'
                      holdingQuantity: 44204
                      ratio: 56/1
                      receivedQuantity: 790
                    - id: 607025
                      symbol: DSE
                      caStatus: pending
                      recordDate: '2026-03-03'
                      processDate: '2026-03-19'
                      holdingQuantity: 580
                      ratio: 12/5
                      receivedQuantity: 241
                    - id: 598253
                      symbol: TTA
                      caStatus: pending
                      recordDate: '2026-03-02'
                      processDate: '2104-03-01'
                      holdingQuantity: 100
                      ratio: 100/5
                      receivedQuantity: 5
                    - id: 595511
                      symbol: HPG
                      caStatus: pending
                      recordDate: '2026-03-02'
                      processDate: '2104-03-01'
                      holdingQuantity: 84246
                      ratio: 100/20
                      receivedQuantity: 16849
                    - id: 603933
                      symbol: MSB
                      caStatus: pending
                      recordDate: '2026-03-02'
                      processDate: '2104-03-01'
                      holdingQuantity: 500
                      ratio: 100/20
                      receivedQuantity: 100
                    - id: 604403
                      symbol: PVT
                      caStatus: pending
                      recordDate: '2026-03-02'
                      processDate: '2104-03-01'
                      holdingQuantity: 3000
                      ratio: 100/32
                      receivedQuantity: 960
                    - id: 603262
                      symbol: GEX
                      caStatus: pending
                      recordDate: '2026-03-02'
                      processDate: '2104-03-01'
                      holdingQuantity: 1300
                      ratio: 20/1
                      receivedQuantity: 65
                    - id: 600681
                      symbol: MBB
                      caStatus: pending
                      recordDate: '2026-03-02'
                      processDate: '2104-03-01'
                      holdingQuantity: 36345
                      ratio: 100/32
                      receivedQuantity: 11633
                    - id: 602838
                      symbol: PVS
                      caStatus: pending
                      recordDate: '2026-03-02'
                      processDate: '2104-03-01'
                      holdingQuantity: 360081
                      ratio: 100/7
                      receivedQuantity: 25205
                    - id: 598665
                      symbol: PDR
                      caStatus: pending
                      recordDate: '2026-03-02'
                      processDate: '2104-03-01'
                      holdingQuantity: 1
                      ratio: 100/8
                      receivedQuantity: 0
                    - id: 598482
                      symbol: SHB
                      caStatus: pending
                      recordDate: '2026-03-02'
                      processDate: '2104-03-01'
                      holdingQuantity: 6300
                      ratio: 100/13
                      receivedQuantity: 819
                    - id: 559639
                      symbol: FPT
                      caStatus: completed
                      recordDate: '2025-10-27'
                      processDate: '2025-11-05'
                      holdingQuantity: 8363
                      ratio: 100/23
                      receivedQuantity: 1923
                    - id: 563417
                      symbol: MBB
                      caStatus: pending
                      recordDate: '2025-10-02'
                      processDate: '2025-10-10'
                      holdingQuantity: 36595
                      ratio: 5/2
                      receivedQuantity: 14638
                    - id: 539315
                      symbol: CEO
                      caStatus: pending
                      recordDate: '2025-08-25'
                      processDate: '2025-08-27'
                      holdingQuantity: 1298
                      ratio: 5/2
                      receivedQuantity: 519
                    - id: 485967
                      symbol: ACB
                      caStatus: completed
                      recordDate: '2024-11-25'
                      processDate: '2024-11-26'
                      holdingQuantity: 147171
                      ratio: 10/1
                      receivedQuantity: 14716
                    - id: 465792
                      symbol: SHS
                      caStatus: pending
                      recordDate: '2024-10-07'
                      processDate: '2024-12-02'
                      holdingQuantity: 148205
                      ratio: 111/28
                      receivedQuantity: 37385
                    - id: 449374
                      symbol: MBB
                      caStatus: pending
                      recordDate: '2024-09-20'
                      processDate: '2024-12-11'
                      holdingQuantity: 33900
                      ratio: 100/5
                      receivedQuantity: 1695
                    - id: 456726
                      symbol: TCB
                      caStatus: completed
                      recordDate: '2024-09-16'
                      processDate: '2024-10-03'
                      holdingQuantity: 3855
                      ratio: 111/28
                      receivedQuantity: 972
                    - id: 390737
                      symbol: AAA
                      caStatus: pending
                      recordDate: '2024-05-07'
                      processDate: '2024-05-15'
                      holdingQuantity: 20400
                      ratio: 100/25
                      receivedQuantity: 5100
                    - id: 369343
                      symbol: FPT
                      caStatus: pending
                      recordDate: '2024-04-04'
                      processDate: '2024-04-05'
                      holdingQuantity: 5300
                      ratio: 100/25
                      receivedQuantity: 1325
                    - id: 367850
                      symbol: PVS
                      caStatus: pending
                      recordDate: '2024-04-03'
                      processDate: '2024-04-04'
                      holdingQuantity: 298415
                      ratio: 100/10
                      receivedQuantity: 29841
                    - id: 368177
                      symbol: SSI
                      caStatus: pending
                      recordDate: '2024-04-01'
                      processDate: '2024-04-12'
                      holdingQuantity: 45135
                      ratio: 100/10
                      receivedQuantity: 4514
                    - id: 347946
                      symbol: SSI
                      caStatus: pending
                      recordDate: '2024-01-19'
                      processDate: '2024-02-19'
                      holdingQuantity: 38535
                      ratio: 100/5
                      receivedQuantity: 1927
                    - id: 320996
                      symbol: HPG
                      caStatus: completed
                      recordDate: '2023-10-20'
                      processDate: '2023-10-23'
                      holdingQuantity: 1912
                      ratio: 100/2
                      receivedQuantity: 38
                    - id: 317596
                      symbol: BID
                      caStatus: pending
                      recordDate: '2023-10-10'
                      processDate: '2023-10-27'
                      holdingQuantity: 31036
                      ratio: 100/5
                      receivedQuantity: 1552
                    - id: 311350
                      symbol: SHS
                      caStatus: completed
                      recordDate: '2023-08-31'
                      processDate: '2023-09-19'
                      holdingQuantity: 155494
                      ratio: 100/10
                      receivedQuantity: 15549
                    - id: 305057
                      symbol: TCB
                      caStatus: completed
                      recordDate: '2023-08-30'
                      processDate: '2023-08-31'
                      holdingQuantity: 3700
                      ratio: 100/15
                      receivedQuantity: 555
                    - id: 292688
                      symbol: BID
                      caStatus: pending
                      recordDate: '2023-07-27'
                      processDate: '2023-07-28'
                      holdingQuantity: 31310
                      ratio: 50/1
                      receivedQuantity: 626
                    - id: 292590
                      symbol: BID
                      caStatus: pending
                      recordDate: '2023-07-25'
                      processDate: '2023-07-27'
                      holdingQuantity: 31000
                      ratio: 100/1
                      receivedQuantity: 310
                    - id: 391579
                      symbol: AAA
                      caStatus: pending
                      recordDate: '2023-06-20'
                      processDate: '2023-06-21'
                      holdingQuantity: 20300
                      ratio: 100/10
                      receivedQuantity: 2030
                    - id: 287958
                      symbol: CTG
                      caStatus: completed
                      recordDate: '2023-06-05'
                      processDate: '2024-03-04'
                      holdingQuantity: 126
                      ratio: 100/50
                      receivedQuantity: 63
                    - id: 270027
                      symbol: CTG
                      caStatus: pending
                      recordDate: '2023-02-24'
                      processDate: '2023-02-24'
                      holdingQuantity: 600
                      ratio: 100/21
                      receivedQuantity: 126
                    - id: 247266
                      symbol: MBB
                      caStatus: pending
                      recordDate: '2023-02-20'
                      processDate: '2023-02-21'
                      holdingQuantity: 1700
                      ratio: 1/1
                      receivedQuantity: 1700
                  stockBonus:
                    - id: 617276
                      symbol: MSB
                      caStatus: pending
                      recordDate: '2026-04-24'
                      processDate: '2026-05-13'
                      holdingQuantity: 600
                      ratio: 15/6
                      receivedQuantity: 240
                    - id: 615735
                      symbol: LPB
                      caStatus: pending
                      recordDate: '2026-04-06'
                      processDate: '2026-04-21'
                      holdingQuantity: 56300
                      ratio: 15/2
                      receivedQuantity: 7507
                    - id: 612951
                      symbol: SSI
                      caStatus: pending
                      recordDate: '2026-03-31'
                      processDate: '2026-06-26'
                      holdingQuantity: 75081
                      ratio: 1/1
                      receivedQuantity: 75081
                    - id: 604963
                      symbol: DSE
                      caStatus: pending
                      recordDate: '2026-03-03'
                      processDate: '2026-03-19'
                      holdingQuantity: 580
                      ratio: 56/23
                      receivedQuantity: 238
                    - id: 606706
                      symbol: MBS
                      caStatus: pending
                      recordDate: '2026-03-03'
                      processDate: '2026-03-12'
                      holdingQuantity: 44204
                      ratio: 15/2
                      receivedQuantity: 5894
                    - id: 580678
                      symbol: HUT
                      caStatus: pending
                      recordDate: '2026-02-26'
                      processDate: '2026-03-02'
                      holdingQuantity: 1500
                      ratio: 6/5
                      receivedQuantity: 1250
                    - id: 575861
                      symbol: DSE
                      caStatus: pending
                      recordDate: '2026-02-25'
                      processDate: '2026-03-02'
                      holdingQuantity: 475
                      ratio: 36/8
                      receivedQuantity: 105
                    - id: 579331
                      symbol: ACB
                      caStatus: pending
                      recordDate: '2026-02-25'
                      processDate: '2026-03-19'
                      holdingQuantity: 214485
                      ratio: 15/3
                      receivedQuantity: 42897
                    - id: 558828
                      symbol: FPT
                      caStatus: completed
                      recordDate: '2025-10-27'
                      processDate: '2025-11-05'
                      holdingQuantity: 8363
                      ratio: 100/13
                      receivedQuantity: 1088
                    - id: 540097
                      symbol: ACB
                      caStatus: pending
                      recordDate: '2025-08-25'
                      processDate: '2025-08-27'
                      holdingQuantity: 157487
                      ratio: 10/1
                      receivedQuantity: 15748
                    - id: 459352
                      symbol: TCB
                      caStatus: completed
                      recordDate: '2024-09-16'
                      processDate: '2024-10-03'
                      holdingQuantity: 3855
                      ratio: 111/28
                      receivedQuantity: 972
                    - id: 370112
                      symbol: FPT
                      caStatus: pending
                      recordDate: '2024-04-04'
                      processDate: '2024-04-05'
                      holdingQuantity: 5300
                      ratio: 100/15
                      receivedQuantity: 795
                    - id: 368652
                      symbol: PVS
                      caStatus: pending
                      recordDate: '2024-04-03'
                      processDate: '2024-04-04'
                      holdingQuantity: 328256
                      ratio: 100/10
                      receivedQuantity: 32825
                    - id: 347305
                      symbol: SSI
                      caStatus: pending
                      recordDate: '2024-01-19'
                      processDate: '2024-02-19'
                      holdingQuantity: 38535
                      ratio: 100/10
                      receivedQuantity: 3854
                    - id: 325996
                      symbol: HPG
                      caStatus: completed
                      recordDate: '2023-10-20'
                      processDate: '2023-10-23'
                      holdingQuantity: 1950
                      ratio: 100/5
                      receivedQuantity: 97
                    - id: 317711
                      symbol: BID
                      caStatus: pending
                      recordDate: '2023-10-10'
                      processDate: '2023-10-10'
                      holdingQuantity: 31036
                      ratio: 100/10
                      receivedQuantity: 3104
                    - id: 309720
                      symbol: VCB
                      caStatus: completed
                      recordDate: '2023-09-18'
                      processDate: '2023-09-19'
                      holdingQuantity: 76220
                      ratio: 1000/181
                      receivedQuantity: 13795
                    - id: 310713
                      symbol: MBS
                      caStatus: completed
                      recordDate: '2023-08-31'
                      processDate: '2023-09-19'
                      holdingQuantity: 27230
                      ratio: 100/20
                      receivedQuantity: 5446
                    - id: 303674
                      symbol: MBS
                      caStatus: completed
                      recordDate: '2023-08-30'
                      processDate: '2023-08-31'
                      holdingQuantity: 22692
                      ratio: 100/20
                      receivedQuantity: 4538
                    - id: 249813
                      symbol: MBB
                      caStatus: pending
                      recordDate: '2023-02-20'
                      processDate: '2023-02-21'
                      holdingQuantity: 3400
                      ratio: 2/1
                      receivedQuantity: 1700
                  rightsOffering:
                    - id: 623428
                      symbol: OIL
                      caStatus: pending
                      recordDate: '2026-04-29'
                      processDate: '2026-05-14'
                      holdingQuantity: 5137
                      ratio: 3/1
                      rightPrice: 11000
                      rightsQuantity: 1712
                      registeredQuantity: 170
                      startDateTransfer: '2026-05-04'
                      endDateTransfer: '2026-05-13'
                      startDateSubscription: '2026-05-04'
                      endDateSubscription: '2026-05-13'
                    - id: 537173
                      symbol: SHS
                      caStatus: pending
                      recordDate: '2025-08-25'
                      processDate: '2025-10-07'
                      holdingQuantity: 152905
                      ratio: 3/1
                      rightPrice: 9000
                      rightsQuantity: 50970
                      registeredQuantity: 100
                      startDateTransfer: '2025-09-11'
                      endDateTransfer: '2026-01-09'
                      startDateSubscription: '2025-10-07'
                      endDateSubscription: '2026-01-09'
                    - id: 411991
                      symbol: ABB
                      caStatus: pending
                      recordDate: '2024-06-06'
                      processDate: '2024-09-20'
                      holdingQuantity: 88223
                      ratio: 10/51
                      rightPrice: 10000
                      rightsQuantity: 449937
                      registeredQuantity: 20
                      startDateTransfer: '2024-06-18'
                      endDateTransfer: '2024-08-30'
                      startDateSubscription: '2024-06-18'
                      endDateSubscription: '2024-08-30'
                    - id: 366761
                      symbol: SSI
                      caStatus: pending
                      recordDate: '2024-04-01'
                      processDate: '2024-04-15'
                      holdingQuantity: 45135
                      ratio: 100/10
                      rightPrice: 10000
                      rightsQuantity: 4513
                      registeredQuantity: 100
                      startDateTransfer: '2024-04-02'
                      endDateTransfer: '2024-04-25'
                      startDateSubscription: '2024-04-02'
                      endDateSubscription: '2024-05-24'
                    - id: 330305
                      symbol: HPG
                      caStatus: pending
                      recordDate: '2023-10-20'
                      processDate: '2023-10-20'
                      holdingQuantity: 1950
                      ratio: 10/2
                      rightPrice: 12000
                      rightsQuantity: 390
                      registeredQuantity: 64
                      startDateTransfer: '2023-10-20'
                      endDateTransfer: '2023-12-26'
                      startDateSubscription: '2023-10-20'
                      endDateSubscription: '2023-12-29'
                    - id: 317941
                      symbol: BID
                      caStatus: pending
                      recordDate: '2023-10-10'
                      processDate: '2023-10-10'
                      holdingQuantity: 31036
                      ratio: 100/5
                      rightPrice: 15000
                      rightsQuantity: 1552
                      registeredQuantity: 11
                      startDateTransfer: '2023-10-10'
                      endDateTransfer: '2023-10-10'
                      startDateSubscription: '2023-10-10'
                      endDateSubscription: '2023-10-17'
                    - id: 315763
                      symbol: SSI
                      caStatus: completed
                      recordDate: '2023-09-21'
                      processDate: '2023-10-03'
                      holdingQuantity: 71734
                      ratio: 10/1
                      rightPrice: 20000000
                      rightsQuantity: 7173
                      registeredQuantity: 101
                      startDateTransfer: '2023-09-21'
                      endDateTransfer: '2023-09-21'
                      startDateSubscription: '2023-09-21'
                      endDateSubscription: '2023-10-02'
                    - id: 306893
                      symbol: SSI
                      caStatus: completed
                      recordDate: '2023-08-30'
                      processDate: '2023-09-26'
                      holdingQuantity: 61934
                      ratio: 1/1
                      rightPrice: 10000
                      rightsQuantity: 61934
                      registeredQuantity: 10000
                      startDateTransfer: '2023-08-30'
                      endDateTransfer: '2023-08-31'
                      startDateSubscription: '2023-08-30'
                      endDateSubscription: '2023-09-25'
                pagination:
                  pageIndex: 0
                  pageSize: 100
                  totalRecords: 100
        '400':
          description: Yêu cầu không hợp lệ
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 400
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-003
                    description: Mã lỗi
                  message:
                    type: string
                    example: Thông tin nhập không hợp lệ
                    description: Thông điệp lỗi
              example:
                code: OA-003
                message: Thông tin nhập không hợp lệ
                status: 400
        '500':
          description: Lỗi hệ thống
          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
      tags:
        - account
      description: Lấy danh sách lịch sử sự kiện quyền của tài khoản chứng khoán.
    parameters:
      - name: accountNo
        in: path
        required: true
        description: Số tiểu khoản
        schema:
          type: string
        example: '0001179019'
  /positions/{positionId}/pnl-configs:
    get:
      summary: Cấu hình chốt lời, cắt lỗ của vị thế
      parameters:
        - name: marketType
          in: query
          required: true
          description: |-
            Loại thị trường 
            - DERIVATIVE: Deal phái sinh
            Hiện tại chỉ hỗ trợ phái sinh
          schema:
            type: string
          example: DERIVATIVE
        - name: X-API-Key
          in: header
          description: API Key được cấp khi đăng ký dịch vụ
          schema:
            type: string
          example: '{{apiKey}}'
        - name: X-Aux-Date
          in: header
          description: Thời gian thực hiện yêu cầu
          schema:
            type: string
          example: '{{date}}'
        - name: X-Signature
          in: header
          description: Chữ ký xác thực 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:
            Cache-Control:
              schema:
                type: string
              example: no-cache, no-store, max-age=0, must-revalidate
            Content-Length:
              schema:
                type: integer
              example: 565
            Date:
              schema:
                type: string
              example: Wed, 03 Jun 2026 07:44:49 GMT
            Expires:
              schema:
                type: integer
              example: 0
            Pragma:
              schema:
                type: string
              example: no-cache
            Vary:
              schema:
                type: string
              example: Origin
            X-Content-Type-Options:
              schema:
                type: string
              example: nosniff
            X-Ratelimit-Limit:
              schema:
                type: integer
              example: -1
            X-Ratelimit-Remaining:
              schema:
                type: integer
              example: 0
            X-Ratelimit-Reset:
              schema:
                type: integer
              example: 0
            X-Tyk-Api-Expires:
              schema:
                type: string
              example: Thu, 02 Jan 3000 15:04:00 UTC
            X-Xss-Protection:
              schema:
                type: integer
              example: 0
          content:
            application/json:
              schema:
                type: object
                properties:
                  accountNo:
                    type: string
                    example: '0001179019'
                    description: Số tiểu khoản chứng khoán
                  positionId:
                    type: integer
                    example: 177952229647243
                    description: ID vị thế
                    format: int64
                  configs:
                    type: object
                    example:
                      takeProfit:
                        enabled: true
                        strategy: DELTA_PRICE
                        rate: 0.52
                        deltaPrice: 162.8
                        orderMethod: FASTEST
                        orderDeltaPrice: 2
                      stopLoss:
                        enabled: true
                        strategy: PNL_RATE
                        rate: -0.34
                        deltaPrice: 50.3
                        orderMethod: DELTA_PRICE
                        orderDeltaPrice: 10.5
                        trailingEnabled: true
                    description: Cấu hình chốt lời và cắt lỗ của vị thế
                    properties:
                      takeProfit:
                        type: object
                        example:
                          enabled: true
                          strategy: DELTA_PRICE
                          rate: 0.52
                          deltaPrice: 162.8
                          orderMethod: FASTEST
                          orderDeltaPrice: 2
                        description: Cấu hình chốt lời (Take Profit)
                        properties:
                          enabled:
                            type: boolean
                            example: true
                            description: Bật/tắt chức năng chốt lời
                          strategy:
                            type: string
                            example: DELTA_PRICE
                            description: |-
                              Chiến lược kích hoạt chốt lời
                              - PNL_RATE: Kích hoạt theo tỷ lệ %
                              - DELTA_PRICE: Kích hoạt theo mức chênh lệch giá
                          rate:
                            type: number
                            example: 0.52
                            description: >-
                              Tỷ lệ % so với giá hòa vốn, dùng để kích hoạt chốt
                              lời khi strategy = PNL_RATE. Giá trị phải lớn hơn
                              0
                            format: double
                          deltaPrice:
                            type: number
                            example: 162.8
                            description: >-
                              Mức chênh lệch giá so với giá hòa vốn, dùng để
                              kích hoạt chốt lời khi strategy = DELTA_PRICE. Giá
                              trị phải lớn hơn 0
                            format: double
                          orderMethod:
                            type: string
                            example: FASTEST
                            description: >-
                              Phương thức đặt lệnh khi điều kiện chốt lời được
                              kích hoạt.

                              - FASTEST: Lệnh khớp ngay với giá đặt là giá
                              trần/sàn tùy theo chiều vị thế Bán/Mua

                              - DELTA_PRICE: Lệnh đặt theo biên độ giá so với
                              giá kích hoạt
                          orderDeltaPrice:
                            type: integer
                            example: 2
                            description: >-
                              Biên độ giá đặt lệnh khi orderMethod =
                              DELTA_PRICE. Bằng 0 khi orderMethod = FASTEST
                            format: int32
                      stopLoss:
                        type: object
                        example:
                          enabled: true
                          strategy: PNL_RATE
                          rate: -0.34
                          deltaPrice: 50.3
                          orderMethod: DELTA_PRICE
                          orderDeltaPrice: 10.5
                          trailingEnabled: true
                        description: Cấu hình cắt lỗ (Stop Loss)
                        properties:
                          enabled:
                            type: boolean
                            example: true
                            description: Bật/tắt chức năng cắt lỗ
                          strategy:
                            type: string
                            example: PNL_RATE
                            description: |-
                              Chiến lược kích hoạt cắt lỗ
                              - PNL_RATE: Kích hoạt theo tỷ lệ %
                              - DELTA_PRICE: Kích hoạt theo mức chênh lệch giá.
                          rate:
                            type: number
                            example: -0.34
                            description: >-
                              Tỷ lệ % so với giá hòa vốn, dùng để kích hoạt chốt
                              lời khi strategy = PNL_RATE. Giá trị hợp lệ trong
                              khoảng [-1.0, 0)
                            format: double
                          deltaPrice:
                            type: number
                            example: 50.3
                            description: >-
                              Mức chênh lệch giá so với giá hòa vốn, dùng để
                              kích hoạt chốt lời khi strategy = DELTA_PRICE. Giá
                              trị phải lớn hơn 0
                            format: double
                          orderMethod:
                            type: string
                            example: DELTA_PRICE
                            description: >-
                              Phương thức đặt lệnh khi điều kiện chốt lời được
                              kích hoạt.

                              - FASTEST: Lệnh khớp ngay với giá đặt là giá
                              trần/sàn tùy theo chiều vị thế Bán/Mua

                              - DELTA_PRICE: Lệnh đặt theo biên độ giá so với
                              giá kích hoạt
                          orderDeltaPrice:
                            type: number
                            example: 10.5
                            description: >-
                              Biên độ giá đặt lệnh khi orderMethod =
                              DELTA_PRICE. Bằng 0 khi orderMethod = FASTEST
                            format: float
                          trailingEnabled:
                            type: boolean
                            example: true
                            description: >-
                              Bật/tắt cơ chế Trailing Stop. Lưu ý cơ chế này chỉ
                              hoạt động khi chức năng cắt lỗ được bật
                  createdDate:
                    type: string
                    example: '2026-06-02T02:47:36.384761Z'
                    description: Thời điểm cấu hình được tạo
                    format: date-time
                  modifiedDate:
                    type: string
                    example: '2026-06-03T07:52:08.00923505Z'
                    description: Thời điểm cập nhật cấu hình gần nhất
                    format: date-time
              example:
                positionId: 177952229647243
                configs:
                  takeProfit:
                    enabled: true
                    strategy: DELTA_PRICE
                    rate: 0.52
                    deltaPrice: 162.8
                    orderMethod: FASTEST
                    orderDeltaPrice: 2
                  stopLoss:
                    enabled: true
                    strategy: PNL_RATE
                    rate: -0.34
                    deltaPrice: 50.3
                    orderMethod: DELTA_PRICE
                    orderDeltaPrice: 10.5
                    trailingEnabled: true
                createdDate: '2026-06-02T02:47:36.384761Z'
                modifiedDate: '2026-06-03T07:44:44.235941815Z'
        '400':
          description: Yêu cầu không hợp lệ
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 400
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-003
                    description: Mã lỗi
                  message:
                    type: string
                    example: Thông tin nhập không hợp lệ
                    description: Thông điệp lỗi
              example:
                code: OA-003
                message: Thông tin nhập không hợp lệ
                status: 400
        '500':
          description: Lỗi hệ thống
          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
      tags:
        - account
      description: Lấy cấu hình chốt lời, cắt lỗ của vị thế đang nắm giữ theo `positionId.`
    parameters:
      - name: positionId
        in: path
        required: true
        description: 'Id vị thế '
        schema:
          type: integer
        example: 177952229647243
    post:
      summary: Cài đặt chốt lời, cắt lỗ cho vị thế
      parameters:
        - name: marketType
          in: query
          description: |-
            Loại thị trường 
            - DERIVATIVE: Deal phái sinh (chỉ hỗ trợ phái sinh)
          schema:
            type: string
          example: DERIVATIVE
        - name: X-API-Key
          in: header
          description: API Key được cấp khi đăng ký dịch vụ
          schema:
            type: string
          example: '{{apiKey}}'
        - name: X-Aux-Date
          in: header
          description: Thời gian thực hiện yêu cầu
          schema:
            type: string
          example: '{{date}}'
        - name: X-Signature
          in: header
          description: Chữ ký xác thực yêu cầu
          schema:
            type: string
          example: '{{signature}}'
        - name: version
          in: header
          description: 'Phiên bản API '
          schema:
            type: string
          example: '2026-07-23'
        - name: trading-token
          in: header
          description: Token đặt lệnh
          schema:
            type: string
          example: '{{tradingToken}}'
      responses:
        '200':
          description: OK
          headers:
            Cache-Control:
              schema:
                type: string
              example: no-cache, no-store, max-age=0, must-revalidate
            Content-Length:
              schema:
                type: integer
              example: 565
            Date:
              schema:
                type: string
              example: Wed, 03 Jun 2026 07:44:49 GMT
            Expires:
              schema:
                type: integer
              example: 0
            Pragma:
              schema:
                type: string
              example: no-cache
            Vary:
              schema:
                type: string
              example: Origin
            X-Content-Type-Options:
              schema:
                type: string
              example: nosniff
            X-Ratelimit-Limit:
              schema:
                type: integer
              example: -1
            X-Ratelimit-Remaining:
              schema:
                type: integer
              example: 0
            X-Ratelimit-Reset:
              schema:
                type: integer
              example: 0
            X-Tyk-Api-Expires:
              schema:
                type: string
              example: Thu, 02 Jan 3000 15:04:00 UTC
            X-Xss-Protection:
              schema:
                type: integer
              example: 0
          content:
            application/json:
              schema:
                type: object
                properties:
                  accountNo:
                    type: string
                    example: '0001179019'
                    description: Số tiểu khoản chứng khoán
                  positionId:
                    type: integer
                    example: 177952229647243
                    description: ID vị thế
                    format: int64
                  configs:
                    type: object
                    example:
                      takeProfit:
                        enabled: true
                        strategy: DELTA_PRICE
                        rate: 0.52
                        deltaPrice: 162.8
                        orderMethod: FASTEST
                        orderDeltaPrice: 2
                      stopLoss:
                        enabled: true
                        strategy: PNL_RATE
                        rate: -0.34
                        deltaPrice: 50.3
                        orderMethod: DELTA_PRICE
                        orderDeltaPrice: 10.5
                        trailingEnabled: true
                    description: Cấu hình chốt lời và cắt lỗ của vị thế
                    properties:
                      takeProfit:
                        type: object
                        example:
                          enabled: true
                          strategy: DELTA_PRICE
                          rate: 0.52
                          deltaPrice: 162.8
                          orderMethod: FASTEST
                          orderDeltaPrice: 2
                        description: Cấu hình chốt lời (Take Profit)
                        properties:
                          enabled:
                            type: boolean
                            example: true
                            description: Bật/tắt chức năng chốt lời
                          strategy:
                            type: string
                            example: DELTA_PRICE
                            description: |-
                              Chiến lược kích hoạt chốt lời
                              - PNL_RATE: Kích hoạt theo tỷ lệ %
                              - DELTA_PRICE: Kích hoạt theo mức chênh lệch giá
                          rate:
                            type: number
                            example: 0.52
                            description: >-
                              Tỷ lệ % so với giá hòa vốn, dùng để kích hoạt chốt
                              lời khi strategy = PNL_RATE. Giá trị phải lớn hơn
                              0
                            format: double
                          deltaPrice:
                            type: number
                            example: 162.8
                            description: >-
                              Mức chênh lệch giá so với giá hòa vốn, dùng để
                              kích hoạt chốt lời khi strategy = DELTA_PRICE. Giá
                              trị phải lớn hơn 0
                            format: double
                          orderMethod:
                            type: string
                            example: FASTEST
                            description: >-
                              Phương thức đặt lệnh khi điều kiện chốt lời được
                              kích hoạt.

                              - FASTEST: Lệnh khớp ngay với giá đặt là giá
                              trần/sàn tùy theo chiều vị thế Bán/Mua

                              - DELTA_PRICE: Lệnh đặt theo biên độ giá so với
                              giá kích hoạt
                          orderDeltaPrice:
                            type: integer
                            example: 2
                            description: >-
                              Biên độ giá đặt lệnh khi orderMethod =
                              DELTA_PRICE. Bằng 0 khi orderMethod = FASTEST
                            format: int32
                      stopLoss:
                        type: object
                        example:
                          enabled: true
                          strategy: PNL_RATE
                          rate: -0.34
                          deltaPrice: 50.3
                          orderMethod: DELTA_PRICE
                          orderDeltaPrice: 10.5
                          trailingEnabled: true
                        description: Cấu hình cắt lỗ (Stop Loss)
                        properties:
                          enabled:
                            type: boolean
                            example: true
                            description: Bật/tắt chức năng cắt lỗ
                          strategy:
                            type: string
                            example: PNL_RATE
                            description: |-
                              Chiến lược kích hoạt cắt lỗ
                              - PNL_RATE: Kích hoạt theo tỷ lệ %
                              - DELTA_PRICE: Kích hoạt theo mức chênh lệch giá.
                          rate:
                            type: number
                            example: -0.34
                            description: >-
                              Tỷ lệ % so với giá hòa vốn, dùng để kích hoạt chốt
                              lời khi strategy = PNL_RATE. Giá trị hợp lệ trong
                              khoảng [-1.0, 0)
                            format: double
                          deltaPrice:
                            type: number
                            example: 50.3
                            description: >-
                              Mức chênh lệch giá so với giá hòa vốn, dùng để
                              kích hoạt chốt lời khi strategy = DELTA_PRICE. Giá
                              trị phải lớn hơn 0
                            format: double
                          orderMethod:
                            type: string
                            example: DELTA_PRICE
                            description: >-
                              Phương thức đặt lệnh khi điều kiện chốt lời được
                              kích hoạt.

                              - FASTEST: Lệnh khớp ngay với giá đặt là giá
                              trần/sàn tùy theo chiều vị thế Bán/Mua

                              - DELTA_PRICE: Lệnh đặt theo biên độ giá so với
                              giá kích hoạt
                          orderDeltaPrice:
                            type: number
                            example: 10.5
                            description: >-
                              Biên độ giá đặt lệnh khi orderMethod =
                              DELTA_PRICE. Bằng 0 khi orderMethod = FASTEST
                            format: float
                          trailingEnabled:
                            type: boolean
                            example: true
                            description: >-
                              Bật/tắt cơ chế Trailing Stop. Lưu ý cơ chế này chỉ
                              hoạt động khi chức năng cắt lỗ được bật
                  createdDate:
                    type: string
                    example: '2026-06-02T02:47:36.384761Z'
                    description: Thời điểm cấu hình được tạo
                    format: date-time
                  modifiedDate:
                    type: string
                    example: '2026-06-03T07:52:08.00923505Z'
                    description: Thời điểm cập nhật cấu hình gần nhất
                    format: date-time
              example:
                positionId: 177952229647243
                configs:
                  takeProfit:
                    enabled: true
                    strategy: DELTA_PRICE
                    rate: 0.52
                    deltaPrice: 162.8
                    orderMethod: FASTEST
                    orderDeltaPrice: 2
                  stopLoss:
                    enabled: true
                    strategy: PNL_RATE
                    rate: -0.34
                    deltaPrice: 50.3
                    orderMethod: DELTA_PRICE
                    orderDeltaPrice: 10.5
                    trailingEnabled: true
                createdDate: '2026-06-02T02:47:36.384761Z'
                modifiedDate: '2026-06-03T07:44:44.235941815Z'
        '400':
          description: Yêu cầu không hợp lệ
          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
          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
      tags:
        - trading
      description: >-
        Cài đặt cấu hình chốt lời, cắt lỗ cho vị thế đang nắm giữ theo
        `positionId.`


        Khuyến nghị: Body Request gửi lên đầy đủ các trường thông tin.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                takeProfit:
                  type: object
                  description: Cấu hình chốt lời (Take Profit)
                  properties:
                    enabled:
                      type: boolean
                      example: true 
                      description: Bật/tắt chức năng chốt lời      
                    strategy:
                      type: string
                      example: DELTA_PRICE
                      description: >-
                        Chiến lược kích hoạt chốt lời 
                          - PNL_RATE: Kích hoạt theo tỷ lệ %
                          - DELTA_PRICE: Kích hoạt theo mức chênh lệch giá                       
                    rate:
                      type: number
                      example: 0.52
                      format: double
                      description: Tỷ lệ % so với giá hòa vốn, dùng để kích hoạt chốt lời khi strategy = PNL_RATE. Giá trị phải lớn hơn 0   
                    deltaPrice:
                      type: number
                      example: 162.8
                      format: double
                      description: Mức chênh lệch giá so với giá hòa vốn, dùng để kích hoạt chốt lời khi strategy = DELTA_PRICE. Giá trị phải lớn hơn 0
                    orderMethod:
                      type: string
                      example: FASTEST
                      description: >-
                        Phương thức đặt lệnh khi điều kiện chốt lời được kích hoạt.
                          - FASTEST: Lệnh khớp ngay với giá đặt là giá trần/sàn tùy theo chiều vị thế Bán/Mua
                          - DELTA_PRICE: Lệnh đặt theo biên độ giá so với giá kích hoạt 
                    orderDeltaPrice:
                      type: integer
                      format: double
                      example: 2
                      description: Biên độ giá đặt lệnh so với giá kích hoạt khi orderMethod = DELTA_PRICE. Có thể là số âm, số dương hoặc bằng 0
                stopLoss:
                  type: object
                  description: Cấu hình cắt lỗ (Stop Loss)
                  properties:
                    enabled:
                      type: boolean
                      example: 
                      description: Bật/tắt chức năng cắt lỗ                       
                    strategy:
                      type: string
                      example: DELTA_PRICE
                      description: >-
                        Chiến lược kích hoạt cắt lỗ 
                          - PNL_RATE: Kích hoạt theo tỷ lệ %
                          - DELTA_PRICE: Kích hoạt theo mức chênh lệch giá   
                    rate:
                      type: number
                      example: -0.34
                      format: double
                      description: Tỷ lệ % so với giá hòa vốn, dùng để kích hoạt cắt lỗ khi strategy = PNL_RATE. Giá trị hợp lệ trong khoảng [-1.0, 0)  
                    deltaPrice:
                      type: number
                      format: double
                      example: 50.3
                      description: Mức chênh lệch giá so với giá hòa vốn, dùng để kích hoạt cắt lỗ khi strategy = DELTA_PRICE. Giá trị phải lớn hơn 0
                    orderMethod:
                      type: string
                      example: FASTEST
                      description: >-
                        Phương thức đặt lệnh khi điều kiện chốt lời được kích hoạt.
                          - FASTEST: Lệnh khớp ngay với giá đặt là giá trần/sàn tùy theo chiều vị thế Bán/Mua
                          - DELTA_PRICE: Lệnh đặt theo biên độ giá so với giá kích hoạt 
                    orderDeltaPrice:
                      type: number
                      format: double                      
                      description: Biên độ giá đặt lệnh so với giá kích hoạt khi orderMethod = DELTA_PRICE. Có thể là số âm, số dương hoặc bằng 0
                      example: 10.5
                    trailingEnabled:
                      type: boolean
                      example: true
                      description: Bật/tắt cơ chế Trailing Stop. Lưu ý cơ chế này chỉ hoạt động khi chức năng cắt lỗ được bật
            example:
              takeProfit:
                enabled: true
                strategy: DELTA_PRICE
                rate: 0.52
                deltaPrice: 162.8
                orderMethod: FASTEST
                orderDeltaPrice: 2
              stopLoss:
                enabled: true
                strategy: PNL_RATE
                rate: -0.34
                deltaPrice: 50.3
                orderMethod: DELTA_PRICE
                orderDeltaPrice: 10.5
                trailingEnabled: true
  /registration/send-email-otp:
    post:
      summary: Gửi Email OTP
      parameters:
        - name: X-API-Key
          in: header
          required: true
          description: API Key được cấp khi đăng ký dịch vụ
          deprecated: false
          schema:
            type: string
          example: '{{apiKey}}'
        - name: X-Aux-Date
          in: header
          required: true
          description: Thời gian thực hiện yêu cầu
          deprecated: false
          schema:
            type: string
          example: '{{date}}'
        - name: X-Signature
          in: header
          required: true
          description: Chữ ký xác thực yêu cầu
          deprecated: false
          schema:
            type: string
          example: '{{signature}}'
        - name: version
          in: header
          description: API version (YYYY-MM-DD)
          schema:
            type: string
            format: date
          example: '2026-07-23'
      responses:
        '200':
          description: OK
          headers:
            Content-Length:
              schema:
                type: integer
              example: 46
            Date:
              schema:
                type: string
              example: Wed, 18 Mar 2026 16:14:37 GMT
            Vary:
              schema:
                type: string
              example: Origin
            X-Frame-Options:
              schema:
                type: string
              example: GOFORIT
            X-Ratelimit-Limit:
              schema:
                type: integer
              example: 300
            X-Ratelimit-Remaining:
              schema:
                type: integer
              example: 298
            X-Ratelimit-Reset:
              schema:
                type: integer
              example: 1773936838
            X-Request-Id:
              schema:
                type: string
              example: WlnjbiWRMdBEaTGsYcNlhJJpVYYYnKDH
            X-Tyk-Api-Expires:
              schema:
                type: string
              example: Thu, 02 Jan 3000 15:04:00 UTC
        '400':
          description: Yêu cầu không hợp lệ
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 400
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-003
                    description: Mã lỗi
                  message:
                    type: string
                    example: Thông tin nhập không hợp lệ
                    description: Thông điệp lỗi
              example:
                status: 400
                code: OA-003
                message: Thông tin nhập không hợp lệ
        '500':
          description: Lỗi hệ thống
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 500
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-009
                    description: Mã lỗi
                  message:
                    type: string
                    example: Lỗi hệ thống
                    description: Thông điệp lỗi
              example:
                code: OA-009
                message: Lỗi hệ thống
                status: 500
      tags:
        - trading
      description: >-
        Gửi yêu cầu nhận mã OTP qua Email, chỉ áp dụng cho các tài khoản đang sử
        dụng phương thức xác thực lớp thứ hai là Email OTP. Sau khi nhận phản hồi thành công từ hệ thống, người dùng kiểm tra Email để lấy mã OTP.
  /registration/trading-token:
    post:
      summary: Xác thực OTP
      parameters:
        - name: X-API-Key
          in: header
          required: true
          description: API Key được cấp khi đăng ký dịch vụ
          deprecated: false
          schema:
            type: string
          example: '{{apiKey}}'
        - name: X-Aux-Date
          in: header
          required: true
          description: Thời gian thực hiện yêu cầu
          deprecated: false
          schema:
            type: string
          example: '{{date}}'
        - name: X-Signature
          in: header
          required: true
          description: Chữ ký xác thực yêu cầu
          deprecated: false
          schema:
            type: string
          example: '{{signature}}'
        - name: version
          in: header
          description: API version (YYYY-MM-DD)
          schema:
            type: string
            format: date
          example: '2026-07-23'
      responses:
        '200':
          description: OK
          headers:
            Content-Length:
              schema:
                type: integer
              example: 56
            Date:
              schema:
                type: string
              example: Wed, 18 Mar 2026 16:15:18 GMT
            Vary:
              schema:
                type: string
              example: Origin
            X-Frame-Options:
              schema:
                type: string
              example: GOFORIT
            X-Ratelimit-Limit:
              schema:
                type: integer
              example: 300
            X-Ratelimit-Remaining:
              schema:
                type: integer
              example: 299
            X-Ratelimit-Reset:
              schema:
                type: integer
              example: 1773850517
            X-Request-Id:
              schema:
                type: string
              example: MnbLxZrRhSMHnXlfhYjjIswAMGqYVlzb
            X-Tyk-Api-Expires:
              schema:
                type: string
              example: Thu, 02 Jan 3000 15:04:00 UTC
          content:
            application/json:
              schema:
                type: object
                properties:
                  tradingToken:
                    type: string
                    example: 9ab81e9c-8a81-45aa-8190-b69a1c179d52
                    description: Token đặt lệnh
              example:
                tradingToken: 9ab81e9c-8a81-45aa-8190-b69a1c179d52
        '400':
          description: Yêu cầu không hợp lệ
          headers:
            Content-Length:
              schema:
                type: integer
              example: 101
            Date:
              schema:
                type: string
              example: Wed, 25 Mar 2026 15:23:56 GMT
            Vary:
              schema:
                type: string
              example: Origin
            X-Frame-Options:
              schema:
                type: string
              example: GOFORIT
            X-Ratelimit-Limit:
              schema:
                type: integer
              example: 300
            X-Ratelimit-Remaining:
              schema:
                type: integer
              example: 298
            X-Ratelimit-Reset:
              schema:
                type: integer
              example: 1774538632
            X-Request-Id:
              schema:
                type: string
              example: xrKYIYrVUPtXbYRUbeapUatkUHeliXhh
            X-Tyk-Api-Expires:
              schema:
                type: string
              example: Thu, 02 Jan 3000 15:04:00 UTC
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 400
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-100
                    description: Mã lỗi
                  message:
                    type: string
                    example: 'Invalid input: otpType is not registered for this account'
                    description: Thông điệp lỗi
              example:
                status: 400
                code: OA-100
                message: 'Invalid input: otpType is not registered for this account'
        '500':
          description: Lỗi hệ thống
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 500
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-009
                    description: Mã lỗi
                  message:
                    type: string
                    example: Lỗi hệ thống
                    description: Thông điệp lỗi
              example:
                code: OA-009
                message: Lỗi hệ thống
                status: 500
      tags:
        - trading
      description: >-
        Xác thực mã OTP theo phương thức xác thực (Email OTP hoặc Smart OTP) đã
        đăng ký để lấy Trading Token. Đây là thông tin bắt buộc để xác thực
        quyền giao dịch, có hiệu lực trong 8 tiếng.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                otpType:
                  type: string
                  example: email_otp
                  description: >-
                    Phương thức xác thực OTP

                    - email_otp: Áp dụng cho tài khoản đăng ký phương thức xác
                    thực lớp thứ 2 là Email OTP

                    - smart_otp: Áp dụng cho tài khoản đăng ký phương thức xác
                    thực lớp thứ 2 là Smart OTP
                passcode:
                  type: string
                  example: '519752'
                  description: Mã OTP tương ứng với phương thức xác thực
            example:
              otpType: email_otp
              passcode: '569542'
  /positions/{positionId}/close:
    post:
      summary: Đóng vị thế
      parameters:
        - name: marketType
          in: query
          required: true
          description: |-
            Loại thị trường 
            - DERIVATIVE: Deal phái sinh (chỉ hỗ trợ phái sinh)
          deprecated: false
          schema:
            type: string
          example: DERIVATIVE
        - name: X-API-Key
          in: header
          required: true
          description: API Key được cấp khi đăng ký dịch vụ
          deprecated: false
          schema:
            type: string
          example: '{{apiKey}}'
        - name: X-Signature
          in: header
          required: true
          description: Chữ ký xác thực yêu cầu
          deprecated: false
          schema:
            type: string
          example: '{{signature}}'
        - name: X-Aux-Date
          in: header
          required: true
          description: Thời gian thực hiện yêu cầu
          deprecated: false
          schema:
            type: string
          example: '{{date}}'
        - name: trading-token
          in: header
          required: true
          description: Token đặt lệnh
          deprecated: false
          schema:
            type: string
          example: '{{tradingToken}}'
        - name: version
          in: header
          description: API version (YYYY-MM-DD)
          schema:
            type: string
            format: date
          example: '2026-07-23'
      responses:
        '200':
          description: OK
          headers:
            Access-Control-Allow-Credentials:
              schema:
                type: boolean
              example: true
            Content-Encoding:
              schema:
                type: string
              example: br
            Content-Length:
              schema:
                type: integer
              example: 180
            Date:
              schema:
                type: string
              example: Tue, 24 Mar 2026 04:20:55 GMT
            Vary:
              schema:
                type: string
              example: Origin
            X-Ratelimit-Limit:
              schema:
                type: integer
              example: -1
            X-Ratelimit-Remaining:
              schema:
                type: integer
              example: 0
            X-Ratelimit-Reset:
              schema:
                type: integer
              example: 0
            X-Tyk-Api-Expires:
              schema:
                type: string
              example: Thu, 02 Jan 3000 15:04:00 UTC
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: integer
                    example: 1636
                    description: Id lệnh giao dịch
                    format: int32
                  side:
                    type: string
                    example: NS
                    description: |-
                      Chiều đặt lệnh
                      - NB: Mua
                      - NS: Bán
                  accountNo:
                    type: string
                    example: '0001179019'
                    description: Số tiểu khoản
                  symbol:
                    type: string
                    example: 41I1G4000
                    description: Mã chứng khoán
                  price:
                    type: number
                    example: 1618.2
                    description: Giá đặt
                    format: double
                  quantity:
                    type: integer
                    example: 1
                    description: Khối lượng đặt
                    format: int32
                  orderType:
                    type: string
                    example: LO
                    description: |-
                      Loại lệnh
                      - LO: Lệnh giới hạn
                      - MOK/MAK/MTL: Lệnh thị trường
                      - ATO/ATC: Lệnh phiên định kỳ mở cửa/đóng cửa
                      - PLO: Lệnh khớp lệnh sau giờ
                  fillQuantity:
                    type: integer
                    example: 0
                    description: Khối lượng khớp
                    format: int32
                  leaveQuantity:
                    type: integer
                    example: 0
                    description: Khối lượng còn lại
                    format: int32
                  canceledQuantity:
                    type: integer
                    example: 0
                    description: Khối lượng đã hủy
                    format: int32
                  loanPackageId:
                    type: integer
                    example: 2278
                    description: Mã gói vay
                    format: int32
                  createdDate:
                    type: string
                    example: '2026-03-24T04:20:55.63'
                    description: Thời điểm tạo
                    format: date-time
                  modifiedDate:
                    type: string
                    example: '2026-03-24T04:20:55.63'
                    description: Thời điểm cập nhật
                    format: date-time
              example:
                id: 1636
                side: NS
                accountNo: '0001179019'
                symbol: 41I1G4000
                price: 1618.2
                quantity: 1
                orderType: LO
                fillQuantity: 0
                leaveQuantity: 0
                canceledQuantity: 0
                loanPackageId: 2278
                createdDate: '2026-03-24T04:20:55.63'
                modifiedDate: '2026-03-24T04:20:55.63'
        '400':
          description: Yêu cầu không hợp lệ
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 400
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-003
                    description: Mã lỗi
                  message:
                    type: string
                    example: Thông tin nhập không hợp lệ
                    description: Thông điệp lỗi
              example:
                status: 400
                code: OA-003
                message: Thông tin nhập không hợp lệ
        '500':
          description: Lỗi hệ thống
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 500
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-009
                    description: Mã lỗi
                  message:
                    type: string
                    example: Lỗi hệ thống
                    description: Thông điệp lỗi
              example:
                code: OA-009
                message: Lỗi hệ thống
                status: 500
      tags:
        - trading
    parameters:
      - name: positionId
        in: path
        required: true
        description: Id vị thế
        deprecated: false
        schema:
          type: string
        example: '177410795472387'
  /price/{symbol}/secdef:
    get:
      summary: Thông tin giao dịch chứng khoán
      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: 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: Thời gian thực hiện yêu cầu
          schema:
            type: string
          example: '{{date}}'
        - name: X-Signature
          in: header
          required: true
          description: Chữ ký xác thực yêu cầu
          schema:
            type: string
          example: '{{signature}}'
        - name: version
          in: header
          description: API version (YYYY-MM-DD)
          schema:
            type: string
          example: '2026-07-23'
      responses:
        '200':
          description: OK
          headers:
            Content-Length:
              schema:
                type: integer
              example: 404
            Date:
              schema:
                type: string
              example: Tue, 26 May 2026 16:17:42 GMT
            Vary:
              schema:
                type: string
              example: Origin
            X-Ratelimit-Limit:
              schema:
                type: integer
              example: 10000
            X-Ratelimit-Remaining:
              schema:
                type: integer
              example: 9999
            X-Ratelimit-Reset:
              schema:
                type: integer
              example: 1779898662
            X-Tyk-Api-Expires:
              schema:
                type: string
              example: Thu, 02 Jan 3000 15:04:00 UTC
          content:
            application/json:
              schema:
                type: array
                example:
                  - marketId: STO
                    boardId: G1
                    isin: VN000000HPG4
                    symbol: HPG
                    productGrpId: STO
                    securityGroupId: ST
                    basicPrice: 94.1
                    ceilingPrice: 100.6
                    floorPrice: 87.6
                    securityStatus: NO_HALT
                    symbolAdminStatusCode: NRM
                    symbolTradingMethodStatusCode: NRM
                    symbolTradingSanctionStatusCode: NRM
                    finalTradeDate: null
                    listingDate: '2007-11-15T00:00:00Z'
                    time: '2026-08-04 08:00:24.008'
                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)
                    isin:
                      type: string
                      example: VN000000HPG4
                      description: Mã định danh quốc tế
                    symbol:
                      type: string
                      example: HPG
                      description: Mã chứng khoán
                    productGrpId:
                      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
                    securityGroupId:
                      type: string
                      example: ST
                      description: |-
                        Nhóm chứng khoán
                        - BS: Trái phiếu doanh nghiệp
                        - EF: Quỹ ETF
                        - EW: Chứng quyền
                        - FU: Hợp đồng tương lai
                        - ST: Cổ phiếu
                    basicPrice:
                      type: number
                      format: double
                      example: 94.1
                      description: Giá tham chiếu ngày giao dịch
                    ceilingPrice:
                      type: number
                      format: double
                      example: 100.6
                      description: Giá trần ngày giao dịch
                    floorPrice:
                      type: number
                      format: double
                      example: 87.6
                      description: Giá sàn ngày giao dịch
                    securityStatus:
                      type: string
                      example: NO_HALT
                      description: |-
                        Trạng thái giao dịch của mã chứng khoán
                        - HALT: Ngừng giao dịch
                        - NO_HALT: Không ngừng giao dịch
                    symbolAdminStatusCode:
                      type: string
                      example: NRM
                      description: |-
                        Trạng thái quản lý hành chính mã chứng khoán
                        -  CR: Kiểm soát và hạn chế giao dịch
                        - CTR: Kiểm soát
                        - NRM: Bình thường
                        - RES: Hạn chế giao dịch
                        - WFR: Cảnh báo vi phạm BCTC
                        - WID: Cảnh báo vi phạm CBTT
                        - WOV: Cảnh báo vi phạm khác
                    symbolTradingMethodStatusCode:
                      type: string
                      example: NRM
                      description: |-
                        Trạng thái cơ chế giao dịch mã chứng khoán
                        - NRM: Bình thường
                        - NWE: Niêm yết mới (biên độ đặc biệt)
                        -  NWN: Niêm yết mới (biên độ thường)
                        - SLS: Giao dịch đặc biệt sau tạm ngưng
                        - SNE: Giao dịch đặc biệt không có giao dịch dài hạn
                    symbolTradingSanctionStatusCode:
                      type: string
                      example: NRM
                      description: |-
                        Tình trạng giao dịch của mã chứng khoán
                        - NRM: Bình thường
                        -  SUS: Tạm ngừng giao dịch
                        - DTL: Hủy niêm yết để chuyển sàn
                        - TFR: Ngưng giao dịch do hạn chế
                    finalTradeDate:
                      example: null
                      description: Ngày giao dịch cuối cùng (nếu có)
                      nullable: true
                    listingDate:
                      type: string
                      format: date-time
                      example: '2007-11-15T00:00:00Z'
                      description: Ngày niêm yế
                    time:
                      type: string
                      example: '2026-08-04 08:00:24.008'
                      description: Thời gian ghi nhận (YYYY-MM-DD HH:mm:ss.SSS (GMT+7))
                description: ''
              example:
                - marketId: STO
                  boardId: G1
                  isin: VN000000HPG4
                  symbol: HPG
                  productGrpId: STO
                  securityGroupId: ST
                  basicPrice: 94.1
                  ceilingPrice: 100.6
                  floorPrice: 87.6
                  securityStatus: NO_HALT
                  symbolAdminStatusCode: NRM
                  symbolTradingMethodStatusCode: NRM
                  symbolTradingSanctionStatusCode: NRM
                  finalTradeDate: null
                  listingDate: '2007-11-15T00:00:00Z'
                  time: '2026-08-04 08:00:24.008'
        '400':
          description: Yêu cầu không hợp lệ
          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
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 500
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-009
                    description: Mã lỗi
                  message:
                    type: string
                    example: Lỗi hệ thống
                    description: Thông điệp lỗi
              example:
                code: OA-009
                message: Lỗi hệ thống
                status: 500
      tags:
        - market-data
      description: >-
        Truy vấn thông tin về giá trần/sàn/tham chiếu và trạng thái của mã chứng
        khoán vào ngày giao dịch.
    parameters:
      - name: symbol
        in: path
        required: true
        description: Mã chứng khoán
        schema:
          type: string
        example: HPG
  /price/{symbol}/close:
    get:
      summary: Giá đóng cửa
      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: 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: Thời gian thực hiện yêu cầu
          schema:
            type: string
          example: '{{date}}'
        - name: X-Signature
          in: header
          required: true
          description: Chữ ký xác thực yêu cầu
          schema:
            type: string
          example: '{{signature}}'
        - name: version
          in: header
          description: API version (YYYY-MM-DD)
          schema:
            type: string
          example: '2026-07-23'
      responses:
        '200':
          description: OK
          headers:
            Content-Length:
              schema:
                type: integer
              example: 196
            Date:
              schema:
                type: string
              example: Wed, 08 Apr 2026 06:51:13 GMT
            Vary:
              schema:
                type: string
              example: Origin
            X-Ratelimit-Limit:
              schema:
                type: integer
              example: 10000
            X-Ratelimit-Remaining:
              schema:
                type: integer
              example: 9999
            X-Ratelimit-Reset:
              schema:
                type: integer
              example: 1775631073
            X-Tyk-Api-Expires:
              schema:
                type: string
              example: Thu, 02 Jan 3000 15:04:00 UTC
          content:
            application/json:
              schema:
                type: object
                properties:
                  prices:
                    type: array
                    description: Danh sách thông tin giá đóng cửa của các mã chứng khoán.
                    example:
                      - marketId: STO
                        boardId: G1
                        isin: VN000000HPG4
                        symbol: HPG
                        closePrice: 26.8
                        time: '2026-04-08 02:14:59.775'
                    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)
                        isin:
                          type: string
                          example: VN000000HPG4
                          description: Mã định danh quốc tế
                        symbol:
                          type: string
                          example: HPG
                          description: Mã chứng khoán
                        closePrice:
                          type: number
                          format: double
                          example: 26.8
                          description: Giá đóng cửa của mã chứng khoán
                        time:
                          type: string
                          example: '2026-04-08 02:14:59.775'
                          description: Thời gian ghi nhận (YYYY-MM-DD HH:mm:ss.SSS (GMT+7))
              example:
                prices:
                  - marketId: STO
                    boardId: G1
                    isin: VN000000HPG4
                    symbol: HPG
                    closePrice: 26.8
                    time: '2026-04-08 02:14:59.775'
        '400':
          description: Yêu cầu không hợp lệ
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 400
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-003
                    description: Mã lỗi
                  message:
                    type: string
                    example: Thông tin nhập không hợp lệ
                    description: Thông điệp lỗi
              example:
                code: OA-003
                message: Thông tin nhập không hợp lệ
                status: 400
        '500':
          description: Lỗi hệ thống
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 500
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-009
                    description: Mã lỗi
                  message:
                    type: string
                    example: Lỗi hệ thống
                    description: Thông điệp lỗi
              example:
                code: OA-009
                message: Lỗi hệ thống
                status: 500
      tags:
        - market-data
      description: >-
        Truy vấn thông tin giá đóng cửa trong phiên giao dịch của mã chứng
        khoán.
    parameters:
      - name: symbol
        in: path
        required: true
        description: Mã chứng khoán
        schema:
          type: string
        example: HPG
  /instruments:
    get:
      summary: Chi tiết mã chứng khoán
      parameters:
        - name: symbol
          in: query
          description: Danh sách mã chứng khoán
          schema:
            type: string
          example: SSI,SHS,ACB,HUT,DSE
        - name: marketId
          in: query
          description: |-
            Mã thị trường niêm yết
            - STO: Cổ phiếu sàn HOSE
            - STX: Cổ phiếu sàn HNX
            - UPX: Cổ phiếu sàn UPCOM
            - DVX: Phái sinh
            - HCX: Trái phiếu doanh nghiệp
          schema:
            type: string
          example: STO
        - name: securityGroupId
          in: query
          description: |-
            Nhóm chứng khoán
            - ST: Cổ phiếu
            - EF: Quỹ ETF
            - EW: Chứng quyền
            - FU: Hợp đồng tương lai
            - BS: Trái phiếu
          schema:
            type: string
          example: ST
        - name: indexName
          in: query
          description: |-
            Chỉ số thị trường 
            - VN30: Top 30 cổ phiếu sàn HOSE
            - VN100: Top 100 cổ phiếu sàn HOSE
            - HNX30: Top 30 cổ phiếu sàn HNX
          schema:
            type: string
          example: VN30
        - name: limit
          in: query
          description: Số bản ghi trên mỗi trang
          schema:
            type: integer
          example: 100
        - name: page
          in: query
          description: Phân trang hiện tại
          schema:
            type: integer
          example: 1
        - 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: Thời gian thực hiện yêu cầu
          schema:
            type: string
          example: '{{date}}'
        - name: X-Signature
          in: header
          required: true
          description: Chữ ký xác thực yêu cầu
          schema:
            type: string
          example: '{{signature}}'
        - name: version
          in: header
          description: API version (YYYY-MM-DD)
          schema:
            type: string
            format: date
          example: '2026-07-23'
      responses:
        '200':
          description: OK
          headers:
            Access-Control-Allow-Credentials:
              deprecated: false
              schema: {}
              example: 'true'
            Content-Length:
              deprecated: false
              schema: {}
              example: '1388'
            Date:
              deprecated: false
              schema: {}
              example: Tue, 24 Mar 2026 06:16:46 GMT
            Vary:
              deprecated: false
              schema: {}
              example: Origin
            X-Content-Type-Options:
              deprecated: false
              schema: {}
              example: nosniff
            X-Frame-Options:
              deprecated: false
              schema: {}
              example: SAMEORIGIN
            X-Ratelimit-Limit:
              deprecated: false
              schema: {}
              example: '1000'
            X-Ratelimit-Remaining:
              deprecated: false
              schema: {}
              example: '993'
            X-Ratelimit-Reset:
              deprecated: false
              schema: {}
              example: '1774414805'
            X-Request-Id:
              deprecated: false
              schema: {}
              example: fpWsYgR7RLZP8Ys8YtpnDXi6m8fbRbVZ
            X-Tyk-Api-Expires:
              deprecated: false
              schema: {}
              example: Thu, 02 Jan 3000 15:04:00 UTC
            X-Xss-Protection:
              deprecated: false
              schema: {}
              example: 1; mode=block
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    example:
                      - symbol: ACB
                        marketId: STO
                        securityGroupId: ST
                        symbolType: ''
                        listedDate: '2020-12-09'
                        shortName: Ngân hàng Á Châu
                        name: Ngân hàng TMCP Á Châu
                        indexName:
                          - VN100
                          - VN30
                    items:
                      type: object
                      properties:
                        symbol:
                          type: string
                          example: ACB
                          description: Mã chứng khoán
                        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
                        securityGroupId:
                          type: string
                          example: ST
                          description: |-
                            Nhóm chứng khoán
                            - BS: Trái phiếu doanh nghiệp
                            - EF: Quỹ ETF
                            - EW: Chứng quyền
                            - FU: Hợp đồng tương lai
                            - ST: Cổ phiếu
                        symbolType:
                          type: string
                          example: ''
                          description: >-
                            Phân loại mã hợp đồng phái sinh theo thời gian đáo
                            hạn (áp dụng cho DERIVATIVE)

                            - VN30F1M: HĐTL chỉ số VN30 1 tháng

                            - VN30F2M: HĐTL chỉ số VN30 2 tháng

                            - VN30F1Q: HĐTL chỉ số VN30 1 quý

                            - VN30F2Q: HĐTL chỉ số VN30 2 quý
                        listedDate:
                          type: string
                          example: '2020-12-09'
                          description: Ngày niêm yết
                        shortName:
                          type: string
                          example: Ngân hàng Á Châu
                          description: Tên viết tắt của tổ chức phát hành
                        name:
                          type: string
                          example: Ngân hàng TMCP Á Châu
                          description: Tên đầy đủ của tổ chức phát hành
                        indexName:
                          type: array
                          example:
                            - VN100
                          items:
                            type: string
                            example: VN100
                            description: ''
                          description: Danh sách chỉ số mà mã chứng khoán thuộc về (nếu có)
                    description: Danh sách thông tin mã chứng khoán
                  total:
                    type: integer
                    format: int32
                    example: 2
                    description: Tổng số bản ghi
                  page:
                    type: integer
                    format: int32
                    example: 1
                    description: Trang hiện tại (bắt đầu từ 1)
                  pageSize:
                    type: integer
                    format: int32
                    example: 100
                    description: Số bản ghi trên mỗi trang
              example:
                data:
                  - symbol: ACB
                    marketId: STO
                    securityGroupId: ST
                    symbolType: ''
                    listedDate: '2020-12-09'
                    shortName: Ngân hàng Á Châu
                    name: Ngân hàng TMCP Á Châu
                    indexName:
                      - VN100
                      - VN30
                  - symbol: DSE
                    marketId: STO
                    securityGroupId: ST
                    symbolType: ''
                    listedDate: '2024-07-01'
                    shortName: Chứng khoán DNSE
                    name: CTCP Chứng khoán DNSE
                    indexName:
                      - VN100
                  - symbol: HUT
                    marketId: STX
                    securityGroupId: ST
                    symbolType: ''
                    listedDate: '2008-04-11'
                    shortName: CTCP TASCO
                    name: CTCP Tasco
                    indexName:
                      - HNX30
                  - symbol: SHS
                    marketId: STX
                    securityGroupId: ST
                    symbolType: ''
                    listedDate: '2009-06-25'
                    shortName: Chứng khoán SG HN
                    name: CTCP Chứng khoán Sài Gòn - Hà Nội
                    indexName:
                      - HNX30
                  - symbol: SSI
                    marketId: STO
                    securityGroupId: ST
                    symbolType: ''
                    listedDate: '2007-10-29'
                    shortName: Chứng khoán SSI
                    name: CTCP Chứng khoán SSI
                    indexName:
                      - VN100
                      - VN30
                total: 5
                page: 1
                pageSize: 100
        '400':
          description: Yêu cầu không hợp lệ
          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
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 500
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-009
                    description: Mã lỗi
                  message:
                    type: string
                    example: Lỗi hệ thống
                    description: Thông điệp lỗi
              example:
                code: OA-009
                message: Lỗi hệ thống
                status: 500
      tags:
        - market-data
      description: >-
        Truy vấn danh sách thông tin cơ bản của các mã chứng khoán theo điều
        kiện lọc.
  /price/ohlc:
    get:
      summary: Lịch sử OHLC
      parameters:
        - name: symbol
          in: query
          required: true
          description: 'Mã chứng khoán '
          schema:
            type: string
          example: ACB
        - name: type
          in: query
          description: |-
            Loại thị trường
            - STOCK: Cổ phiếu
            - DERIVATIVE: Phái sinh
            - INDEX: Chỉ số thị trường
          schema:
            type: string
          example: STOCK
        - name: resolution
          in: query
          required: true
          description: |-
            Khung thời gian nến
            - 1,3,5,15,30,1h,1D,1W
          schema:
            type: string
          example: '15'
        - name: from
          in: query
          required: true
          description: Thời gian bắt đầu
          schema:
            type: integer
          example: 1773657310
        - name: to
          in: query
          required: true
          description: Thời gian kết thúc
          schema:
            type: integer
          example: 1773830110
        - 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: Thời gian thực hiện yêu cầu
          schema:
            type: string
          example: '{{date}}'
        - name: X-Signature
          in: header
          required: true
          description: Chữ ký xác thực yêu cầu
          schema:
            type: string
          example: '{{signature}}'
        - name: version
          in: header
          description: API version (YYYY-MM-DD)
          schema:
            type: string
          example: '2026-07-23'
      responses:
        '200':
          description: OK
          headers:
            Content-Length:
              schema:
                type: integer
              example: 450
            Date:
              schema:
                type: string
              example: Tue, 24 Mar 2026 03:01:24 GMT
            Vary:
              schema:
                type: string
              example: Origin
            X-Content-Type-Options:
              schema:
                type: string
              example: nosniff
            X-Frame-Options:
              schema:
                type: string
              example: SAMEORIGIN
            X-Ratelimit-Limit:
              schema:
                type: integer
              example: -1
            X-Ratelimit-Remaining:
              schema:
                type: integer
              example: 0
            X-Ratelimit-Reset:
              schema:
                type: integer
              example: 0
            X-Request-Id:
              schema:
                type: string
              example: 1DSZCcoZ9h5P6OTR0NgZwGUPw1C9lsEd
            X-Tyk-Api-Expires:
              schema:
                type: string
              example: Thu, 02 Jan 3000 15:04:00 UTC
            X-Xss-Protection:
              schema:
                type: string
              example: 1; mode=block
          content:
            application/json:
              schema:
                type: object
                description: Dữ liệu biểu đồ nến (OHLCV) theo từng khoảng thời gian.
                properties:
                  t:
                    type: array
                    description: >-
                      Danh sách thời gian của từng cây nến, định dạng Unix
                      Timestamp (giây).
                    items:
                      type: integer
                      format: int64
                      example: 1773715500
                  o:
                    type: array
                    description: Danh sách giá mở cửa (Open) tương ứng với từng cây nến.
                    items:
                      type: number
                      format: double
                      example: 23.8
                  h:
                    type: array
                    description: Danh sách giá cao nhất (High) tương ứng với từng cây nến.
                    items:
                      type: number
                      format: double
                      example: 23.9
                  l:
                    type: array
                    description: Danh sách giá thấp nhất (Low) tương ứng với từng cây nến.
                    items:
                      type: number
                      format: double
                      example: 23.7
                  c:
                    type: array
                    description: Danh sách giá đóng cửa (Close) tương ứng với từng cây nến.
                    items:
                      type: number
                      format: double
                      example: 23.75
                  v:
                    type: array
                    description: >-
                      Danh sách khối lượng giao dịch (Volume) tương ứng với từng
                      cây nến.
                    items:
                      type: integer
                      format: int64
                      example: 2530900
                  nextTime:
                    type: integer
                    format: int64
                    example: 0
                    description: >-
                      Mốc thời gian (Unix Timestamp, giây) của cây nến tiếp theo
                      khi dữ liệu hiện tại chưa đủ để đáp ứng yêu cầu. Giá trị 0
                      nếu không còn dữ liệu.
                required:
                  - t
                  - o
                  - h
                  - l
                  - c
                  - v
                  - nextTime
                example:
                  t:
                    - 1773715500
                    - 1773716400
                    - 1773800100
                  o:
                    - 23.8
                    - 23.75
                    - 23.75
                  h:
                    - 23.8
                    - 23.8
                    - 23.9
                  l:
                    - 23.7
                    - 23.7
                    - 23.7
                  c:
                    - 23.75
                    - 23.75
                    - 23.8
                  v:
                    - 2530900
                    - 514100
                    - 494000
                  nextTime: 0
              example:
                t:
                  - 1773715500
                  - 1773716400
                  - 1773800100
                  - 1773801000
                  - 1773801900
                  - 1773802800
                  - 1773803700
                  - 1773804600
                  - 1773805500
                  - 1773806400
                o:
                  - 23.8
                  - 23.75
                  - 23.75
                  - 23.85
                  - 23.8
                  - 23.85
                  - 23.9
                  - 23.75
                  - 23.8
                  - 23.8
                h:
                  - 23.8
                  - 23.8
                  - 23.9
                  - 23.9
                  - 23.85
                  - 23.9
                  - 23.9
                  - 23.85
                  - 23.8
                  - 23.8
                l:
                  - 23.7
                  - 23.7
                  - 23.7
                  - 23.8
                  - 23.75
                  - 23.8
                  - 23.7
                  - 23.75
                  - 23.7
                  - 23.75
                c:
                  - 23.75
                  - 23.75
                  - 23.8
                  - 23.85
                  - 23.8
                  - 23.9
                  - 23.85
                  - 23.75
                  - 23.75
                  - 23.75
                v:
                  - 2530900
                  - 514100
                  - 494000
                  - 344400
                  - 429000
                  - 315300
                  - 582100
                  - 205300
                  - 361300
                  - 3040800
                nextTime: 0
        '400':
          description: Yêu cầu không hợp lệ
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 400
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-003
                    description: Mã lỗi
                  message:
                    type: string
                    example: Thông tin nhập không hợp lệ
                    description: Thông điệp lỗi
              example:
                code: OA-003
                message: Thông tin nhập không hợp lệ
                status: 400
        '500':
          description: Lỗi hệ thống
          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
      tags:
        - market-data
      description: >-
        Truy vấn thông tin lịch sử nến (open, high, low, close, volume) cho Cổ
        phiếu, Phái sinh và Chỉ số thị trường theo khung thời gian và khoảng
        thời gian cụ thể.
  /price/{symbol}/trades:
    get:
      summary: Lịch sử khớp lệnh
      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: from
          in: query
          required: true
          description: Thời gian bắt đầu (timestamp)
          schema:
            type: integer
          example: 1785727927
        - name: to
          in: query
          required: true
          description: Thời gian kết thúc (timestamp) (không vượt quá 1 ngày)
          schema:
            type: integer
          example: 1785814327
        - name: limit
          in: query
          schema:
            type: integer
          example: 100
        - 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: Thời gian thực hiện yêu cầu
          schema:
            type: string
          example: '{{date}}'
        - name: X-Signature
          in: header
          required: true
          description: Chữ ký xác thực yêu cầu
          schema:
            type: string
          example: '{{signature}}'
        - name: version
          in: header
          description: API version (YYYY-MM-DD)
          schema:
            type: string
          example: '2026-07-23'
      responses:
        '200':
          description: OK
          headers:
            Content-Length:
              schema:
                type: integer
              example: 40116
            Date:
              schema:
                type: string
              example: Tue, 24 Mar 2026 06:03:55 GMT
            Vary:
              schema:
                type: string
              example: Origin
            X-Ratelimit-Limit:
              schema:
                type: integer
              example: 1000
            X-Ratelimit-Remaining:
              schema:
                type: integer
              example: 995
            X-Ratelimit-Reset:
              schema:
                type: integer
              example: 1774339435
            X-Tyk-Api-Expires:
              schema:
                type: string
              example: Thu, 02 Jan 3000 15:04:00 UTC
          content:
            application/json:
              schema:
                type: object
                properties:
                  trades:
                    type: array
                    description: Danh sách giao dịch khớp lệnh
                    example:
                      - marketId: STO
                        boardId: G1
                        isin: VN000000HPG4
                        symbol: HPG
                        matchPrice: 94.1
                        matchQtty: 10
                        side: BUY
                        avgPrice: 87.872
                        totalVolumeTraded: 12070
                        grossTradeAmount: 10.60617
                        highestPrice: 94.1
                        lowestPrice: 87.6
                        openPrice: 87.6
                        time: '2026-08-04 10:29:51.070'
                    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)
                        isin:
                          type: string
                          example: VN000000HPG4
                          description: Mã định danh quốc tế (ISIN) của chứng khoán
                        symbol:
                          type: string
                          example: HPG
                          description: Mã chứng khoán
                        matchPrice:
                          type: number
                          format: double
                          example: 94.1
                          description: Giá khớp gần nhất
                        matchQtty:
                          type: integer
                          format: int32
                          example: 10
                          description: Khối lượng khớp gần nhất
                        side:
                          type: string
                          example: BUY
                          description: >-
                            Chiều giao dịch. Giá trị: BUY (Mu chủ động), SELL
                            (Bán chủ động), UNSPECIFIED (Không xác định)
                        avgPrice:
                          type: number
                          format: double
                          example: 87.872
                          description: Giá khớp trung bình
                        totalVolumeTraded:
                          type: integer
                          format: int32
                          example: 12070
                          description: Tổng khối lượng giao dịch trong ngày
                        grossTradeAmount:
                          type: number
                          format: double
                          example: 10.60617
                          description: Tổng giá trị giao dịch trong ngày
                        highestPrice:
                          type: number
                          format: double
                          example: 94.1
                          description: Giá cao nhất trong ngày
                        lowestPrice:
                          type: number
                          format: double
                          example: 87.6
                          description: Giá thấp nhất trong ngày
                        openPrice:
                          type: number
                          format: double
                          example: 87.6
                          description: Giá mở cửa
                        time:
                          type: string
                          example: '2026-08-04 10:29:51.070'
                          description: >-
                            Thời gian ghi nhận. Định dạng: YYYY-MM-DD
                            HH:mm:ss.SSS (GMT+7)
                  nextPageToken:
                    type: string
                    example: NTkzMDgyMThfMjAyNi0wOC0wNFQwMjoxNjozNy4zNlo=
                    description: >-
                      Token dùng để lấy trang dữ liệu tiếp theo. Không có hoặc
                      rỗng nếu không còn dữ liệu
              example:
                trades:
                  - marketId: STO
                    boardId: G1
                    isin: VN000000HPG4
                    symbol: HPG
                    matchPrice: 87.6
                    matchQtty: 30
                    side: BUY
                    avgPrice: 87.876
                    totalVolumeTraded: 12160
                    grossTradeAmount: 10.68574
                    highestPrice: 94.1
                    lowestPrice: 87.6
                    openPrice: 87.6
                    time: '2026-08-04 11:19:39.855'
                  - marketId: STO
                    boardId: G1
                    isin: VN000000HPG4
                    symbol: HPG
                    matchPrice: 87.6
                    matchQtty: 20
                    side: BUY
                    avgPrice: 87.877
                    totalVolumeTraded: 12130
                    grossTradeAmount: 10.65946
                    highestPrice: 94.1
                    lowestPrice: 87.6
                    openPrice: 87.6
                    time: '2026-08-04 11:19:39.854'
                  - marketId: STO
                    boardId: G1
                    isin: VN000000HPG4
                    symbol: HPG
                    matchPrice: 87.6
                    matchQtty: 10
                    side: SELL
                    avgPrice: 87.877
                    totalVolumeTraded: 12110
                    grossTradeAmount: 10.64194
                    highestPrice: 94.1
                    lowestPrice: 87.6
                    openPrice: 87.6
                    time: '2026-08-04 11:01:41.729'
                  - marketId: STO
                    boardId: G1
                    isin: VN000000HPG4
                    symbol: HPG
                    matchPrice: 88
                    matchQtty: 20
                    side: SELL
                    avgPrice: 87.878
                    totalVolumeTraded: 12100
                    grossTradeAmount: 10.63318
                    highestPrice: 94.1
                    lowestPrice: 87.6
                    openPrice: 87.6
                    time: '2026-08-04 11:01:41.729'
                  - marketId: STO
                    boardId: G1
                    isin: VN000000HPG4
                    symbol: HPG
                    matchPrice: 94.1
                    matchQtty: 10
                    side: UNSPECIFIED
                    avgPrice: 87.877
                    totalVolumeTraded: 12080
                    grossTradeAmount: 10.61558
                    highestPrice: 94.1
                    lowestPrice: 87.6
                    openPrice: 87.6
                    time: '2026-08-04 10:50:52.615'
                  - marketId: STO
                    boardId: G1
                    isin: VN000000HPG4
                    symbol: HPG
                    matchPrice: 94.1
                    matchQtty: 10
                    side: BUY
                    avgPrice: 87.872
                    totalVolumeTraded: 12070
                    grossTradeAmount: 10.60617
                    highestPrice: 94.1
                    lowestPrice: 87.6
                    openPrice: 87.6
                    time: '2026-08-04 10:29:51.070'
                  - marketId: STO
                    boardId: G1
                    isin: VN000000HPG4
                    symbol: HPG
                    matchPrice: 94.1
                    matchQtty: 100
                    side: BUY
                    avgPrice: 87.867
                    totalVolumeTraded: 12060
                    grossTradeAmount: 10.59676
                    highestPrice: 94.1
                    lowestPrice: 87.6
                    openPrice: 87.6
                    time: '2026-08-04 09:53:37.234'
                  - marketId: STO
                    boardId: G1
                    isin: VN000000HPG4
                    symbol: HPG
                    matchPrice: 94.1
                    matchQtty: 10
                    side: BUY
                    avgPrice: 87.815
                    totalVolumeTraded: 11960
                    grossTradeAmount: 10.50266
                    highestPrice: 94.1
                    lowestPrice: 87.6
                    openPrice: 87.6
                    time: '2026-08-04 09:52:40.863'
                  - marketId: STO
                    boardId: G1
                    isin: VN000000HPG4
                    symbol: HPG
                    matchPrice: 94.1
                    matchQtty: 100
                    side: BUY
                    avgPrice: 87.81
                    totalVolumeTraded: 11950
                    grossTradeAmount: 10.49325
                    highestPrice: 94.1
                    lowestPrice: 87.6
                    openPrice: 87.6
                    time: '2026-08-04 09:45:50.879'
                  - marketId: STO
                    boardId: G1
                    isin: VN000000HPG4
                    symbol: HPG
                    matchPrice: 88
                    matchQtty: 10
                    side: SELL
                    avgPrice: 87.757
                    totalVolumeTraded: 11850
                    grossTradeAmount: 10.39915
                    highestPrice: 94.1
                    lowestPrice: 87.6
                    openPrice: 87.6
                    time: '2026-08-04 09:45:27.028'
                  - marketId: STO
                    boardId: G1
                    isin: VN000000HPG4
                    symbol: HPG
                    matchPrice: 94.1
                    matchQtty: 20
                    side: BUY
                    avgPrice: 87.756
                    totalVolumeTraded: 11840
                    grossTradeAmount: 10.39035
                    highestPrice: 94.1
                    lowestPrice: 87.6
                    openPrice: 87.6
                    time: '2026-08-04 09:43:20.216'
                  - marketId: STO
                    boardId: G1
                    isin: VN000000HPG4
                    symbol: HPG
                    matchPrice: 94.1
                    matchQtty: 10
                    side: BUY
                    avgPrice: 87.746
                    totalVolumeTraded: 11820
                    grossTradeAmount: 10.37153
                    highestPrice: 94.1
                    lowestPrice: 87.6
                    openPrice: 87.6
                    time: '2026-08-04 09:43:16.440'
                  - marketId: STO
                    boardId: G1
                    isin: VN000000HPG4
                    symbol: HPG
                    matchPrice: 94.1
                    matchQtty: 10
                    side: BUY
                    avgPrice: 87.74
                    totalVolumeTraded: 11810
                    grossTradeAmount: 10.36212
                    highestPrice: 94.1
                    lowestPrice: 87.6
                    openPrice: 87.6
                    time: '2026-08-04 09:42:12.070'
                nextPageToken: null
        '400':
          description: Yêu cầu không hợp lệ
          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
          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
      tags:
        - market-data
      description: >-
        Truy vấn thông tin lịch sử khớp lệnh của mã chứng khoán theo bảng giao
        dịch và khoảng thời gian cụ thể.
    parameters:
      - name: symbol
        in: path
        required: true
        description: Mã chứng khoán
        schema:
          type: string
        example: HPG
  /price/{symbol}/trades/latest:
    get:
      summary: Dữ liệu khớp gần nhất
      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: 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: Thời gian thực hiện yêu cầu
          schema:
            type: string
          example: '{{date}}'
        - name: X-Signature
          in: header
          required: true
          description: Chữ ký xác thực yêu cầu
          schema:
            type: string
          example: '{{signature}}'
        - name: version
          in: header
          description: API version (YYYY-MM-DD)
          schema:
            type: string
          example: '2026-07-23'
      responses:
        '200':
          description: OK
          headers:
            Content-Length:
              schema:
                type: integer
              example: 423
            Date:
              schema:
                type: string
              example: Tue, 24 Mar 2026 03:07:04 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: 1774368830
            X-Tyk-Api-Expires:
              schema:
                type: string
              example: Thu, 02 Jan 3000 15:04:00 UTC
          content:
            application/json:
              schema:
                type: object
                description: Thông tinh giao dịch khớp lệnh.
                properties:
                  trades:
                    type: array
                    description: ''
                    example:
                      - marketId: STO
                        boardId: G1
                        isin: VN000000ACB8
                        symbol: ACB
                        matchPrice: 23.35
                        matchQtty: 20
                        side: SELL
                        avgPrice: 23.435
                        totalVolumeTraded: 427980
                        grossTradeAmount: 100.295515
                        highestPrice: 23.55
                        lowestPrice: 23.35
                        openPrice: 23.5
                        time: '2026-05-27 09:43:32.706'
                    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)
                        isin:
                          type: string
                          example: VN000000ACB8
                          description: Mã định danh quốc tế (ISIN) của chứng khoán.
                        symbol:
                          type: string
                          example: ACB
                          description: Mã chứng khoán
                        matchPrice:
                          type: number
                          format: double
                          example: 23.35
                          description: Giá khớp gần nhất
                        matchQtty:
                          type: integer
                          format: int32
                          example: 20
                          description: Khối lượng khớp gần nhất
                        side:
                          type: string
                          example: SELL
                          description: >-
                            Chiều giao dịch. Giá trị: BUY (Mu chủ động), SELL
                            (Bán chủ động), UNSPECIFIED (Không xác định)
                        avgPrice:
                          type: number
                          format: double
                          example: 23.435
                          description: Giá khớp trung bình
                        totalVolumeTraded:
                          type: integer
                          format: int32
                          example: 427980
                          description: Tổng khối lượng giao dịch trong ngày
                        grossTradeAmount:
                          type: number
                          format: double
                          example: 100.295515
                          description: Tổng giá trị giao dịch trong ngày
                        highestPrice:
                          type: number
                          format: double
                          example: 23.55
                          description: Giá cao nhất trong ngày
                        lowestPrice:
                          type: number
                          format: double
                          example: 23.35
                          description: Giá thấp nhất trong ngày
                        openPrice:
                          type: number
                          format: double
                          example: 23.5
                          description: Giá mở cửa.
                        time:
                          type: string
                          example: '2026-05-27 09:43:32.706'
                          description: >-
                            Thời gian ghi nhận. Định dạng: YYYY-MM-DD
                            HH:mm:ss.SSS (GMT+7)
              example:
                trades:
                  - marketId: STO
                    boardId: G1
                    isin: VN000000ACB8
                    symbol: ACB
                    matchPrice: 23.35
                    matchQtty: 20
                    side: SELL
                    avgPrice: 23.435
                    totalVolumeTraded: 427980
                    grossTradeAmount: 100.295515
                    highestPrice: 23.55
                    lowestPrice: 23.35
                    openPrice: 23.5
                    time: '2026-05-27 09:43:32.706'
        '400':
          description: Yêu cầu không hợp lệ
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 400
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-003
                    description: Mã lỗi
                  message:
                    type: string
                    example: Thông tin nhập không hợp lệ
                    description: Thông điệp lỗi
              example:
                code: OA-003
                message: Thông tin nhập không hợp lệ
                status: 400
        '500':
          description: Lỗi hệ thống
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 500
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-009
                    description: Mã lỗi
                  message:
                    type: string
                    example: Lỗi hệ thống
                    description: Thông điệp lỗi
              example:
                code: OA-009
                message: Lỗi hệ thống
                status: 500
      tags:
        - market-data
      description: Truy vấn thông tin giao dịch khớp lệnh gần nhất của mã chứng khoán.
    parameters:
      - name: symbol
        in: path
        required: true
        description: 'Mã chứng khoán '
        schema:
          type: string
        example: ACB
  /price/{symbol}/quotes:
    get:
      summary: Lịch sử bid/ask
      parameters:
        - name: boardId
          in: query
          required: true
          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: from
          in: query
          required: true
          description: Thời gian bắt đầu (timestamp)
          schema:
            type: string
          example: '1785727927'
        - name: to
          in: query
          required: true
          description: Thời gian kết thúc (timestamp) (không vượt quá 1 ngày)
          schema:
            type: string
          example: '1785735127'
        - name: limit
          in: query
          schema:
            type: integer
          example: 100
        - name: X-API-Key
          in: header
          required: false
          description: API Key được cấp khi đăng ký dịch vụ
          deprecated: false
          schema: {}
          example: '{{apiKey}}'
        - name: X-Aux-Date
          in: header
          required: false
          description: Thời gian thực hiện yêu cầu
          deprecated: false
          schema: {}
          example: '{{date}}'
        - name: X-Signature
          in: header
          required: false
          description: Chữ ký xác thực yêu cầu
          deprecated: false
          schema: {}
          example: '{{signature}}'
        - name: version
          in: header
          required: false
          description: API version (YYYY-MM-DD)
          deprecated: false
          schema: {}
          example: '2026-05-07'
      responses:
        '200':
          description: OK
          headers:
            Content-Length:
              schema:
                type: integer
              example: 43686
            Date:
              schema:
                type: string
              example: Wed, 27 May 2026 08:19:16 GMT
            Vary:
              schema:
                type: string
              example: Origin
            X-Ratelimit-Limit:
              schema:
                type: integer
              example: 10000
            X-Ratelimit-Remaining:
              schema:
                type: integer
              example: 9999
            X-Ratelimit-Reset:
              schema:
                type: integer
              example: 1779956355
            X-Tyk-Api-Expires:
              schema:
                type: string
              example: Thu, 02 Jan 3000 15:04:00 UTC
          content:
            application/json:
              schema:
                type: object
                description: >-
                  Danh sách dữ liệu sổ lệnh (Market Depth) cùng thông tin phân
                  trang.
                properties:
                  quotes:
                    type: array
                    description: Danh sách dữ liệu sổ lệnh của mã chứng khoán
                    example:
                      - marketId: STO
                        boardId: G1
                        isin: VN000000ACB8
                        symbol: ACB
                        bid:
                          - price: 101
                            quantity: 10
                          - price: 100
                            quantity: 50
                          - price: 99.5
                            quantity: 10
                        offer:
                          - price: 106
                            quantity: 4870
                          - price: 106.1
                            quantity: 500
                          - price: 110
                            quantity: 30
                        totalOfferQtty: 0
                        totalBidQtty: 0
                        time: '2026-08-03 10:59:12.336'
                    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)
                        isin:
                          type: string
                          example: VN000000ACB8
                          description: Mã định danh quốc tế (ISIN) của chứng khoán.
                        symbol:
                          type: string
                          example: ACB
                          description: Mã chứng khoán
                        bid:
                          type: array
                          description: Danh sách các mức giá chào mua
                          example:
                            - price: 101
                              quantity: 10
                          items:
                            type: object
                            properties:
                              price:
                                type: number
                                format: double
                                example: 101
                                description: Giá đặt mua
                              quantity:
                                type: integer
                                format: int32
                                example: 10
                                description: Khối lượng đặt mua tại mức giá tương ứng
                        offer:
                          type: array
                          description: Danh sách các mức giá chào bán
                          example:
                            - price: 106
                              quantity: 4870
                          items:
                            type: object
                            properties:
                              price:
                                type: number
                                format: double
                                example: 106
                                description: Giá đặt bán
                              quantity:
                                type: integer
                                format: int32
                                example: 4870
                                description: Khối lượng đặt bán tại mức giá tương ứng
                        totalOfferQtty:
                          type: integer
                          format: int32
                          example: 0
                          description: Tổng khối lượng dư bán
                        totalBidQtty:
                          type: integer
                          format: int32
                          example: 0
                          description: Tổng khối lượng dư mua
                        time:
                          type: string
                          example: '2026-08-03 10:59:12.336'
                          description: >-
                            Thời gian ghi nhận. Định dạng: YYYY-MM-DD
                            HH:mm:ss.SSS (GMT+7)
                  nextPageToken:
                    type: string
                    example: MTM2NDYxOV8yMDI2LTA1LTI2VDA0OjI3OjQyLjQyNFo=
                    description: >-
                      Token dùng để lấy trang dữ liệu tiếp theo. Không có hoặc
                      rỗng nếu không còn dữ liệu
              example:
                quotes:
                  - marketId: STO
                    boardId: G1
                    isin: VN000000ACB8
                    symbol: ACB
                    bid:
                      - price: 101
                        quantity: 10
                      - price: 100
                        quantity: 50
                      - price: 99.5
                        quantity: 10
                    offer:
                      - price: 106
                        quantity: 4870
                      - price: 106.1
                        quantity: 500
                      - price: 110
                        quantity: 30
                    totalOfferQtty: 0
                    totalBidQtty: 0
                    time: '2026-08-03 10:59:12.336'
                  - marketId: STO
                    boardId: G1
                    isin: VN000000ACB8
                    symbol: ACB
                    bid:
                      - price: 100
                        quantity: 50
                      - price: 99.5
                        quantity: 10
                    offer:
                      - price: 106
                        quantity: 4870
                      - price: 106.1
                        quantity: 500
                      - price: 110
                        quantity: 30
                    totalOfferQtty: 0
                    totalBidQtty: 0
                    time: '2026-08-03 10:58:30.105'
                  - marketId: STO
                    boardId: G1
                    isin: VN000000ACB8
                    symbol: ACB
                    bid:
                      - price: 100
                        quantity: 50
                    offer:
                      - price: 106
                        quantity: 4870
                      - price: 106.1
                        quantity: 500
                      - price: 110
                        quantity: 30
                    totalOfferQtty: 0
                    totalBidQtty: 0
                    time: '2026-08-03 10:49:10.822'
                  - marketId: STO
                    boardId: G1
                    isin: VN000000ACB8
                    symbol: ACB
                    bid:
                      - price: 100
                        quantity: 50
                    offer:
                      - price: 106
                        quantity: 4880
                      - price: 106.1
                        quantity: 500
                      - price: 110
                        quantity: 30
                    totalOfferQtty: 0
                    totalBidQtty: 0
                    time: '2026-08-03 10:39:24.198'
                nextPageToken: MTM2NDYxOV8yMDI2LTA1LTI2VDA0OjI3OjQyLjQyNFo=
        '400':
          description: Yêu cầu không hợp lệ
          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
          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
      tags:
        - market-data
      description: >-
        Truy vấn thông tin lịch sử bid/ask độ sâu thị trường của mã chứng khoán
        theo bảng giao dịch và khoảng thời gian cụ thể.
    parameters:
      - name: symbol
        in: path
        required: true
        description: Mã chứng khoán
        schema:
          type: string
        example: ACB
  /price/{symbol}/quotes/latest:
    get:
      summary: Dữ liệu bid/ask gần nhất
      parameters:
        - name: boardId
          in: query
          required: false
          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)
          deprecated: false
          schema: {}
          example: G1
        - 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: Thời gian thực hiện yêu cầu
          schema:
            type: string
          example: '{{date}}'
        - name: X-Signature
          in: header
          required: true
          description: Chữ ký xác thực yêu cầu
          schema:
            type: string
          example: '{{signature}}'
        - name: version
          in: header
          description: API version (YYYY-MM-DD)
          schema:
            type: string
          example: '2026-07-23'
      responses:
        '200':
          description: OK
          headers:
            Content-Length:
              schema:
                type: integer
              example: 454
            Date:
              schema:
                type: string
              example: Wed, 27 May 2026 08:11:15 GMT
            Vary:
              schema:
                type: string
              example: Origin
            X-Ratelimit-Limit:
              schema:
                type: integer
              example: 10000
            X-Ratelimit-Remaining:
              schema:
                type: integer
              example: 9998
            X-Ratelimit-Reset:
              schema:
                type: integer
              example: 1779955862
            X-Tyk-Api-Expires:
              schema:
                type: string
              example: Thu, 02 Jan 3000 15:04:00 UTC
          content:
            application/json:
              schema:
                type: object
                description: Dữ liệu sổ lệnh (Market Depth) gần nhất
                properties:
                  quotes:
                    type: array
                    description: Dữ liệu sổ lệnh của mã chứng khoán
                    example:
                      - marketId: STO
                        boardId: G1
                        isin: VN000000ACB8
                        symbol: ACB
                        bid:
                          - price: 24.55
                            quantity: 60590
                          - price: 24.5
                            quantity: 30250
                          - price: 24.45
                            quantity: 19600
                        offer:
                          - price: 24.6
                            quantity: 10450
                          - price: 24.65
                            quantity: 8450
                          - price: 24.7
                            quantity: 23080
                        totalOfferQtty: 0
                        totalBidQtty: 0
                        time: '2026-05-27 09:49:01.001'
                    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)
                        isin:
                          type: string
                          example: VN000000ACB8
                          description: Mã định danh quốc tế (ISIN) của chứng khoán.
                        symbol:
                          type: string
                          example: ACB
                          description: Mã chứng khoán
                        bid:
                          type: array
                          description: Danh sách các mức giá chào mua
                          example:
                            - price: 24.55
                              quantity: 60590
                          items:
                            type: object
                            properties:
                              price:
                                type: number
                                format: double
                                example: 24.55
                                description: Giá đặt mua
                              quantity:
                                type: integer
                                format: int32
                                example: 60590
                                description: Khối lượng đặt mua tại mức giá tương ứng
                        offer:
                          type: array
                          description: Danh sách các mức giá chào bán
                          example:
                            - price: 24.6
                              quantity: 10450
                          items:
                            type: object
                            properties:
                              price:
                                type: number
                                format: double
                                example: 24.6
                                description: Giá đặt bán
                              quantity:
                                type: integer
                                format: int32
                                example: 10450
                                description: Khối lượng đặt bán tại mức giá tương ứng
                        totalOfferQtty:
                          type: integer
                          format: int32
                          example: 0
                          description: Tổng khối lượng dư bán
                        totalBidQtty:
                          type: integer
                          format: int32
                          example: 0
                          description: Tổng khối lượng dư mua
                        time:
                          type: string
                          example: '2026-05-27 09:49:01.001'
                          description: >-
                            Thời gian ghi nhận. Định dạng: YYYY-MM-DD
                            HH:mm:ss.SSS (GMT+7)
              example:
                quotes:
                  - marketId: STO
                    boardId: G1
                    isin: VN000000ACB8
                    symbol: ACB
                    bid:
                      - price: 24.55
                        quantity: 60590
                      - price: 24.5
                        quantity: 30250
                      - price: 24.45
                        quantity: 19600
                    offer:
                      - price: 24.6
                        quantity: 10450
                      - price: 24.65
                        quantity: 8450
                      - price: 24.7
                        quantity: 23080
                    totalOfferQtty: 0
                    totalBidQtty: 0
                    time: '2026-05-27 09:49:01.001'
        '400':
          description: Yêu cầu không hợp lệ
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 400
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-003
                    description: Mã lỗi
                  message:
                    type: string
                    example: Thông tin nhập không hợp lệ
                    description: Thông điệp lỗi
              example:
                code: OA-003
                message: Thông tin nhập không hợp lệ
                status: 400
        '500':
          description: Lỗi hệ thống
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 500
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-009
                    description: Mã lỗi
                  message:
                    type: string
                    example: Lỗi hệ thống
                    description: Thông điệp lỗi
              example:
                code: OA-009
                message: Lỗi hệ thống
                status: 500
      tags:
        - market-data
      description: Truy vấn thông tin dữ liệu bid/ask gần nhất của mã chứng khoán.
    parameters:
      - name: symbol
        in: path
        required: true
        description: Mã chứng khoán
        deprecated: false
        schema: {}
        example: ACB
  /price/{symbol}/foreign-trading:
    get:
      summary: Dữ liệu NĐT nước ngoà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: from
          in: query
          required: true
          description: Thời gian bắt đầu (timestamp)
          schema:
            type: integer
          example: 1785729607
        - name: to
          in: query
          required: true
          description: Thời gian kết thúc (timestamp) (không vượt quá 1 ngày)
          schema:
            type: integer
          example: 1785731407
        - name: limit
          in: query
          schema:
            type: integer
          example: 100
        - name: order
          in: query
          schema:
            type: string
          example: DESC
        - 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: Thời gian thực hiện yêu cầu
          schema:
            type: string
          example: '{{date}}'
        - name: X-Signature
          in: header
          required: true
          description: Chữ ký xác thực yêu cầu
          schema:
            type: string
          example: '{{signature}}'
        - name: version
          in: header
          description: API version (YYYY-MM-DD)
          schema:
            type: string
          example: '2026-07-23'
      responses:
        '200':
          description: OK
          headers:
            Content-Length:
              schema:
                type: integer
              example: 54238
            Date:
              schema:
                type: string
              example: Mon, 22 Jun 2026 10:00:01 GMT
            Vary:
              schema:
                type: string
              example: Origin
            X-Ratelimit-Limit:
              schema:
                type: integer
              example: 10000
            X-Ratelimit-Remaining:
              schema:
                type: integer
              example: 9999
            X-Ratelimit-Reset:
              schema:
                type: integer
              example: 1782208801
            X-Tyk-Api-Expires:
              schema:
                type: string
              example: Thu, 02 Jan 3000 15:04:00 UTC
          content:
            application/json:
              schema:
                type: object
                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:
                      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)
                        symbol:
                          type: string
                          example: ACB
                          description: Mã chứng khoán
                        tradingSessionId:
                          type: string
                          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).
                  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.
              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':
          description: Yêu cầu không hợp lệ
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 400
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-003
                    description: Mã lỗi
                  message:
                    type: string
                    example: Thông tin nhập không hợp lệ
                    description: Thông điệp lỗi
              example:
                code: OA-003
                message: Thông tin nhập không hợp lệ
                status: 400
        '500':
          description: Lỗi hệ thống
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 500
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-009
                    description: Mã lỗi
                  message:
                    type: string
                    example: Lỗi hệ thống
                    description: Thông điệp lỗi
              example:
                code: OA-009
                message: Lỗi hệ thống
                status: 500
      tags:
        - market-data
      description: Truy vấn thông tin dữ liệu nhà đầu tư nước ngoài.
    parameters:
      - name: symbol
        in: path
        required: true
        description: Mã chứng khoán
        schema:
          type: string
        example: ACB
  /market/working-dates:
    get:
      summary: Ngày làm việc
      parameters:
        - 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: API version (YYYY-MM-DD)
          schema:
            type: string
          example: '2026-07-23'
      responses:
        '200':
          description: OK
          headers:
            Content-Length:
              schema:
                type: integer
              example: 4670
            Date:
              schema:
                type: string
              example: Thu, 16 Apr 2026 06:56:23 GMT
            Vary:
              schema:
                type: string
              example: Authorization
            X-Ratelimit-Limit:
              schema:
                type: integer
              example: 1000
            X-Ratelimit-Remaining:
              schema:
                type: integer
              example: 995
            X-Ratelimit-Reset:
              schema:
                type: integer
              example: 1776334437
            X-Tyk-Api-Expires:
              schema:
                type: string
              example: Thu, 02 Jan 3000 15:04:00 UTC
          content:
            application/json:
              schema:
                type: object
                properties:
                  workingDates:
                    type: array
                    items:
                      type: string
                      format: date
              example:
                workingDates:
                  - '2026-04-16'
                  - '2026-04-17'
                  - '2026-04-20'
                  - '2026-04-21'
                  - '2026-04-22'
                  - '2026-04-23'
                  - '2026-04-24'
                  - '2026-04-27'
                  - '2026-04-28'
                  - '2026-04-29'
                  - '2026-05-04'
                  - '2026-05-05'
                  - '2026-05-06'
                  - '2026-05-07'
                  - '2026-05-08'
                  - '2026-05-11'
                  - '2026-05-12'
                  - '2026-05-13'
                  - '2026-05-14'
                  - '2026-05-15'
                  - '2026-05-18'
                  - '2026-05-19'
                  - '2026-05-20'
                  - '2026-05-21'
                  - '2026-05-22'
                  - '2026-05-25'
                  - '2026-05-26'
                  - '2026-05-27'
                  - '2026-05-28'
                  - '2026-05-29'
                  - '2026-06-01'
                  - '2026-06-02'
                  - '2026-06-03'
                  - '2026-06-04'
                  - '2026-06-05'
                  - '2026-06-08'
                  - '2026-06-09'
                  - '2026-06-10'
                  - '2026-06-11'
                  - '2026-06-12'
                  - '2026-06-15'
                  - '2026-06-16'
                  - '2026-06-17'
                  - '2026-06-18'
                  - '2026-06-19'
                  - '2026-06-22'
                  - '2026-06-23'
                  - '2026-06-24'
                  - '2026-06-25'
                  - '2026-06-26'
                  - '2026-06-29'
                  - '2026-06-30'
                  - '2026-07-01'
                  - '2026-07-02'
                  - '2026-07-03'
                  - '2026-07-06'
                  - '2026-07-07'
                  - '2026-07-08'
                  - '2026-07-09'
                  - '2026-07-10'
                  - '2026-07-13'
                  - '2026-07-14'
                  - '2026-07-15'
                  - '2026-07-16'
                  - '2026-07-17'
                  - '2026-07-20'
                  - '2026-07-21'
                  - '2026-07-22'
                  - '2026-07-23'
                  - '2026-07-24'
                  - '2026-07-27'
                  - '2026-07-28'
                  - '2026-07-29'
                  - '2026-07-30'
                  - '2026-07-31'
                  - '2026-08-03'
                  - '2026-08-04'
                  - '2026-08-05'
                  - '2026-08-06'
                  - '2026-08-07'
                  - '2026-08-10'
                  - '2026-08-11'
                  - '2026-08-12'
                  - '2026-08-13'
                  - '2026-08-14'
                  - '2026-08-17'
                  - '2026-08-18'
                  - '2026-08-19'
                  - '2026-08-20'
                  - '2026-08-21'
                  - '2026-08-24'
                  - '2026-08-25'
                  - '2026-08-26'
                  - '2026-08-27'
                  - '2026-08-28'
                  - '2026-08-31'
                  - '2026-09-01'
                  - '2026-09-03'
                  - '2026-09-04'
                  - '2026-09-07'
                  - '2026-09-08'
                  - '2026-09-09'
                  - '2026-09-10'
                  - '2026-09-11'
                  - '2026-09-14'
                  - '2026-09-15'
                  - '2026-09-16'
                  - '2026-09-17'
                  - '2026-09-18'
                  - '2026-09-21'
                  - '2026-09-22'
                  - '2026-09-23'
                  - '2026-09-24'
                  - '2026-09-25'
                  - '2026-09-28'
                  - '2026-09-29'
                  - '2026-09-30'
                  - '2026-10-01'
                  - '2026-10-02'
                  - '2026-10-05'
                  - '2026-10-06'
                  - '2026-10-07'
                  - '2026-10-08'
                  - '2026-10-09'
                  - '2026-10-12'
                  - '2026-10-13'
                  - '2026-10-14'
                  - '2026-10-15'
                  - '2026-10-16'
                  - '2026-10-19'
                  - '2026-10-20'
                  - '2026-10-21'
                  - '2026-10-22'
                  - '2026-10-23'
                  - '2026-10-26'
                  - '2026-10-27'
                  - '2026-10-28'
                  - '2026-10-29'
                  - '2026-10-30'
                  - '2026-11-02'
                  - '2026-11-03'
                  - '2026-11-04'
                  - '2026-11-05'
                  - '2026-11-06'
                  - '2026-11-09'
                  - '2026-11-10'
                  - '2026-11-11'
                  - '2026-11-12'
                  - '2026-11-13'
                  - '2026-11-16'
                  - '2026-11-17'
                  - '2026-11-18'
                  - '2026-11-19'
                  - '2026-11-20'
                  - '2026-11-23'
                  - '2026-11-24'
                  - '2026-11-25'
                  - '2026-11-26'
                  - '2026-11-27'
                  - '2026-11-30'
                  - '2026-12-01'
                  - '2026-12-02'
                  - '2026-12-03'
                  - '2026-12-04'
                  - '2026-12-07'
                  - '2026-12-08'
                  - '2026-12-09'
                  - '2026-12-10'
                  - '2026-12-11'
                  - '2026-12-14'
                  - '2026-12-15'
                  - '2026-12-16'
                  - '2026-12-17'
                  - '2026-12-18'
                  - '2026-12-21'
                  - '2026-12-22'
                  - '2026-12-23'
                  - '2026-12-24'
                  - '2026-12-25'
                  - '2026-12-28'
                  - '2026-12-29'
                  - '2026-12-30'
                  - '2026-12-31'
                  - '2027-01-04'
                  - '2027-01-05'
                  - '2027-01-06'
                  - '2027-01-07'
                  - '2027-01-08'
                  - '2027-01-11'
                  - '2027-01-12'
                  - '2027-01-13'
                  - '2027-01-14'
                  - '2027-01-15'
                  - '2027-01-18'
                  - '2027-01-19'
                  - '2027-01-20'
                  - '2027-01-21'
                  - '2027-01-22'
                  - '2027-01-25'
                  - '2027-01-26'
                  - '2027-01-27'
                  - '2027-01-28'
                  - '2027-01-29'
                  - '2027-02-01'
                  - '2027-02-02'
                  - '2027-02-03'
                  - '2027-02-04'
                  - '2027-02-05'
                  - '2027-02-08'
                  - '2027-02-09'
                  - '2027-02-10'
                  - '2027-02-11'
                  - '2027-02-12'
                  - '2027-02-15'
                  - '2027-02-16'
                  - '2027-02-17'
                  - '2027-02-18'
                  - '2027-02-19'
                  - '2027-02-22'
                  - '2027-02-23'
                  - '2027-02-24'
                  - '2027-02-25'
                  - '2027-02-26'
                  - '2027-03-01'
                  - '2027-03-02'
                  - '2027-03-03'
                  - '2027-03-04'
                  - '2027-03-05'
                  - '2027-03-08'
                  - '2027-03-09'
                  - '2027-03-10'
                  - '2027-03-11'
                  - '2027-03-12'
                  - '2027-03-15'
                  - '2027-03-16'
                  - '2027-03-17'
                  - '2027-03-18'
                  - '2027-03-19'
                  - '2027-03-22'
                  - '2027-03-23'
                  - '2027-03-24'
                  - '2027-03-25'
                  - '2027-03-26'
                  - '2027-03-29'
                  - '2027-03-30'
                  - '2027-03-31'
                  - '2027-04-01'
                  - '2027-04-02'
                  - '2027-04-05'
                  - '2027-04-06'
                  - '2027-04-07'
                  - '2027-04-08'
                  - '2027-04-09'
                  - '2027-04-12'
                  - '2027-04-13'
                  - '2027-04-14'
                  - '2027-04-15'
                  - '2027-04-16'
        '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:
                  status:
                    type: integer
                    example: 500
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-009
                    description: Mã lỗi
                  message:
                    type: string
                    example: Lỗi hệ thống
                    description: Thông điệp lỗi
              example:
                code: OA-009
                message: Lỗi hệ thống
                status: 500
      tags:
        - market-data
      description: >-
        Truy vấn danh sách ngày làm việc (ngày giao dịch) của thị trường chứng
        khoán trong vòng 1 năm tính từ ngày hiện tại, đã loại trừ các ngày nghỉ
        lễ và cuối tuần.
  /market/trading-session:
    get:
      summary: Phiên giao dịch
      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
          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: API version (YYYY-MM-DD)
          schema:
            type: string
          example: '2026-07-23'
      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
                            - v99: Đó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 ghi nhận định dạng (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
      tags:
        - market-data
      description: Truy vấn thông tin phiên giao dịch hiện tại.
  /price/{symbol}/expected-price:
    get:
      summary: Giá dự khớp
      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
        - name: from
          in: query
          required: true
          description: Thời gian bắt đầu (timestamp)
          schema:
            type: string
        - name: to
          in: query
          required: true
          description: Thời gian kết thúc (timestamp) (không vượt quá 1 ngày)
          schema:
            type: string
        - name: limit
          in: query
          schema:
            type: integer
        - name: nextPageToken
          in: query
          schema:
            type: string
        - name: X-API-Key
          in: header
          required: true
          description: API Key được cấp khi đăng ký dịch vụ
          schema:
            type: string
        - name: X-Aux-Date
          in: header
          required: true
          description: Thời gian thực hiện yêu cầu
          schema:
            type: string
        - name: X-Signature
          in: header
          required: true
          description: Chữ ký xác thực yêu cầu
          schema:
            type: string
        - name: version
          in: header
          description: API version (YYYY-MM-DD)
          schema:
            type: string
            format: date
      responses:
        '200':
          description: OK
          headers:
            Content-Length:
              deprecated: false
              schema: {}
            Date:
              deprecated: false
              schema: {}
            Vary:
              deprecated: false
              schema: {}
            X-Ratelimit-Limit:
              deprecated: false
              schema: {}
            X-Ratelimit-Remaining:
              deprecated: false
              schema: {}
            X-Ratelimit-Reset:
              deprecated: false
              schema: {}
            X-Tyk-Api-Expires:
              deprecated: false
              schema: {}
          content:
            application/json:
              schema:
                type: object
                description: Danh sách dữ liệu giá khớp dự kiến cùng thông tin phân trang.
                properties:
                  expectedPrices:
                    type: array
                    description: Danh sách dữ liệu giá khớp dự kiến của mã chứng khoán.
                    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)
                        isin:
                          type: string
                          example: VN000000HPG4
                          description: Mã định danh quốc tế (ISIN) của chứng khoán.
                        symbol:
                          type: string
                          example: HPG
                          description: Mã chứng khoán
                        closePrice:
                          type: number
                          format: double
                          example: 0
                          description: Giá đóng cửa
                        expectedTradePrice:
                          type: number
                          format: double
                          example: 94.1
                          description: Giá khớp dự kiến
                        expectedTradeQuantity:
                          type: integer
                          format: int32
                          example: 2000
                          description: Khối lượng khớp dự kiến
                        time:
                          type: string
                          example: '2026-08-03 14:40:05.148'
                          description: >-
                            Thời gian ghi nhận. Định dạng: YYYY-MM-DD
                            HH:mm:ss.SSS (GMT+7).
                  nextPageToken:
                    type: string
                    example: null
                    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.
                    nullable: true
        '400':
          description: Yêu cầu không hợp lệ
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 400
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-003
                    description: Mã lỗi
                  message:
                    type: string
                    example: Thông tin nhập không hợp lệ
                    description: Thông điệp lỗi
              example:
                status: 400
                code: OA-003
                message: Thông tin nhập không hợp lệ
        '500':
          description: Lỗi hệ thống
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 500
                    description: Mã HTTP
                    format: int32
                  code:
                    type: string
                    example: OA-009
                    description: Mã lỗi
                  message:
                    type: string
                    example: Lỗi hệ thống
                    description: Thông điệp lỗi
              example:
                code: OA-009
                message: Lỗi hệ thống
                status: 500
      tags:
        - market-data
    parameters:
      - name: symbol
        in: path
        required: true
        description: Mã chứng khoán
        schema:
          type: string
        example: HPG