> ## 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ố dư tài khoản

> Lấy thông tin số dư tài khoản.



## OpenAPI

````yaml /vi/openapi/ssi.openapi.yaml get /api/v3/trading/accountBalance
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/accountBalance:
    get:
      tags:
        - trading
      summary: Số dư tài khoản
      description: Lấy thông tin số dư tài khoản.
      operationId: getAccountBalance
      parameters:
        - name: clientId
          in: query
          description: >-
            Tài khoản 6 số định danh khách hàng tại SSI. Nếu số tài khoản là
            003C123888 thì clientId = 123888
          required: false
          schema:
            type: string
        - name: accountNo
          in: query
          description: >-
            Tài khoản giao dịch cần lấy số dư. Bắt buộc truyền thông tin tiểu
            khoản.
          required: true
          schema:
            type: string
        - $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/AccountBalanceResponse'
              examples:
                EQUITY:
                  value:
                    equity:
                      accountNo: Q123451
                      accountBalance: '22114'
                      totalDebt: '0'
                      interestLoan: '0'
                      overdueFeeLoan: '0'
                      withdrawable: '22114'
                      onHoldCash: '0'
                      sellUnmatched: '0'
                      sellT0: '0'
                      sellT1: '0'
                      sellT2: '0'
                      buyUnmatched: '0'
                      buyT0: '0'
                      buyT1: '0'
                      buyT2: '0'
                      advancedCashT0: '0'
                      advancedCashT1: '0'
                      holdSubscription: '0'
                      dividend: '0'
                    derivative: null
                DERIVATIVE:
                  value:
                    equity: null
                    derivative:
                      accountNo: Q123458
                      accountBalance: '1000020'
                      fee: '0'
                      commission: '0'
                      interest: '20'
                      extInterest: '0'
                      loan: '0'
                      deliveryAmount: '0'
                      floatingPL: '0'
                      tradingPL: '0'
                      totalPL: '0'
                      withdrawable: '1000020'
                      cashSSI: '1000020'
                      validNonCashSSI: '0'
                      withdrawableSSI: '1000020'
                      cashVSDC: '0'
                      validNonCashVSDC: '0'
                      withdrawableVSDC: '0'
        '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:
    AccountBalanceResponse:
      type: object
      required:
        - equity
        - derivative
      properties:
        equity:
          description: Thông tin hoặc danh sách vị thế tài khoản cơ sở.
          type:
            - object
            - 'null'
          properties:
            accountNo:
              description: Số tài khoản giao dịch.
              type: string
            accountBalance:
              description: Số dư tài khoản.
              type: string
            totalDebt:
              description: Tổng dư nợ.
              type: string
            interestLoan:
              description: Lãi vay.
              type: string
            overdueFeeLoan:
              description: Phí vay quá hạn.
              type: string
            withdrawable:
              description: Số tiền có thể rút.
              type: string
            onHoldCash:
              description: Tiền mặt đang bị giữ.
              type: string
            sellUnmatched:
              description: Giá trị bán chưa khớp.
              type: string
            sellT0:
              description: Giá trị bán chờ về T+0.
              type: string
            sellT1:
              description: Giá trị bán chờ về T+1.
              type: string
            sellT2:
              description: Giá trị bán chờ về T+2.
              type: string
            buyUnmatched:
              description: Giá trị mua chưa khớp.
              type: string
            buyT0:
              description: Giá trị mua T+0.
              type: string
            buyT1:
              description: Giá trị mua T+1.
              type: string
            buyT2:
              description: Giá trị mua T+2.
              type: string
            advancedCashT0:
              description: Tiền ứng trước T+0.
              type: string
            advancedCashT1:
              description: Tiền ứng trước T+1.
              type: string
            holdSubscription:
              description: Giá trị tiền đang giữ cho quyền mua.
              type: string
            dividend:
              description: Cổ tức.
              type: string
        derivative:
          description: Thông tin tài khoản hoặc vị thế phái sinh.
          type:
            - object
            - 'null'
          additionalProperties: true
          properties:
            accountNo:
              description: Số tài khoản giao dịch.
              type: string
            accountBalance:
              description: Số dư tài khoản giao dịch (tiền mặt khả dụng).
              type: string
            fee:
              description: Phí giao dịch.
              type: string
            commission:
              description: Hoa hồng giao dịch.
              type: string
            interest:
              description: Lãi suất vay.
              type: string
            extInterest:
              description: Lãi suất vay ngoài.
              type: string
            loan:
              description: Dư nợ vay gốc đã sử dụng trong tài khoản giao dịch phái sinh.
              type: string
            deliveryAmount:
              description: >-
                Số tiền phải trả hoặc được nhận khi đến ngày giao hàng đối với
                các hợp đồng tương lai.
              type: string
            floatingPL:
              description: Lãi/lỗ chưa thực hiện từ các vị thế mở.
              type: string
            tradingPL:
              description: Lãi/lỗ đã thực hiện từ các vị thế đã đóng.
              type: string
            totalPL:
              description: Tổng lãi/lỗ (floatingPL + tradingPL).
              type: string
            withdrawable:
              description: Số tiền có thể rút từ tài khoản giao dịch phái sinh.
              type: string
            cashSSI:
              description: Số tiền mặt trong tài khoản giao dịch phái sinh tại SSI.
              type: string
            validNonCashSSI:
              description: Số tiền phi tiền mặt hợp lệ trong tài khoản phái sinh tại SSI.
              type: string
            withdrawableSSI:
              description: Số tiền có thể rút từ tài khoản phái sinh tại SSI.
              type: string
            cashVSDC:
              description: Số tiền mặt trong tài khoản giao dịch phái sinh tại VSDC.
              type: string
            validNonCashVSDC:
              description: Số tiền phi tiền mặt hợp lệ trong tài khoản phái sinh tại VSDC.
              type: string
            withdrawableVSDC:
              description: Số tiền có thể rút từ tài khoản phái sinh tại VSDC.
              type: string
    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.