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

# Get Collection Accounts

> This API fetches all the virtual accounts that is linked with the given merchant ID.

Based on who you are, consider the below values in the API requests

<Note>
  | Cashfree Merchant | Cashfree Partner     |
  | :---------------- | :------------------- |
  | x-client-id       | x-partner-api-key    |
  | x-client-secret   | x-partner-merchantid |
</Note>


## OpenAPI

````yaml get /gc/virtual-accounts
openapi: 3.0.3
info:
  title: Global Collections - Partners
  version: '4'
servers:
  - url: https://sandbox.cashfree.com/
    description: Sandbox server
  - url: https://api.cashfree.com/
    description: Production server
security: []
paths:
  /gc/virtual-accounts:
    get:
      summary: Get All Collection Accounts for Merchants
      description: >-
        This API fetches all the virtual accounts that is linked with the given
        merchant ID.
      operationId: get-collection-accounts-partner
      parameters:
        - $ref: '#/components/parameters/PartnerApiKey'
        - $ref: '#/components/parameters/PartnerMerchantId'
        - $ref: '#/components/parameters/ApiVersion'
        - name: page
          in: query
          description: Specify the page number you want to see. The default value is 0.
          schema:
            type: integer
            format: int32
        - name: size
          in: query
          description: Specify the page size, the default value is 20.
          schema:
            type: integer
            format: int32
        - name: currency
          in: query
          description: >-
            Please mention the currency for which you want to view virtual
            account details.
          schema:
            type: string
      responses:
        '200':
          description: Success response for retrieving virtual accounts.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VirtualAccountsResponse'
        '403':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  parameters:
    PartnerApiKey:
      name: x-partner-api-key
      in: header
      description: Enter partner API keygit
      required: true
      schema:
        type: string
    PartnerMerchantId:
      name: x-partner-merchantid
      in: header
      description: >-
        Enter the merchant reference id used while creating merchant during
        onboarding
      required: true
      schema:
        type: string
    ApiVersion:
      name: x-api-version
      in: header
      description: API version
      required: true
      schema:
        type: string
  schemas:
    VirtualAccountsResponse:
      allOf:
        - $ref: '#/components/schemas/SuccessResponse'
        - type: object
          properties:
            data:
              allOf:
                - $ref: '#/components/schemas/PaginatedResponse'
                - type: object
                  properties:
                    vAccounts:
                      type: array
                      items:
                        $ref: '#/components/schemas/VirtualAccount'
    ErrorResponse:
      type: object
      properties:
        type:
          type: string
          example: authentication_error
        message:
          type: string
          example: failed to authenticate
        code:
          type: string
          example: authentication_failed
    SuccessResponse:
      type: object
      properties:
        status:
          type: string
          example: SUCCESS
        subCode:
          type: string
          example: '200'
        message:
          type: string
          example: success_message
    PaginatedResponse:
      type: object
      properties:
        totalPages:
          type: integer
          example: 1
        totalElements:
          type: integer
          example: 1
        first:
          type: boolean
          example: true
        last:
          type: boolean
          example: true
    VirtualAccount:
      type: object
      properties:
        accountName:
          type: string
          example: John Doe
        accountNumber:
          type: string
          example: GB47TCCL12345648154924
        accountType:
          type: string
          example: iban
        paymentType:
          type: string
          example: priority
        bankName:
          type: string
          example: The Currency Cloud Limited
        bankAddress:
          type: string
          example: 12 Steward Street, The Steward Building, London, E1 6FQ, GB
        bankCountry:
          type: string
          example: GB
        currency:
          type: string
          example: AUD
        routingCode:
          type: string
          example: TCCLGB3L
        routingCodeType:
          type: string
          example: bic_swift
        status:
          type: string
          example: ACTIVE
        addedOn:
          type: string
          format: date-time
          example: '2023-09-15 16:13:48'
        vaccountId:
          type: string
          example: GB47T

````