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

# Find Account Groups by Merchant ID

> Look up account groups using a merchant-side identifier instead of a Yuno group ID

Returns every account group within the authenticated organization that carries the given `merchant_id`. Use this endpoint to locate Yuno group records using the identifier that already exists on your side, without having to store or look up Yuno-generated group IDs.

<Note>
  **Multiple matches and empty results**

  A `merchant_id` is not guaranteed to be unique — more than one group can share the same value. All matching groups are returned. When no group carries the requested `merchant_id`, the response contains an empty `data` array rather than an error. Deleted groups are never included.
</Note>


## OpenAPI

````yaml openapi/organizations/find-account-groups-by-merchant-id.json GET /organizations/account-groups
openapi: 3.1.0
info:
  title: Account Groups API - Find by Merchant ID
  version: 1.0.0
servers:
  - url: https://api-sandbox.y.uno/v1
  - url: https://api.eu.y.uno/v1
security:
  - sec0: []
    sec1: []
paths:
  /organizations/account-groups:
    get:
      summary: Find Account Groups by Merchant ID
      description: >-
        Returns all account groups that match the given `merchant_id`. Because a
        merchant ID is not guaranteed to be unique, every matching group is
        returned. When no group carries that merchant ID the response contains
        an empty `data` array — it is not an error. Only groups belonging to the
        authenticated organization are ever returned; deleted groups are
        excluded.
      operationId: find-account-groups-by-merchant-id
      parameters:
        - name: merchant_id
          in: query
          required: true
          schema:
            type: string
          description: The merchant-side identifier to look up. Must be an exact match.
      responses:
        '200':
          description: OK — zero or more matching account groups.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    description: >-
                      List of account groups that carry the requested
                      merchant_id. Empty when no match is found.
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                          description: >-
                            Yuno-generated unique identifier of the account
                            group.
                        name:
                          type: string
                          description: Display name of the account group.
                        merchant_id:
                          type: string
                          description: Merchant-side identifier stored on this group.
                        created_at:
                          type: string
                          format: date-time
                          description: ISO 8601 timestamp of when the group was created.
                        updated_at:
                          type: string
                          format: date-time
                          description: ISO 8601 timestamp of the last update.
                  pagination:
                    type: object
                    properties:
                      page:
                        type: integer
                      page_size:
                        type: integer
                      total_items:
                        type: integer
                      total_pages:
                        type: integer
                      has_next:
                        type: boolean
                      has_previous:
                        type: boolean
              examples:
                match_found:
                  summary: One group matched
                  value:
                    data:
                      - id: a1b2c3d4-e5f6-7890-abcd-ef1234567890
                        name: Acme Corp - LATAM
                        merchant_id: MCH-00123
                        created_at: '2024-03-15T10:00:00Z'
                        updated_at: '2024-06-01T08:30:00Z'
                    pagination:
                      page: 1
                      page_size: 20
                      total_items: 1
                      total_pages: 1
                      has_next: false
                      has_previous: false
                no_match:
                  summary: No group matched — empty result
                  value:
                    data: []
                    pagination:
                      page: 1
                      page_size: 20
                      total_items: 0
                      total_pages: 0
                      has_next: false
                      has_previous: false
        '400':
          description: Bad Request — `merchant_id` query parameter is missing or blank.
        '401':
          description: Unauthorized — invalid or missing API credentials.
components:
  securitySchemes:
    sec0:
      type: apiKey
      in: header
      name: PUBLIC-API-KEY
      x-default: <Your PUBLIC-API-KEY>
    sec1:
      type: apiKey
      in: header
      name: PRIVATE-SECRET-KEY
      x-default: <Your PRIVATE-SECRET-KEY>

````