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

# List virtual accounts

> Retrieve a list of virtual accounts under an account.
The virtual accounts are returned in an array, with each item representing a virtual account under that account.

The primary account will also be returned as a virtual account, with an account type of 'primary' while actual subaccounts
under the primary account will have an account type of 'default'.




## OpenAPI

````yaml get /virtual-account
openapi: 3.1.0
info:
  title: Slash Public API
  description: API description
  version: 0.0.1
  contact: {}
servers:
  - url: https://api.slash.com
    description: production
security:
  - api_key: []
  - partner_api_key: []
  - bearer: []
  - developer_application: []
paths:
  /virtual-account:
    get:
      description: >
        Retrieve a list of virtual accounts under an account.

        The virtual accounts are returned in an array, with each item
        representing a virtual account under that account.


        The primary account will also be returned as a virtual account, with an
        account type of 'primary' while actual subaccounts

        under the primary account will have an account type of 'default'.
      parameters:
        - name: cursor
          required: false
          in: query
          schema:
            type: string
          description: A cursor string to fetch the next page of results
          x-reference-path: schemas/Pagination/CursorParameter.yaml
        - name: filter:accountId
          description: >-
            Pass in an account ID to filter virtual accounts by account ID. This
            will return all virtual accounts that match the account ID passed
            in.
          in: query
          schema:
            type: string
          required: false
        - name: filter:includeClosedAccounts
          description: >-
            Include virtual accounts that have been closed in the query results.
            By default, they will not be returned.
          in: query
          schema:
            type: string
            enum:
              - true
              - false
          required: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/VirtualAccount'
                      x-entrypoint:
                        virtualPath: schemas/VirtualAccount
                        sourcePath: schemas/VirtualAccount.yaml
                        title: VirtualAccount
                        origin: ./src/publicApi
                  metadata:
                    $ref: '#/components/schemas/Pagination.PaginationResponse'
                    x-entrypoint:
                      virtualPath: schemas/Pagination/PaginationResponse
                      sourcePath: schemas/Pagination/PaginationResponse.yaml
                      title: PaginationResponse
                      origin: ./src/publicApi
                required:
                  - items
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: TooManyRequests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - api_key: []
        - bearer: []
