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

# 列出拒绝组

> 列出账户的拒绝组、Merchant Advice Code 组和 ISO 8583 代码组，以便在路由输出中通过 group_id 引用。

列出账户上保存的拒绝组：您通过 `status: "DECLINE_GROUP"` 引用的拒绝子状态组、通过 `status: "MAC_CODE_GROUP"` 引用的 Merchant Advice Code 组，以及通过 `status: "ISO_CODE_GROUP"` 引用的发卡机构 ISO 8583 响应代码组。在路由输出中将组的 `id` 用作 `group_id`；请参阅[结果组](https://docs.y.uno/zh-hans/reference/organizations/routing/routing-resource-shape.md#outcome-groups)。

此 endpoint 为只读。组在 Dashboard 中创建，或者在保存带有 `decline_types` 但没有 `group_id` 的 `DECLINE_GROUP` 或 `ISO_CODE_GROUP` 输出时自动创建（这些组命名为 `auto_…`）。已保存的 ISO 代码组在 Dashboard 中创建，而不是通过公共 API 创建：路由请求唯一会创建的 ISO 代码组就是这些 `auto_…` 组。

### 查询参数

**account\_id** `string` *required*

要列出组的账户。必须属于您的 API 凭证所作用的组织。

### 响应

包含该账户各个组的数组；如果账户没有组，则返回空数组。每个组包含：

**id** `integer`

作为 `group_id` 发送的值。

**name** `string`

组的名称，与 Dashboard 中显示的一致，并在路由输出中以 `group_name` 返回。

**type** `enum`

组的类型，即该组匹配所依据的输出 `status`：`DECLINE_GROUP` 表示拒绝子状态组，`MAC_CODE_GROUP` 表示 Merchant Advice Code 组，`ISO_CODE_GROUP` 表示发卡机构 ISO 8583 响应代码组（仅限卡片支付）。Merchant Advice Code 组也可以从 `DECLINE_GROUP` 输出引用，此时匹配方式不同；ISO 代码组只能从 `ISO_CODE_GROUP` 输出引用。请参阅[结果组](https://docs.y.uno/zh-hans/reference/organizations/routing/routing-resource-shape.md#outcome-groups)。

**decline\_types** `string[]`

组的成员，使用与路由输出相同的取值：`DECLINE_GROUP` 使用拒绝子状态，例如 `DECLINED_BY_BANK`；`MAC_CODE_GROUP` 使用标准化的 Merchant Advice Code，例如 `NO_RETRY_POLICY`；`ISO_CODE_GROUP` 使用 ISO 8583 响应代码，例如 `51` 或 `9G`（去除首尾空格后为 1 到 30 个字符，比较时不区分大小写）。请参阅[交易状态和响应代码](https://docs.y.uno/zh-hans/reference/payments/status-and-response-codes/transaction.md#declined-status)。

```bash cURL theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
curl -X GET 'https://api.y.uno/v1/routing/decline-groups?account_id=7825fc5e-e50a-4248-9ae8-5d3786afb0be' \
  -H 'public-api-key: <YOUR_PUBLIC_KEY>' \
  -H 'private-secret-key: <YOUR_SECRET_KEY>'
```

```json 200 OK theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
[
  {
    "id": 1044,
    "name": "Soft declines",
    "type": "DECLINE_GROUP",
    "decline_types": ["DECLINED_BY_BANK", "RESTRICTED_BY_BANK"]
  },
  {
    "id": 4542,
    "name": "Do not retry",
    "type": "MAC_CODE_GROUP",
    "decline_types": ["NO_RETRY_POLICY", "NO_RETRY_SECURITY"]
  },
  {
    "id": 5120,
    "name": "Insufficient funds (ISO)",
    "type": "ISO_CODE_GROUP",
    "decline_types": ["51", "9G"]
  }
]
```

```json 400 Bad Request — Missing account_id theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
{
  "code": "ROUTING_VALIDATION_FAILED",
  "messages": ["account_id is required."]
}
```

### 错误

| HTTP | `code` | 触发时机 |
| - | - | - |
| `400` | `ROUTING_VALIDATION_FAILED` | 缺少 `account_id` 查询参数。 |
| `400` | `INVALID_ACCOUNT_ID` | `account_id` 属于您的 API 密钥不拥有的组织。 |
| `401` | `NOT_AUTHENTICATED` | 缺少 `public-api-key` 或 `private-secret-key` 标头。 |
| `401` | `INVALID_CREDENTIALS` | 密钥对错误，或使用了 Dashboard **Customized API key**。请改用账户密钥或组织密钥。 |
| `502` | `ROUTING_UPSTREAM_ERROR` | 无法连接路由服务。请重试该请求。 |


## OpenAPI

````yaml openapi/zh-hans/organizations/routing/list-decline-groups.json GET /routing/decline-groups
openapi: 3.1.0
info:
  title: Routing API - List Decline Groups
  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:
  /routing/decline-groups:
    get:
      summary: 列出拒绝组
      description: >-
        列出账户的拒绝组（DECLINE_GROUP）、Merchant Advice Code 组（MAC_CODE_GROUP）和 ISO 8583
        代码组（ISO_CODE_GROUP，仅限银行卡支付），供路由输出通过 group_id 引用。只读。已保存的 ISO 代码组在
        Dashboard 中创建，而不是通过公共 API；发送了 decline_types 但没有 group_id 的
        ISO_CODE_GROUP 路由输出会得到一个 auto_ 组，与 DECLINE_GROUP 相同。
      operationId: list-decline-groups
      parameters:
        - name: account_id
          in: query
          required: true
          schema:
            type: string
            format: uuid
          description: 要列出其组的账户。必须属于您的 API 凭据所属的组织。
      responses:
        '200':
          description: 该账户的组；没有时为空数组。
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: integer
                      example: 1044
                      description: 在路由输出中作为 group_id 发送的值。
                    name:
                      type: string
                      example: Soft declines
                    type:
                      type: string
                      enum:
                        - DECLINE_GROUP
                        - MAC_CODE_GROUP
                        - ISO_CODE_GROUP
                      description: 该组所配合使用的输出状态。
                    decline_types:
                      type: array
                      items:
                        type: string
                      example:
                        - DECLINED_BY_BANK
                        - RESTRICTED_BY_BANK
                      description: >-
                        该组的成员：DECLINE_GROUP 为拒绝子状态，MAC_CODE_GROUP 为标准化的 Merchant
                        Advice Codes，ISO_CODE_GROUP 为 ISO 8583 响应码（去除首尾空格后为 1 至
                        30 个字符，比较时不区分大小写）。
        '400':
          description: >-
            请求错误。缺少 `account_id` 时返回 `ROUTING_VALIDATION_FAILED`，`account_id`
            属于其他组织时返回 `INVALID_ACCOUNT_ID`。
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: ROUTING_VALIDATION_FAILED
                  messages:
                    type: array
                    items:
                      type: string
                    example:
                      - account_id is required.
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: NOT_AUTHENTICATED
                  messages:
                    type: array
                    items:
                      type: string
                    example:
                      - Not authenticated
        '502':
          description: 网关错误
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: ROUTING_UPSTREAM_ERROR
                  messages:
                    type: array
                    items:
                      type: string
                    example:
                      - routing service unavailable.
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.