> ## Documentation Index
> Fetch the complete documentation index at: https://docs.oms.verolabs.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Lấy danh sách tài khoản của người dùng hiện tại

> Lấy danh sách tài khoản của người dùng hiện tại



## OpenAPI

````yaml openapi.docs.vi.json GET /api/v1/users/accounts
openapi: 3.0.3
info:
  title: Vero OMS REST API
  version: 1.0.24
  description: >-
    Tài liệu REST API cho Vero OMS. Path được đối chiếu với KrakenD config hiện
    tại trong k8s-dev-gitops/vero-algo/tools/krakend và schema response được bổ
    sung từ source backend/frontend.
servers:
  - url: https://api-gw.verolabs.co
    description: API gateway
security: []
tags:
  - name: Xác thực
    description: Luồng xác thực và đăng xuất
    x-original-name: Auth
  - name: Đăng ký
    description: API hỗ trợ luồng đăng ký tài khoản
  - name: Tài khoản
    description: Tài khoản người dùng, số dư, vị thế, nạp và rút tiền
    x-original-name: Accounts
  - name: Tài khoản ngân hàng
    description: Quản lý tài khoản ngân hàng đã lưu
    x-original-name: Bank Accounts
  - name: Lệnh
    description: Đặt lệnh, hủy lệnh, sửa lệnh và lịch sử lệnh
    x-original-name: Orders
  - name: Lịch sử
    description: Lệnh, khớp lệnh và giao dịch tiền của tài khoản.
    x-original-name: History
  - name: Dữ liệu thị trường
    description: Watchlist, tìm kiếm mã, dữ liệu sản phẩm và lịch sử OHLCV
    x-original-name: Market Data
  - name: Thông báo
    description: Thông báo trong ứng dụng
    x-original-name: Notifications
  - name: Giới thiệu
    description: Mã giới thiệu, rebate và tổng hợp hoa hồng
    x-original-name: Referral
  - name: Chẩn đoán
    description: Endpoint kiểm tra sức khỏe và chẩn đoán hệ thống
    x-original-name: Diagnostics
paths:
  /api/v1/users/accounts:
    get:
      tags:
        - Tài khoản
      summary: Lấy danh sách tài khoản của người dùng hiện tại
      description: List accounts for current user.
      operationId: listAccounts
      responses:
        '200':
          description: Accounts returned by the account service.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Account'
        '400':
          $ref: '#/components/responses/ErrorResponse'
          description: Response lỗi.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnyErrorBody'
            application/problem+json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ValidationProblemDetails'
                  - $ref: '#/components/schemas/ProblemDetails'
            text/plain:
              schema:
                type: string
                description: Thông điệp lỗi dạng text do backend hoặc gateway trả về.
        '401':
          $ref: '#/components/responses/ErrorResponse'
          description: Response lỗi.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnyErrorBody'
            application/problem+json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ValidationProblemDetails'
                  - $ref: '#/components/schemas/ProblemDetails'
            text/plain:
              schema:
                type: string
                description: Thông điệp lỗi dạng text do backend hoặc gateway trả về.
        '404':
          $ref: '#/components/responses/ErrorResponse'
          description: Response lỗi.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnyErrorBody'
            application/problem+json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ValidationProblemDetails'
                  - $ref: '#/components/schemas/ProblemDetails'
            text/plain:
              schema:
                type: string
                description: Thông điệp lỗi dạng text do backend hoặc gateway trả về.
        '500':
          $ref: '#/components/responses/ErrorResponse'
          description: Response lỗi.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnyErrorBody'
            application/problem+json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ValidationProblemDetails'
                  - $ref: '#/components/schemas/ProblemDetails'
            text/plain:
              schema:
                type: string
                description: Thông điệp lỗi dạng text do backend hoặc gateway trả về.
      security:
        - bearerAuth: []
