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

# Fetch Virtual Accounts

> Returns all global virtual account details assigned to a fully activated merchant,
grouped by collection label and settlement currency.


## When to Use

Call this after a merchant is **fully activated** on PayGlocal to retrieve their assigned global virtual accounts. Accounts are grouped by collection label (e.g. `general`) and within each label by currency code.

<Note>
  Returns data only for activated merchants. Calling for a merchant still in onboarding or pending review returns HTTP 401.
</Note>

## Response Structure

The `data` object is a two-level map:

```
data
└── <collection_label>        (e.g. "general")
    └── <currency_code>       (e.g. "USD", "AUD", "GBP")
        └── VirtualAccount    (account number, bank name, routing code, etc.)
```

## Error Scenarios

| Scenario                  | HTTP Code |
| ------------------------- | --------- |
| `merchantId` is not valid | `400`     |
| Merchant is not activated | `401`     |


## OpenAPI

````yaml GET /gcc/v3/merchants/{merchantId}/ffms/virtualAccounts
openapi: 3.0.3
info:
  title: PayGlocal API
  description: >
    PayGlocal REST API covering merchant onboarding, payment initiation,
    refunds,

    capture, reversal, and standing-instruction (subscription) flows.
  version: '2.0'
  contact:
    name: PayGlocal Support
    email: merchant.support@payglocal.in
    url: https://payglocal.in
servers:
  - url: https://api.onboard.payglocal.in
    description: Onboarding — Production
  - url: https://api.onboard.uat.payglocal.in
    description: Onboarding — Sandbox
  - url: https://api.payglocal.in
    description: Payments — Production
  - url: https://api.uat.payglocal.in
    description: Payments — Sandbox
  - url: https://gcc.prod.payglocal.in
    description: MCA — Production
  - url: https://gcc.uat.payglocal.in
    description: MCA — Sandbox
security:
  - ApiKeyAuth: []
    DigestAuth: []
tags:
  - name: Merchant Onboarding
    description: Endpoints to create and manage merchant onboarding records.
  - name: Reference Data
    description: Lookup endpoints for static reference data (categories, codes).
  - name: Payment
    description: Payment initiation, refund, capture, reversal, and status endpoints.
  - name: Standing Instructions
    description: Subscription / recurring-payment mandate operations.
  - name: MCA
    description: >-
      Merchant Collection Account — virtual account fetch and transaction
      document upload.
paths:
  /gcc/v3/merchants/{merchantId}/ffms/virtualAccounts:
    servers:
      - url: https://gcc.prod.payglocal.in
        description: MCA — Production
      - url: https://gcc.uat.payglocal.in
        description: MCA — Sandbox
    get:
      tags:
        - MCA
      summary: Fetch Virtual Accounts
      description: >
        Returns all global virtual account details assigned to a fully activated
        merchant,

        grouped by collection label and settlement currency.
      operationId: fetchVirtualAccounts
      parameters:
        - name: merchantId
          in: path
          required: true
          schema:
            type: string
          description: Identifier of the onboarded merchant.
          example: merchant_001
      responses:
        '200':
          description: Virtual accounts retrieved successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  gid:
                    type: string
                    example: REQ-XXXXX
                  status:
                    type: string
                    example: 201 CREATED
                  timestamp:
                    type: string
                    example: 08/10/2025 16:25:33
                  reasonCode:
                    type: string
                    example: GL-201-001
                  data:
                    type: object
                    description: Keyed by collection label, then by currency code.
                    additionalProperties:
                      type: object
                      additionalProperties:
                        $ref: '#/components/schemas/VirtualAccount'
                  errors:
                    type: object
                    nullable: true
              example:
                gid: REQ-XXXXX
                status: 201 CREATED
                timestamp: 08/10/2025 16:25:33
                reasonCode: GL-201-001
                data:
                  general:
                    USD:
                      id: acct_abc123
                      accountId: null
                      accountNumber: XXXXXXXXXX4490
                      accountNumberType: Local
                      accountHolderName: Acme Exports
                      bankName: Citibank, N.A.
                      bankAddress: One Penns Way, New Castle, DE 19720
                      bankCountry: US
                      currency: USD
                      paymentType: null
                      routingCode: '31100209'
                      routingCodeType: ABA Number
                      createdAt: '1752649980511'
                      updatedAt: null
                    AUD:
                      id: acct_def456
                      accountId: null
                      accountNumber: XXXXXX4490
                      accountNumberType: Local
                      accountHolderName: Acme Exports
                      bankName: BC Payments
                      bankAddress: Level 11/10 Carrington St, Sydney NSW 2000, Australia
                      bankCountry: AU
                      currency: AUD
                      paymentType: null
                      routingCode: '252000'
                      routingCodeType: BSB Number
                      createdAt: '1752649980511'
                      updatedAt: null
                errors: null
        '400':
          description: Merchant ID is not valid.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: REQUEST_ERROR
                  message:
                    type: string
                    example: MERCHANT ID NOT VALID
                  gid:
                    type: string
                    example: REQ-XXXXX
                  timestamp:
                    type: string
                    example: '2024-11-18T12:34:56Z'
        '401':
          description: Merchant is not activated.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: REQUEST_ERROR
                  message:
                    type: string
                    example: MERCHANT NOT ACTIVATED
                  gid:
                    type: string
                    example: REQ-XXXXX
                  timestamp:
                    type: string
                    example: '2024-11-18T12:34:56Z'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    VirtualAccount:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the account record.
          example: acct_abc123
        accountId:
          type: string
          nullable: true
          description: Account identifier (nullable).
        accountNumber:
          type: string
          description: Account number to share with the payer.
          example: XXXXXXXXXX4490
        accountNumberType:
          type: string
          description: Type of account number (e.g. Local).
          example: Local
        accountHolderName:
          type: string
          description: Name the payer addresses the transfer to.
          example: Acme Exports
        accountType:
          type: string
          description: Payment tier.
          enum:
            - Regular
            - Priority
          example: Regular
        bankName:
          type: string
          description: Name of the receiving bank.
          example: Citibank, N.A.
        bankAddress:
          type: string
          description: Address of the receiving bank.
          example: One Penns Way, New Castle, DE 19720
        bankCountry:
          type: string
          description: ISO 3166-1 alpha-2 country code of the bank.
          example: US
        currency:
          type: string
          description: Account currency.
          enum:
            - USD
            - EUR
            - GBP
            - CAD
            - AUD
            - GLOBAL
          example: USD
        paymentType:
          type: string
          nullable: true
        routingCode:
          type: string
          description: Routing value (ABA, BSB, Sort Code, etc.).
          example: '31100209'
        routingCodeType:
          type: string
          description: Type of routing code.
          example: ABA Number
        paymentRailType:
          type: string
          description: Payment rail for this account.
          enum:
            - SEPA
            - ACH
            - EFT
            - FPS
            - SWIFT
        createdAt:
          type: string
          description: Account creation timestamp (epoch milliseconds).
          example: '1752649980511'
        updatedAt:
          type: string
          nullable: true
          description: Last update timestamp (epoch milliseconds, nullable).
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-gl-auth
      description: Static API Key generated from the PayGlocal Partner Dashboard.
    DigestAuth:
      type: apiKey
      in: header
      name: x-gl-digest
      description: >
        Per-request HmacSHA256 signature, Base64-encoded, using your API Secret
        as the HMAC key.

        - For GET requests: sign the request URI path (e.g.
        `/gcc/v2/partner/merchant/onboard/business-category`), including query
        string if present.

        - For POST/PUT requests: sign the exact raw request body.

````