> ## Documentation Index
> Fetch the complete documentation index at: https://hoalulab.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Sổ lệnh

> Lấy lịch sử sổ lệnh theo tài khoản và bộ lọc.



## OpenAPI

````yaml /vi/openapi/ssi.2026-08-21.openapi.yaml get /api/v3/trading/orderBook
openapi: 3.1.2
info:
  title: SSI FastConnect Open API
  version: 3.0.0
servers:
  - url: https://api.ssi.com.vn
    description: Production
security:
  - SsiBearerAuth: []
tags:
  - name: authentication
    description: Xác thực và quản lý token.
    x-group: Xác thực
  - name: account
    description: Thông tin tài khoản giao dịch.
    x-group: Tài khoản
  - name: market-data
    description: Dữ liệu thị trường.
    x-group: Dữ liệu thị trường
  - name: trading
    description: Giao dịch và quản lý lệnh.
    x-group: Giao dịch
  - name: conditional-orders
    description: Lệnh điều kiện.
    x-group: Lệnh điều kiện
paths:
  /api/v3/trading/orderBook:
    get:
      tags:
        - trading
      summary: Sổ lệnh
      description: Lấy lịch sử sổ lệnh theo tài khoản và bộ lọc.
      operationId: getOrderBook
      parameters:
        - name: accountNo
          in: query
          description: Tài khoản giao dịch cần lấy lịch sử sổ lệnh.
          required: true
          schema:
            type: string
        - name: from
          in: query
          description: >-
            Thời gian bắt đầu để lọc lịch sử sổ lệnh, định dạng ISO 8601 (ví dụ
            2024-01-01T00:00:00Z).
          required: true
          schema:
            type: string
        - name: to
          in: query
          description: >-
            Thời gian kết thúc để lọc lịch sử sổ lệnh, định dạng ISO 8601 (ví dụ
            2024-01-01T00:00:00Z).
          required: true
          schema:
            type: string
        - name: symbol
          in: query
          description: Mã chứng khoán cần lọc lịch sử sổ lệnh.
          required: false
          schema:
            type: string
        - name: orderStatus
          in: query
          description: >-
            Trạng thái lệnh cần lọc. Tham khảo danh sách trạng thái tại phụ lục
            Trạng thái lệnh & luồng trạng thái.
          required: false
          schema:
            type: string
        - name: pageSize
          in: query
          description: >-
            Số lượng bản ghi trên mỗi trang. Nếu không cung cấp thì hệ thống sẽ
            sử dụng giá trị mặc định là 10.
          required: false
          schema:
            type: integer
        - name: pageIndex
          in: query
          description: >-
            Chỉ số trang khi phân trang kết quả, bắt đầu từ 1. Nếu không cung
            cấp thì hệ thống sẽ sử dụng giá trị mặc định là 1.
          required: false
          schema:
            type: integer
        - $ref: '#/components/parameters/ContentType'
        - $ref: '#/components/parameters/UserAgent'
        - $ref: '#/components/parameters/AcceptLanguage'
      responses:
        '200':
          description: Thành công.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderBookResponse'
              example:
                accountNo: Q123451
                totalRecord: 5
                orderList:
                  - clientRequestId: T260820  xkp48463635
                    orderId: '26082100131482'
                    symbol: AAA
                    side: S
                    orderType: LO
                    quantity: '1'
                    price: '7090'
                    filledQty: '1'
                    cancelQty: '0'
                    avgPrice: '7090'
                    inputTime: 2026/08/21 14:09:02
                    modifiedTime: 2026/08/21 14:15:28
                    orderStatus: FF
                    message: null
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - SsiBearerAuth: []
components:
  parameters:
    ContentType:
      name: Content-Type
      in: header
      required: true
      description: Định dạng nội dung request body. Chủ yếu là application/json.
      schema:
        type: string
        default: application/json
    UserAgent:
      name: User-Agent
      in: header
      required: false
      description: Thông tin client gửi request.
      schema:
        type: string
    AcceptLanguage:
      name: Accept-Language
      in: header
      required: false
      description: >-
        Ngôn ngữ phản hồi mong muốn. Nếu không có header này, hệ thống sẽ mặc
        định là en
      schema:
        type: string
        default: en
  schemas:
    OrderBookResponse:
      description: Dữ liệu trả về.
      type: object
      properties:
        accountNo:
          description: Số tài khoản giao dịch.
          type: string
        totalRecord:
          description: Tổng số bản ghi.
          type: integer
        orderList:
          description: Danh sách lệnh.
          type: array
          items:
            type: object
            properties:
              clientRequestId:
                description: Định danh yêu cầu do client tạo.
                type: string
              orderId:
                description: Định danh lệnh do SSI tạo.
                type: string
              symbol:
                description: Mã chứng khoán hoặc mã hợp đồng phái sinh.
                type: string
              side:
                description: Chiều mua hoặc bán của lệnh.
                type: string
              orderType:
                description: Loại lệnh giao dịch.
                type: string
              quantity:
                description: Khối lượng.
                type: string
              price:
                description: Giá đặt hoặc giá thực hiện.
                type: string
              filledQty:
                description: Khối lượng đã khớp.
                type: string
              cancelQty:
                description: Khối lượng đã hủy.
                type: string
              avgPrice:
                description: Giá khớp trung bình.
                type: string
              inputTime:
                description: Thời điểm nhập lệnh.
                type: string
              modifiedTime:
                description: Thời điểm sửa lệnh.
                type: string
              orderStatus:
                description: Trạng thái lệnh.
                type: string
              message:
                description: Thông báo xử lý lệnh.
                type:
                  - string
                  - 'null'
    ErrorResponse:
      type: object
      properties:
        code:
          description: Mã kết quả hoặc mã xác thực giao dịch.
          type: string
        msg:
          description: Thông báo kết quả xử lý.
          type: string
  responses:
    BadRequest:
      description: Yêu cầu không hợp lệ.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Chưa được xác thực hoặc token không hợp lệ.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalError:
      description: Lỗi nội bộ máy chủ.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    SsiBearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Access token lấy từ endpoint /api/v3/auth/token hoặc
        /api/v3/auth/refresh.

````

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