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

# Список субсчетов

> Возвращает список субсчетов аккаунта.

**Требуемое разрешение:** `SUBACCOUNT:READ` или `FULL_ACCESS`

<Note>
  Возвращает субсчета основного аккаунта — каждый со своим `reference`, который вы отправляете в заголовке `X-Sub-Account`, чтобы выполнить операцию в этом субсчёте. См. [Субсчета](/ru#субсчета) — там описано поведение заголовка и приведена полная таблица ошибок.
</Note>


## OpenAPI

````yaml openapi.ru.json GET /sub-accounts
openapi: 3.0.0
info:
  title: pague.dev API
  description: Документация платёжного API pague.dev
  version: '1.0'
  contact: {}
servers:
  - url: https://api-gateway.pague.dev/v2
security: []
paths:
  /sub-accounts:
    get:
      tags:
        - External API - Sub-accounts (Subcontas)
      summary: Получить список субсчетов
      description: |-
        Возвращает список субсчетов аккаунта.

        **Требуемое разрешение:** `SUBACCOUNT:READ` или `FULL_ACCESS`
      operationId: ExternalSubAccountsController_getAllSubAccounts
      responses:
        '200':
          description: Список субсчетов
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetAllSubAccountsOutput'
        '401':
          description: Unauthorized — требуется аутентификация
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponse'
        '403':
          description: Forbidden — доступ запрещён
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenErrorResponse'
        '500':
          description: Internal Server Error — внутренняя ошибка сервера
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    GetAllSubAccountsOutput:
      type: object
      properties:
        data:
          description: Список субсчетов аккаунта
          type: array
          items:
            $ref: '#/components/schemas/CreateSubAccountOutput'
      required:
        - data
    UnauthorizedErrorResponse:
      type: object
      properties:
        statusCode:
          type: number
          example: 401
        error:
          type: string
          example: Unauthorized
        message:
          type: string
          example: Authentication token is required
        details:
          type: object
        timestamp:
          type: string
          example: '2025-12-15T22:00:00.000Z'
        traceId:
          type: string
      required:
        - statusCode
        - error
        - message
        - timestamp
    ForbiddenErrorResponse:
      type: object
      properties:
        statusCode:
          type: number
          example: 403
        error:
          type: string
          example: Forbidden
        message:
          type: string
          example: You do not have permission to access this resource
        details:
          type: object
        timestamp:
          type: string
          example: '2025-12-15T22:00:00.000Z'
        traceId:
          type: string
      required:
        - statusCode
        - error
        - message
        - timestamp
    InternalServerErrorResponse:
      type: object
      properties:
        statusCode:
          type: number
          example: 500
        error:
          type: string
          example: InternalError
        message:
          type: string
          example: An unexpected error occurred
        details:
          type: object
        timestamp:
          type: string
          example: '2025-12-15T22:00:00.000Z'
        traceId:
          type: string
          example: 2771463d58840c8e116dc6dda1e1e5d0
      required:
        - statusCode
        - error
        - message
        - timestamp
    CreateSubAccountOutput:
      type: object
      properties:
        id:
          type: string
          description: ID субсчёта
          format: uuid
        reference:
          type: string
          description: Reference субсчёта
          example: loja-centro
        name:
          type: string
          description: Название субсчёта
          example: Loja Centro
        status:
          type: string
          description: Статус субсчёта
          example: approved
        createdAt:
          type: string
          description: Дата создания
          format: date-time
      required:
        - id
        - reference
        - name
        - status
        - createdAt
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Токен доступа, полученный через POST /auth (client_id + client_secret).
        Действителен в течение 300 секунд.

````