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

# 列出路由

> 列出某个账户的所有路由，可按支付方式筛选。

列出在某个账户上配置的路由。每一项都返回该路由当前生效的配置，结构与[检索路由](https://docs.y.uno/zh-hans/reference/organizations/routing/retrieve-routing.md)相同。

每个 `output[]` 条目的 `status` 为以下值之一：`APPROVED`、`DECLINED`、`DECLINE_GROUP`、`MAC_CODE_GROUP`、`SUCCEEDED_GROUP`、`PENDING`、`INTERNAL_ERROR`、`LIABILITY_SHIFTED`、`LIABILITY_NOT_SHIFTED` 或 `LIABILITY_NOT_REPORTED`。最后三个仅用于 3DS 服务提供商步骤；请参阅[责任转移输出](https://docs.y.uno/zh-hans/reference/organizations/routing/routing-resource-shape.md#liability-shift-outputs)。

传递 `payment_method` 可仅列出该支付方式的路由，省略它则列出全部路由。

### 查询参数

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

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

**payment\_method** `enum`

可选，按支付方式筛选（例如 `CARD`、`PIX`）。取值与路由响应中的 `payment_method` 字段相同。

### 响应

该账户上配置的路由；如果没有路由，则返回空数组。每个路由包含：

**id** `string`

路由的唯一标识符。

**account\_id** `string`

账户的唯一标识符。

**payment\_method** `enum`

此路由适用的支付方式（例如 `CARD`）。

**name** `string`

路由的标签。

**default\_route** `object`

默认路由逻辑。

**condition\_sets** `object[]`

可选的条件逻辑。

**created\_at** `string`

ISO 8601 时间戳。

**updated\_at** `string`

ISO 8601 时间戳。

**warnings** `string[]`

可选的非阻塞编排警告列表（例如 `MONITOR_REDISTRIBUTION_DEFERRED`）。

```bash cURL theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
curl -X GET 'https://api.y.uno/v1/routing?account_id=7825fc5e-e50a-4248-9ae8-5d3786afb0be&payment_method=CARD' \
  -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": "8f2c1d3e-4b5a-4c7d-8e9f-0a1b2c3d4e5f",
    "account_id": "acc-uuid",
    "payment_method": "CARD",
    "name": "Card routing — Stripe primary, Adyen fallback",
    "default_route": {
      "steps": [
        {
          "index": 1,
          "provider_id": "STRIPE",
          "connection_id": "f1a3c4d5-7b8e-4a2c-9d1e-3f4a5b6c7d8e",
          "output": [
            { "status": "DECLINE_GROUP", "next": 2 },
            { "status": "TIMEOUT",        "next": 2 }
          ]
        },
        { "index": 2, "provider_id": "ADYEN", "connection_id": "b2c4d5e6-..." }
      ]
    },
    "created_at": "2026-05-12T14:30:00Z",
    "updated_at": "2026-05-12T14:30:00Z"
  }
]
```

```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."]
}
```

```json 400 Bad Request — Invalid account_id theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
{
  "code": "INVALID_ACCOUNT_ID",
  "messages": ["account_id 'acc-uuid' does not belong to your organization."]
}
```

### 错误

| 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**。请改用账户密钥或组织密钥。 |


## OpenAPI

````yaml openapi/zh-hans/organizations/routing/list-routings.json GET /routing
openapi: 3.1.0
info:
  title: Routing API - List
  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:
    get:
      summary: 列出路由配置
      description: 列出账户的所有路由配置，可选按支付方式筛选。每一项的结构与检索路由配置相同。
      operationId: list-routings
      parameters:
        - name: account_id
          in: query
          required: true
          schema:
            type: string
            format: uuid
          description: 要列出其路由配置的账户。必须属于您的 API 凭据所属的组织。
        - name: payment_method
          in: query
          required: false
          schema:
            type: string
            example: CARD
          description: 按支付方式筛选（例如 CARD、PIX）。
      responses:
        '200':
          description: 账户上已配置的路由配置；没有时为空数组。
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                      example: 8f2c1d3e-4b5a-4c7d-8e9f-0a1b2c3d4e5f
                    account_id:
                      type: string
                      example: acc-uuid
                    payment_method:
                      type: string
                      example: CARD
                    name:
                      type: string
                      example: Card routing — Stripe primary, Adyen fallback
                    default_route:
                      type: object
                      properties:
                        start_split:
                          type: array
                          description: >-
                            按百分比将该路由的入口拆分到多个步骤。省略时，所有支付都从步骤 1 开始。各条目之和必须为
                            100；仅当路由具有拆分入口时才会返回。
                          items:
                            type: object
                            required:
                              - index
                              - percentage
                            properties:
                              index:
                                type: integer
                                example: 1
                              percentage:
                                type: integer
                                example: 45
                        steps:
                          type: array
                          items:
                            type: object
                            properties:
                              index:
                                type: integer
                                example: 1
                              provider_id:
                                type: string
                                example: STRIPE
                                description: 服务提供商步骤必填；动作步骤上不出现。必须与连接的服务提供商一致。
                              connection_id:
                                type: string
                                example: f1a3c4d5-...
                                description: >-
                                  服务提供商步骤必填；动作步骤和智能路由步骤上不出现。必须为 ACTIVE，并支持该
                                  payment_method。
                              provider_type:
                                type: string
                                enum:
                                  - PAYMENT
                                  - FRAUD
                                  - THREE_D_SECURE
                                  - AUTHENTICATION
                                description: 服务提供商所对应的类型。仅在响应中出现。
                              timeout:
                                type: integer
                                example: 60
                                description: 服务提供商步骤。服务提供商的超时时间（秒），来自服务提供商目录。仅在响应中出现。
                              network_token_enable:
                                type: boolean
                                description: >-
                                  支付步骤。该步骤上 network_token_on 能否为
                                  true：组织已开通网络令牌，且服务提供商支持网络令牌。仅在响应中出现。
                              network_token_on:
                                type: boolean
                                description: 支付步骤。该步骤是否在有可用的卡网络令牌时使用网络令牌支付。
                              three_d_secure_exemptions:
                                type: array
                                items:
                                  type: string
                                  enum:
                                    - LOW_VALUE
                                    - TRANSACTION_RISK_ANALYSIS
                                    - SECURE_CORPORATE
                                    - TRUSTED_BENEFICIARY
                                    - RECURRING_PAYMENT
                                    - STRONG_CUSTOMER_AUTHENTICATION
                                    - OUT_OF_SCOPE
                                description: 3DS 步骤。该步骤可应用的 SCA 豁免；没有时为空数组。
                              action:
                                type: string
                                enum:
                                  - CANCEL
                                  - CAPTURE
                                  - HOLD_FOR_REVIEW
                                  - REVERT
                                description: >-
                                  将该步骤设为结束路由的动作步骤：CANCEL 拒绝支付，CAPTURE 在
                                  action_delay 之后捕获授权，HOLD_FOR_REVIEW
                                  使其保持待处理状态等待人工审核，REVERT 在支付后欺诈筛查之后将其冲销。CAPTURE
                                  和 HOLD_FOR_REVIEW 跟在支付步骤或智能路由步骤的 APPROVED 或
                                  SUCCEEDED_GROUP 输出之后，REVERT
                                  跟在支付之后运行的欺诈步骤的输出之后，CANCEL 绝不跟在批准之后。动作步骤没有
                                  provider_id、connection_id 或 output。
                              action_delay:
                                type: string
                                example: PT5M
                                description: >-
                                  仅适用于 action = CAPTURE。批准与捕获之间的 ISO-8601 时长，最短
                                  PT1M，最长 P7D。省略则在批准处理完成后立即捕获。
                              output:
                                type: array
                                items:
                                  type: object
                                  required:
                                    - status
                                  properties:
                                    status:
                                      type: string
                                      example: DECLINED
                                      description: >-
                                        APPROVED、DECLINED、DECLINE_GROUP、MAC_CODE_GROUP、ISO_CODE_GROUP、SUCCEEDED_GROUP、PENDING（仅限欺诈、3DS
                                        和身份验证步骤）、INTERNAL_ERROR，或
                                        LIABILITY_SHIFTED、LIABILITY_NOT_SHIFTED
                                        和 LIABILITY_NOT_REPORTED（仅限 3DS
                                        服务提供商步骤：它们按身份验证的责任转移情况（true、false 或无值）细化
                                        APPROVED，当步骤上没有匹配的输出时，路由沿用
                                        APPROVED；这些输出上不允许使用
                                        group_id、decline_types 和 retry: true）。
                                    decline_types:
                                      type: array
                                      items:
                                        type: string
                                      description: >-
                                        DECLINE_GROUP（拒绝子状态）、MAC_CODE_GROUP（Merchant
                                        Advice Codes）和 ISO_CODE_GROUP（ISO 8583
                                        响应码）输出上该组的成员。
                                    group_id:
                                      type: integer
                                      example: 1044
                                      description: >-
                                        DECLINE_GROUP、MAC_CODE_GROUP、ISO_CODE_GROUP
                                        或 SUCCEEDED_GROUP 输出所对应的组的 ID。
                                    group_name:
                                      type: string
                                      example: Soft declines
                                      description: group_id 所对应的组的名称。写入时忽略。
                                    retry:
                                      type: boolean
                                      example: false
                                      description: 该输出是否在沿用 next 之前，对同一服务提供商重试一次。始终返回。
                                    next:
                                      type: integer
                                      example: 2
                                    next_split:
                                      type: array
                                      description: >-
                                        按百分比将回退拆分到多个步骤：至少 2 个条目，百分比之和为 100。与
                                        next = 第一个条目一并返回。
                                      items:
                                        type: object
                                        required:
                                          - index
                                          - percentage
                                        properties:
                                          index:
                                            type: integer
                                            example: 2
                                          percentage:
                                            type: integer
                                            example: 70
                                description: 按结果划分的处理器。在动作步骤上返回空数组。
                              fraud:
                                type: object
                                description: 欺诈服务提供商步骤的配置，在 FRAUD 步骤上返回。
                                properties:
                                  rules:
                                    type: string
                                    example: rule-a,rule-b
                                  blocklists:
                                    type: string
                                  allowlists:
                                    type: string
                                  reviewlists:
                                    type: string
                                  preset:
                                    type: string
                                  report_only:
                                    type: boolean
                                    description: 仅评分，不根据结果采取动作。仅适用于从支付步骤的拒绝输出到达的欺诈步骤。
                              smart_routing:
                                type: object
                                description: 在智能路由步骤上返回。
                                properties:
                                  type:
                                    type: string
                                    enum:
                                      - COSTS
                                      - LATENCY
                                    example: LATENCY
                                  providers:
                                    type: array
                                    minItems: 2
                                    maxItems: 4
                                    items:
                                      type: object
                                      required:
                                        - provider_id
                                        - connection_id
                                      properties:
                                        provider_id:
                                          type: string
                                          example: ADYEN
                                        connection_id:
                                          type: string
                                          format: uuid
                                        network_token_on:
                                          type: boolean
                                  no_retry_decline_types:
                                    type: array
                                    items:
                                      type: string
                                    description: 出现这些拒绝子状态后，不再尝试该组中的下一个服务提供商。
                                  no_retry_decline_group_ids:
                                    type: array
                                    items:
                                      type: integer
                                    example:
                                      - 5120
                                    description: >-
                                      账户的拒绝组 ID（列出拒绝组），其拒绝不会在该组中的下一个服务提供商上重试。接受
                                      ISO 代码组：ISO 8583
                                      响应码属于其中某个组的拒绝，不会在下一个智能路由服务提供商上重试。更新时省略则保留已存储的组；[]
                                      则清空。
                                  no_retry_failure_causes:
                                    type: array
                                    items:
                                      type: string
                                    description: >-
                                      出现这些失败原因（例如
                                      PROVIDER_TIMEOUT）后，不再尝试该组中的下一个服务提供商。
                    condition_sets:
                      type: array
                      items:
                        type: object
                        properties:
                          sort_number:
                            type: integer
                            example: 1
                          name:
                            type: string
                            example: High Value US
                          description:
                            type: string
                          conditions:
                            type: array
                            items:
                              type: object
                              properties:
                                condition_type:
                                  type: string
                                  example: COUNTRY
                                  description: >-
                                    条件目录请参见 Routing
                                    Conditions：COUNTRY、CARD_ISSUER_COUNTRY、AMOUNT、CURRENCY、CARD_TYPE、CARD_BRAND、CARD_BIN、TRANSACTION_TYPE、METADATA、ADDITIONAL_FIELD、ORDER_ITEMS_AMOUNT、TIME_PERIOD、VOLUME_PAYMENTS_LIMIT、SUBSCRIPTION_RETRY、SUBSCRIPTION_RETRY_COUNT。
                                conditional:
                                  type: string
                                  example: ONE_OF
                                values:
                                  type: array
                                  items:
                                    type: string
                                  example:
                                    - US
                                    - CA
                                  description: >-
                                    在 CURRENCY 上，为大写的 ISO 4217 代码（不含
                                    XXX，不可重复）：使用 EQUAL 或 NOT_EQUAL 时恰好 1 个，使用
                                    ONE_OF 或 NOT_ONE_OF 时 1 个或多个。仅在带有 currency 的
                                    AMOUNT 条件上可为空，此时匹配该货币的任意金额。在
                                    ORDER_ITEMS_AMOUNT 上，为订单项汇总金额的数值阈值：1 个值，使用
                                    BETWEEN 时为 2 个。
                                key:
                                  type: string
                                  description: >-
                                    METADATA：metadata
                                    键。ADDITIONAL_FIELD：受支持的字段名称。ORDER_ITEMS_AMOUNT：item_values
                                    所匹配的订单项字段，可选 sku_code（默认）、category 或 brand。
                                item_values:
                                  type: array
                                  items:
                                    type: string
                                  example:
                                    - GC-50
                                    - GC-100
                                    - GC-200
                                  description: >-
                                    仅适用于
                                    ORDER_ITEMS_AMOUNT，且在其上必填：订单项值的非空列表（精确匹配，区分大小写），其
                                    quantity × unit_amount 会被累加。在其他任何
                                    condition_type 上会被拒绝。
                                currency:
                                  type: string
                                  example: USD
                                  description: >-
                                    ISO 4217。在 AMOUNT、ORDER_ITEMS_AMOUNT 以及
                                    limit_by = VOLUME 的 VOLUME_PAYMENTS_LIMIT
                                    上必填。CURRENCY 上不发送，其货币放在 values 中。
                                time_period_repeat_amount:
                                  type: integer
                                  example: 1
                                  description: >-
                                    TIME_PERIOD 和 VOLUME_PAYMENTS_LIMIT：每隔多少个
                                    time_period_repeat_frequency 单位（计划），或 DAILY
                                    窗口的天数长度，1 至 90（限额）。
                                time_period_repeat_frequency:
                                  type: string
                                  enum:
                                    - DAILY
                                    - WEEKLY
                                    - MONTHLY
                                    - QUARTERLY
                                    - YEARLY
                                  description: >-
                                    TIME_PERIOD：重复周期单位。VOLUME_PAYMENTS_LIMIT：限额的周期，DAILY、MONTHLY
                                    或 QUARTERLY。
                                time_period_repetition_days:
                                  type: array
                                  items:
                                    type: string
                                    enum:
                                      - MONDAY
                                      - TUESDAY
                                      - WEDNESDAY
                                      - THURSDAY
                                      - FRIDAY
                                      - SATURDAY
                                      - SUNDAY
                                  description: 仅适用于 TIME_PERIOD。计划适用的星期几；需要同时设置频率。
                                time_period_start_time:
                                  type: string
                                  example: '09:00:00'
                                  description: >-
                                    仅适用于 TIME_PERIOD。每日时间窗口的开始时间（HH:mm:ss），需与
                                    time_period_end_time 一起使用。
                                time_period_end_time:
                                  type: string
                                  example: '18:00:00'
                                  description: 仅适用于 TIME_PERIOD。每日时间窗口的结束时间（HH:mm:ss），含该时刻。
                                timezone:
                                  type: string
                                  example: '-03:00'
                                  description: >-
                                    UTC 偏移量。TIME_PERIOD：计划按该偏移量解读（默认为 values[0]
                                    的偏移量）。VOLUME_PAYMENTS_LIMIT：各周期起始所用的整小时偏移量（默认为
                                    +00:00）。
                                limit_by:
                                  type: string
                                  enum:
                                    - PAYMENTS
                                    - VOLUME
                                  description: >-
                                    仅适用于
                                    VOLUME_PAYMENTS_LIMIT。按笔数统计支付（默认），或按货币汇总金额。
                                payments_count:
                                  type: string
                                  enum:
                                    - ALL
                                    - SUCCEEDED
                                  description: 仅适用于 VOLUME_PAYMENTS_LIMIT。哪些支付计入限额。默认为 ALL。
                            description: 以逻辑 AND 组合的条件。请参见 Routing Conditions。
                          route:
                            type: object
                            description: >-
                              结构与 default_route 相同，包括
                              start_split、output[].next_split 和动作步骤。
                    created_at:
                      type: string
                      format: date-time
                      example: '2026-05-12T14:30:00Z'
                    updated_at:
                      type: string
                      format: date-time
                      example: '2026-05-12T14:30:00Z'
        '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
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.