components:
  schemas:
    Account:
      type: object
      additionalProperties: true
      description: >-
        Thông tin tài khoản giao dịch gồm equity, margin, PnL và danh mục vị
        thế.
      required:
        - id
        - accountId
        - totalEquity
        - credit
        - maintenanceMargin
        - tempMaintenanceMargin
        - totalRealizedPnl
        - totalUnrealizedPnl
        - tradingPower
        - crossMargin
        - positions
        - tempPositions
      properties:
        id:
          type: string
          description: Internal account document identifier.
        accountId:
          type: string
          description: Trading account identifier used by order and portfolio APIs.
        userId:
          type: string
          description: Owner user identity id or email propagated by the gateway.
        connectionType:
          type: string
          description: Account connection type such as DEMO or REAL.
        totalEquity:
          type: number
          description: Total account equity.
        credit:
          type: number
          description: Available credit or cash balance maintained by the account service.
        maintenanceMargin:
          type: number
          description: Current maintenance margin requirement.
        tempMaintenanceMargin:
          type: number
          description: Temporary maintenance margin for pending orders/positions.
        totalRealizedPnl:
          type: number
          description: Total realized profit and loss.
        totalUnrealizedPnl:
          type: number
          description: Total unrealized profit and loss.
        tradingPower:
          type: number
          description: Available trading power after margin and holds.
        crossMargin:
          type: boolean
          description: Whether cross-margin mode is enabled for this account.
        refCode:
          type: string
          description: Referral code linked to the account, if any.
        identityId:
          type: string
          description: Hệ thống xác thực identity id when present.
        positions:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/Position'
          description: Open positions keyed by symbol.
        tempPositions:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/TempPosition'
          description: Temporary or pending positions keyed by symbol.
    AnyErrorBody:
      oneOf:
        - $ref: '#/components/schemas/ErrorResponse'
        - $ref: '#/components/schemas/ValidationProblemDetails'
        - $ref: '#/components/schemas/ProblemDetails'
        - $ref: '#/components/schemas/AuthFlow'
      description: >-
        Body lỗi có cấu trúc do gateway, ASP.NET service hoặc validation handler
        backend trả về.
    ValidationProblemDetails:
      allOf:
        - $ref: '#/components/schemas/ProblemDetails'
        - type: object
          additionalProperties: true
          properties:
            errors:
              type: object
              additionalProperties:
                oneOf:
                  - type: array
                    items:
                      type: string
                  - type: string
              description: Lỗi validation theo từng field request.
      description: Response lỗi validation khi param hoặc body field không hợp lệ.
    ProblemDetails:
      type: object
      additionalProperties: true
      description: Response lỗi kiểu RFC 7807 do ASP.NET/gateway trả về.
      properties:
        type:
          type: string
          description: URI loại lỗi.
        title:
          type: string
          description: Tiêu đề lỗi ngắn.
        status:
          type: integer
          description: Mã HTTP status.
        detail:
          type: string
          description: Thông điệp lỗi chi tiết.
        traceId:
          type: string
          description: Trace id để tra cứu lỗi backend.
    Position:
      type: object
      additionalProperties: true
      description: Open portfolio position for one symbol.
      properties:
        id:
          type: string
          description: Position identifier.
        accountId:
          type: string
          description: Owning trading account.
        symbol:
          type: string
          description: Position symbol.
        avgPrice:
          type: number
          description: Average entry price.
        qty:
          type: number
          description: Net quantity. Positive is long, negative is short.
        marketPrice:
          type: number
          description: Latest market price used for valuation.
        marketValue:
          type: number
          description: Current market value.
        portPercent:
          type: number
          description: Portfolio weight percentage.
        realizePnl:
          type: number
          description: Realized PnL for the position.
        unrealizePnl:
          type: number
          description: Unrealized PnL for the position.
        coveredMarginCall:
          type: number
          description: Covered margin-call amount set by the user.
        marginRatio:
          $ref: '#/components/schemas/MarginRatio'
        forceClosePrice:
          type: number
          description: Estimated force-close price.
        forceCloseStatus:
          type: string
          description: Current force-close status.
        marginCallPrice:
          type: number
          description: Estimated margin-call price.
        marginCallStatus:
          type: string
          description: Current margin-call status.
    TempPosition:
      type: object
      additionalProperties: true
      description: Aggregated pending order position for one symbol.
      properties:
        symbol:
          type: string
          description: Symbol.
        netQty:
          type: number
          description: Net pending quantity.
        avgPrice:
          type: number
          description: Average pending price.
        orderCount:
          type: integer
          description: Number of pending orders contributing to this temp position.
        marketPrice:
          type: number
          description: Latest market price.
    ErrorResponse:
      type: object
      additionalProperties: true
      description: >-
        Body loi do gateway hoac backend tra ve. Backend co the tra JSON object
        hoac loi dang plain text.
      properties:
        error:
          oneOf:
            - type: string
            - type: object
              additionalProperties: true
              properties:
                id:
                  type: string
                  description: Ma loi gateway khi co.
                code:
                  type: integer
                  description: Ma loi tuong duong HTTP.
                status:
                  type: string
                  description: Text trang thai HTTP, vi du Unauthorized.
                reason:
                  type: string
                  description: Ly do chi tiet do he thong hoac gateway tra ve.
                message:
                  type: string
                  description: Thong diep loi de doc.
          description: Chuoi ma/thong diep loi hoac object loi nested cua gateway.
        message:
          type: string
          description: Human-readable error message.
        detail:
          type: string
          description: Detailed backend error message when available.
        details:
          oneOf:
            - type: string
            - type: object
              additionalProperties: true
            - type: array
              items:
                type: object
                additionalProperties: true
          description: Chi tiết validation hoặc backend bổ sung.
          nullable: true
        status:
          type: integer
          description: HTTP status code when included by the backend.
    AuthFlow:
      type: object
      additionalProperties: true
      properties:
        id:
          type: string
          description: >-
            Ma flow. Dung gia tri nay lam query parameter flow khi submit hoac
            update flow.
        type:
          type: string
          description: Loai flow do he thong tra ve, vi du browser hoac api.
        expires_at:
          type: string
          format: date-time
          description: Thoi diem flow het han. Can submit flow truoc thoi diem nay.
        issued_at:
          type: string
          format: date-time
          description: Thoi diem he thong tao flow.
        ui:
          type: object
          additionalProperties: true
          description: >-
            Payload UI cua gom action URL, method, nodes, messages va CSRF node
            khi can.
        state:
          type: string
          description: >-
            Trang thai hien tai cua flow, vi du choose_method, sent_email,
            passed_challenge hoac success.
        request_url:
          type: string
          description: URL request goc dung de tao flow.
        organization_id:
          type: string
          nullable: true
          description: Ma organization cho flow theo organization, khi co.
        created_at:
          type: string
          description: Thoi diem tao flow.
          format: date-time
        updated_at:
          type: string
          description: Thoi diem cap nhat flow.
          format: date-time
        refresh:
          type: boolean
          description: Cho biet flow co phai refresh flow hay khong.
        requested_aal:
          type: string
          description: Muc dam bao xac thuc duoc yeu cau cho flow.
        identity:
          allOf:
            - 18a8e28a-07b2-496a-8619-bacbc39b1aff
          description: Identity gan voi settings flow khi tra ve.
      description: >-
        self-service flow object duoc tra ve boi cac endpoint tao/cap nhat
        login, registration, recovery va settings flow.
    MarginRatio:
      type: object
      additionalProperties: true
      description: Margin, fee, tax, and risk-ratio configuration.
      properties:
        marginRatio:
          type: number
          description: Initial/maintenance margin ratio requirement.
        marginCallRate:
          type: number
          description: Margin-call threshold rate.
        forceCloseRate:
          type: number
          description: Force-close threshold rate.
        tradingFee:
          type: number
          description: Trading fee rate, for example 0.001 for 0.1%.
        productCommission:
          type: number
          description: Product commission rate.
        tax:
          type: number
          description: Tax rate.
        overnightFee:
          type: number
          description: Overnight fee rate.
        shortSellFee:
          type: number
          description: Short-sell fee rate.
  responses:
    ErrorResponse:
      description: Error response containing an error code, message, detail, or plain text.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
        text/plain:
          schema:
            type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Bearer token used for protected REST API requests.

````