> ## 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.

> ## Agent Instructions
> Test in the sandbox first: base URL https://api-sandbox.y.uno (Test Mode in the Dashboard). Production is https://api.y.uno (Live Mode).
> Every API request needs the public-api-key and private-secret-key headers. Get them in the Dashboard at https://dashboard.y.uno/developers (Developers > Credentials); sandbox and production keys are different.
> Send an X-Idempotency-Key (a UUID) when creating payments, refunds and cancels, so retries do not create duplicates.
> Start with the Quickstart (https://docs.y.uno/docs/quickstart.md) and the agent guide (https://docs.y.uno/agents.md). To search these docs from a coding agent, connect the docs MCP server at https://docs.y.uno/mcp.

# 按商户 ID 查找账户组

> 使用商户端标识符而非 Yuno 组 ID 查找账户组

返回已认证组织内带有指定 `merchant_id` 的所有账户组。使用此 endpoint，您可以通过您这边已有的标识符找到 Yuno 组记录，无需存储或查找 Yuno 生成的组 ID。

> [!NOTE]
>
> **多个匹配和空结果**
>
> `merchant_id` 不保证唯一，多个组可以共享同一个值。所有匹配的组都会返回。当没有组带有所请求的 `merchant_id` 时，响应会包含一个空的 `data` 数组，而不是错误。已删除的组永远不会包含在内。


## OpenAPI

````yaml openapi/zh-hans/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
    description: Sandbox
  - url: https://api.y.uno/v1
    description: Production (US)
security:
  - sec0: []
    sec1: []
paths:
  /organizations/account-groups:
    get:
      summary: 按商户 ID 查找账户组
      description: >-
        返回与给定 `merchant_id` 匹配的所有账户组。由于商户 ID 不保证唯一，会返回所有匹配的组。当没有任何组带有该商户 ID
        时，响应包含空的 `data` 数组，这不是错误。只会返回属于已认证组织的组；已删除的组不包含在内。
      operationId: find-account-groups-by-merchant-id
      parameters:
        - name: merchant_id
          in: query
          required: true
          schema:
            type: string
          description: 要查找的商户侧标识符。必须完全匹配。
      responses:
        '200':
          description: OK：零个或多个匹配的账户组。
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    description: 带有所请求 merchant_id 的账户组列表。没有匹配项时为空。
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                          description: Yuno 生成的账户组唯一标识符。
                        name:
                          type: string
                          description: 账户组的显示名称。
                        merchant_id:
                          type: string
                          description: 存储在该组上的商户侧标识符。
                        parent_code:
                          type:
                            - string
                            - 'null'
                          format: uuid
                          description: 该组所嵌套的父组的 `id`。根（顶层）组为 `null`。
                        created_at:
                          type: string
                          format: date-time
                          description: 组创建时间的 ISO 8601 时间戳。
                        updated_at:
                          type: string
                          format: date-time
                          description: 最近一次更新时间的 ISO 8601 时间戳。
                  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
                        parent_code: null
                        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: 请求错误：缺少 `merchant_id` 查询参数，或其为空白。
        '401':
          description: 未授权：API 凭据无效或缺失。
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>

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.