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

# Vị thế

> Lấy thông tin vị thế của tài khoản.



## OpenAPI

````yaml /vi/openapi/ssi.2026-08-21.openapi.yaml get /api/v3/trading/position
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/position:
    get:
      tags:
        - trading
      summary: Vị thế
      description: Lấy thông tin vị thế của tài khoản.
      operationId: getPosition
      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 thông tin vị thế, các tài khoản đuôi 1,
            6, 8 tương ứng (CASH, MARGIN, DERIVATIVE) sẽ có thông tin vị thế
            khác nhau.
          required: true
          schema:
            type: string
        - name: querySummary
          in: query
          description: >-
            Nếu true, trả về tóm tắt vị thế phái sinh. Nếu false, trả về chi
            tiết từng vị thế. Chỉ áp dụng cho tài khoản phái sinh. Mặc định là
            true.
          required: false
          schema:
            type: boolean
        - $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/PositionResponse'
              example:
                equity:
                  - accountNo: Q123456
                    symbol: AAA
                    quantity: '1'
                    blockQuantity: '0'
                    dividendQuantity: '0'
                    buyingQuantity: '0'
                    boughtQuantity: '0'
                    sellingQuantity: '0'
                    soldQuantity: '0'
                    t1SellQuantity: '0'
                    t2SellQuantity: '0'
                    costPrice: '10000'
                    mortgageQuantity: '0'
                    sellableQuantity: '1'
                    restrictedQuantity: '0'
                derivative: 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:
    PositionResponse:
      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: array
          items:
            type: object
            properties:
              accountNo:
                description: Số tài khoản giao dịch.
                type: string
              symbol:
                description: Mã chứng khoán hoặc mã hợp đồng phái sinh.
                type: string
              quantity:
                description: Khối lượng.
                type: string
              blockQuantity:
                description: Khối lượng bị phong tỏa.
                type: string
              dividendQuantity:
                description: Khối lượng cổ phiếu cổ tức.
                type: string
              buyingQuantity:
                description: Khối lượng đang mua.
                type: string
              boughtQuantity:
                description: Khối lượng đã mua.
                type: string
              sellingQuantity:
                description: Khối lượng đang bán.
                type: string
              soldQuantity:
                description: Khối lượng đã bán.
                type: string
              t1SellQuantity:
                description: Khối lượng có thể bán theo chu kỳ T+1.
                type: string
              t2SellQuantity:
                description: Khối lượng có thể bán theo chu kỳ T+2.
                type: string
              costPrice:
                description: Giá vốn.
                type: string
              mortgageQuantity:
                description: Khối lượng cầm cố.
                type: string
              sellableQuantity:
                description: Khối lượng có thể bán.
                type: string
              restrictedQuantity:
                description: Khối lượng bị hạn chế giao dịch.
                type: string
        derivative:
          description: Thông tin tài khoản hoặc vị thế phái sinh.
          type:
            - object
            - 'null'
          additionalProperties: true
    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.