components:
  schemas:
    VirtualAccount:
      type: object
      properties:
        virtualAccount:
          $ref: '#/components/schemas/VirtualAccountModel'
          description: The virtual account itself
          x-entrypoint:
            virtualPath: schemas/VirtualAccountModel
            sourcePath: schemas/VirtualAccountModel.yaml
            title: VirtualAccountModel
            origin: ./src/publicApi
        balance:
          $ref: '#/components/schemas/Money'
          description: The total balance of the virtual account
          x-entrypoint:
            virtualPath: schemas/Money
            sourcePath: schemas/Money.yaml
            title: Money
            origin: ./src/publicApi
        spend:
          $ref: '#/components/schemas/Money'
          description: The total spend of the virtual account
          x-entrypoint:
            virtualPath: schemas/Money
            sourcePath: schemas/Money.yaml
            title: Money
            origin: ./src/publicApi
        commissionRule:
          $ref: '#/components/schemas/VirtualAccountCommissionRule'
          description: The commission rule applied to the virtual account, if any
          x-entrypoint:
            virtualPath: schemas/VirtualAccountCommissionRule
            sourcePath: schemas/VirtualAccountCommissionRule.yaml
            title: VirtualAccountCommissionRule
            origin: ./src/publicApi
      required:
        - virtualAccount
        - balance
        - spend
      x-entrypoint:
        virtualPath: schemas/VirtualAccount
        sourcePath: schemas/VirtualAccount.yaml
        title: VirtualAccount
        origin: ./src/publicApi
      title: VirtualAccount
    Pagination.PaginationResponse:
      type: object
      description: Response sent when requesting a list of data
      properties:
        nextCursor:
          type: string
          description: >-
            The cursor to use to retrieve the next page of data. If this is not
            sent, there is no more data to retrieve.
        count:
          type: number
          description: The number of items in the current page of data.
      x-entrypoint:
        virtualPath: schemas/Pagination/PaginationResponse
        sourcePath: schemas/Pagination/PaginationResponse.yaml
        title: PaginationResponse
        origin: ./src/publicApi
      title: PaginationResponse
    Error:
      type: object
      properties:
        message:
          type: string
        name:
          type: string
        identifier:
          type: string
        rawStatus:
          type: number
        meta:
          type: object
          additionalProperties: true
      required:
        - message
        - name
        - identifier
        - rawStatus
      x-entrypoint:
        origin: ./src/publicApi
        sourcePath: ./src/publicApi/main.yaml
        title: Error
        virtualPath: components/Error
      title: Error
    VirtualAccountModel:
      type: object
      properties:
        id:
          type: string
          description: The ID of the virtual account.
        name:
          type: string
          description: The name of the virtual account.
        accountNumber:
          type: string
          description: The account number of the virtual account.
        routingNumber:
          type: string
          description: The routing number of the virtual account.
        accountId:
          type: string
          description: >-
            The account ID of the Slash account the virtual account is
            associated with.
        closedAt:
          type: string
          description: >-
            The date the virtual account was closed; will be null if account was
            never closed.
        accountType:
          type: string
          enum:
            - default
            - primary
          description: >
            The account type of the virtual account. Since virtual accounts and
            Slash accounts exist at the same hierarchy level,

            an account type of 'primary' means it is the main Slash account,
            while an account type of 'default' means it is a virtual account

            under the main account.
      description: The virtual account object
      required:
        - id
        - name
        - accountId
        - accountType
      x-entrypoint:
        virtualPath: schemas/VirtualAccountModel
        sourcePath: schemas/VirtualAccountModel.yaml
        title: VirtualAccountModel
        origin: ./src/publicApi
      title: VirtualAccountModel
    Money:
      type: object
      description: Represents a monetary value
      properties:
        amountCents:
          type: integer
          description: The amount in cents
      required:
        - amountCents
      x-entrypoint:
        virtualPath: schemas/Money
        sourcePath: schemas/Money.yaml
        title: Money
        origin: ./src/publicApi
      title: Money
    VirtualAccountCommissionRule:
      type: object
      properties:
        id:
          type: string
          description: The ID of the commission rule
        virtualAccountId:
          type: string
          description: The ID of the virtual account the commission rule is applied to
        commissionDetails:
          $ref: '#/components/schemas/VirtualAccountCommissionDetails'
          description: Describes details of the commission rule.
          x-entrypoint:
            virtualPath: schemas/VirtualAccountCommissionDetails
            sourcePath: schemas/VirtualAccountCommissionDetails.yaml
            title: VirtualAccountCommissionDetails
            origin: ./src/publicApi
      description: The virtual account commission rule object
      required:
        - id
        - virtualAccountId
        - commissionDetails
      x-entrypoint:
        virtualPath: schemas/VirtualAccountCommissionRule
        sourcePath: schemas/VirtualAccountCommissionRule.yaml
        title: VirtualAccountCommissionRule
        origin: ./src/publicApi
      title: VirtualAccountCommissionRule
    VirtualAccountCommissionDetails:
      oneOf:
        - type: object
          properties:
            type:
              type: string
              enum:
                - flatFee
              description: >
                The type of the commission rule. A type of flat_fee will take a
                flat fee from the virtual account and transfer it to the primary
                account

                with the frequency of the collection defined as monthly or
                yearly.
            amount:
              $ref: '#/components/schemas/Money'
              description: >-
                The amount of money to be diverted from the virtual account if
                the type of rule is flat_fee.
              x-entrypoint:
                virtualPath: schemas/Money
                sourcePath: schemas/Money.yaml
                title: Money
                origin: ./src/publicApi
            frequency:
              type: string
              enum:
                - monthly
                - yearly
              description: >
                The frequency from the start date that the rule will be applied.
                E.g. a start date of November 26, 2024 with a frequency of
                "monthly"

                will have the rule applied on December 26, 2024. If the
                frequency was "yearly", the rule would be applied again on
                November 26, 2025.
            startDate:
              type: string
              format: date-time
              description: The date that the rule will begin to take effect.
          required:
            - type
            - frequency
            - amount
        - type: object
          properties:
            type:
              type: string
              enum:
                - takeRate
              description: >
                The type of the commission rule. A type of take_rate will take a
                percent of the virtual account's funds and divert them to

                the primary account.
            takeRate:
              type: number
              description: >-
                The percentage of funds to divert from the virtual account to
                the primary account.
          required:
            - type
            - takeRate
      x-entrypoint:
        virtualPath: schemas/VirtualAccountCommissionDetails
        sourcePath: schemas/VirtualAccountCommissionDetails.yaml
        title: VirtualAccountCommissionDetails
        origin: ./src/publicApi
      title: VirtualAccountCommissionDetails
  securitySchemes:
    api_key:
      type: apiKey
      description: |
        API key authentication for public API requests.

        Keys come in two flavors:

        - *Legal-entity-scoped keys* are pinned to a single legal entity.
          Minted via the dashboard under a specific entity; every request
          acts on that entity.
        - *User-scoped keys* are pinned to a user and span every legal
          entity that user has access to. Every request made with a
          user-scoped key (except `GET /legal-entity`, which lists the
          legal entities the user can access) must include an
          `x-legal-entity` header naming the legal entity the request is
          operating on. Requests without the header are rejected with
          `400`. The authenticated user must have an active permission
          role on the supplied legal entity, otherwise the request is
          rejected with `403`.
      name: X-API-Key
      in: header
    partner_api_key:
      type: apiKey
      description: |
        Partner-program API key authentication.

        Keys are minted in the partner dashboard (Developers → API Keys),
        are scoped to a single partner program, and are prefixed with
        `sk_partner_`. Partner keys are only accepted by routes that
        declare this scheme; they are rejected by `api_key` routes and
        vice versa.
      name: X-API-Key
      in: header
    bearer:
      type: http
      scheme: bearer
    developer_application:
      type: http
      scheme: basic

````