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

# 检索路由

> 返回路由当前生效的配置，通过其 routing_id 识别。

返回路由当前生效的配置，结构与[创建路由](https://docs.y.uno/zh-hans/reference/organizations/routing/create-routing.md)和[更新路由](https://docs.y.uno/zh-hans/reference/organizations/routing/update-routing.md)接受的结构相同，因此您可以通过 `PATCH` 将结果原样发回。与请求体相比，响应还包含：

* 每个输出上的 `retry`（未设置时为 `false`）。
* `DECLINE_GROUP`、`MAC_CODE_GROUP` 和 `ISO_CODE_GROUP` 输出上的 `group_id`、`group_name` 和 `decline_types`（在 `ISO_CODE_GROUP` 上，`decline_types` 存放该组的 ISO 8583 响应代码；请参阅 [ISO 代码组](https://docs.y.uno/zh-hans/reference/organizations/routing/routing-resource-shape.md#iso-code-groups)）；`SUCCEEDED_GROUP` 输出上的 `group_id` 和 `group_name`。
* 操作步骤上的 `action` 和 `action_delay`，以及其上的 `output: []`。
* 每个服务提供商步骤上的 `provider_type` 和 `timeout`，支付步骤上的 `network_token_enable` 和 `network_token_on`，3DS 步骤上的 `three_d_secure_exemptions`，欺诈步骤上的 `fraud`，以及 Smart Routing 步骤上的 `smart_routing`。
* 带有任意路由状态的 `output[].status`，包括仅属于 3DS 服务提供商步骤的 `LIABILITY_SHIFTED`、`LIABILITY_NOT_SHIFTED` 和 `LIABILITY_NOT_REPORTED`（请参阅[责任转移输出](https://docs.y.uno/zh-hans/reference/organizations/routing/routing-resource-shape.md#liability-shift-outputs)），每个状态都带有其 `next`。
* `TIME_PERIOD` 和 `VOLUME_PAYMENTS_LIMIT` 条件的时间安排和限额字段。
* 入口被拆分时的 `start_split`，以及备用路径被拆分时的 `output[].next_split`；否则两者都会省略。
* 没有值的字段以 `null` 返回（`next`、`decline_types`、`key`、`currency`）；为简洁起见，下面的示例省略了这些字段。

API 无法表达的路由部分不会出现在响应中，并在更新时保持不变。请参阅 [API 不显示的内容](https://docs.y.uno/zh-hans/reference/organizations/routing/routing-resource-shape.md#what-the-api-does-not-show)。

### 路径参数

**routing\_id** `string` *required*

[创建路由](https://docs.y.uno/zh-hans/reference/organizations/routing/create-routing.md)返回的 id。必须属于您的 API 密钥所作用的账户。

### 响应

**id** `string`

路由的唯一标识符。

**account\_id** `string`

账户的唯一标识符。

**payment\_method** `enum`

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

**name** `string`

路由的标签。

**default\_route** `object`

默认路由逻辑。有关 `steps[]` 和 `output[]` 的每个字段，请参阅[路由资源结构](https://docs.y.uno/zh-hans/reference/organizations/routing/routing-resource-shape.md)。

**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/8f2c1d3e-4b5a-4c7d-8e9f-0a1b2c3d4e5f' \
  -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": "7825fc5e-e50a-4248-9ae8-5d3786afb0be",
  "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": "APPROVED",       "next": 3, "retry": false },
          { "status": "DECLINE_GROUP",  "group_id": 1044, "group_name": "Soft declines",
            "decline_types": ["DECLINED_BY_BANK", "RESTRICTED_BY_BANK"], "next": 2, "retry": true },
          { "status": "MAC_CODE_GROUP", "group_id": 4542, "group_name": "Do not retry",
            "decline_types": ["NO_RETRY_POLICY", "NO_RETRY_SECURITY"], "retry": false },
          { "status": "DECLINED",       "next": 2, "retry": false },
          { "status": "INTERNAL_ERROR", "next": 2, "retry": false }
        ]
      },
      {
        "index": 2,
        "provider_id": "ADYEN",
        "connection_id": "b2c4d5e6-1a2b-3c4d-5e6f-7a8b9c0d1e2f",
        "output": [
          { "status": "APPROVED",        "next": 3, "retry": false },
          { "status": "SUCCEEDED_GROUP", "group_id": 430, "group_name": "Pending review", "next": 4, "retry": false }
        ]
      },
      { "index": 3, "action": "CAPTURE", "action_delay": "PT5M", "output": [] },
      { "index": 4, "action": "HOLD_FOR_REVIEW", "output": [] }
    ]
  },
  "condition_sets": [
    {
      "sort_number": 1,
      "name": "Business hours via Adyen",
      "conditions": [
        { "condition_type": "TIME_PERIOD", "conditional": "EQUAL", "values": ["2026-10-01T00:00:00-03:00"],
          "time_period_repeat_amount": 1, "time_period_repeat_frequency": "WEEKLY",
          "time_period_repetition_days": ["MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY"],
          "time_period_start_time": "09:00:00", "time_period_end_time": "18:00:00", "timezone": "-03:00" }
      ],
      "route": { "steps": [ { "index": 1, "provider_id": "ADYEN", "connection_id": "b2c4d5e6-...", "output": [{ "status": "APPROVED", "next": null, "decline_types": null, "retry": false }, { "status": "INTERNAL_ERROR", "next": null, "decline_types": null, "retry": false }] } ] }
    }
  ],
  "created_at": "2026-05-12T14:30:00Z",
  "updated_at": "2026-05-12T14:30:00Z"
}
```

```json 404 Not Found theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
{
  "code": "ROUTING_NOT_FOUND",
  "messages": ["Routing '...' was not found"]
}
```

### 错误

| HTTP | `code` | 触发时机 |
| - | - | - |
| `404` | `ROUTING_NOT_FOUND` | 未知的 `routing_id`，或该 id 属于其他账户。 |
| `401` | `NOT_AUTHENTICATED` | 缺少 `public-api-key` 或 `private-secret-key` 标头。 |
| `401` | `INVALID_CREDENTIALS` | 密钥对错误，或使用了 Dashboard **Customized API key**。请改用账户密钥或组织密钥。 |


## OpenAPI

````yaml openapi/zh-hans/organizations/routing/retrieve-routing.json GET /routing/{routing_id}
openapi: 3.1.0
info:
  title: Routing API - Retrieve
  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/{routing_id}:
    get:
      summary: 检索路由配置
      description: 返回该路由配置当前生效的配置。
      operationId: retrieve-routing
      parameters:
        - name: routing_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                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'
        '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
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: ROUTING_NOT_FOUND
                  messages:
                    type: array
                    items:
                      type: string
                    example:
                      - Routing '...' was not found
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.