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

# 连接与路由概述

> 面向商户的参考文档，介绍新的公共 API 接口，您可以通过它创建支付服务提供商连接，并配置 Yuno 如何在这些连接之间路由支付。

连接是您将现有支付服务提供商账户（Stripe、Adyen、dLocal、PayU 等）引入 Yuno 编排的方式。连接创建后，您可以在路由规则中引用它，通过该服务提供商发送支付。

路由告诉 Yuno，对于某个账户上的某个 `payment_method`，应使用哪个连接，并允许您按买家属性（国家/地区、币种、金额、卡品牌、自定义 metadata 等）进行分支。

## 通用规范

### 基础 URL

```text theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
https://api.y.uno
```

### 身份验证与标头

| 标头 | 必填 | 备注 |
| - | - | - |
| `public-api-key` | 是 | 您的商户公共 API 密钥。该密钥所属的账户决定请求作用于哪个账户。 |
| `private-secret-key` | 是 | 您的商户私有密钥。 |
| `X-Idempotency-Key` | 用于 `POST` 和 `PATCH` | UUID，有效范围 24 小时。重新发送相同的键和请求体会返回缓存的响应；相同的键搭配不同的请求体会返回 `409`。 |
| `Content-Type: application/json` | 是 | |

> [!NOTE]
>
> 请使用账户密钥或组织密钥。目前，Dashboard **Developers → Customized API keys** 在所有 `/v1/routing*` 和 `/v1/connections*` endpoint 上都会被驳回。

### 约定

* 字段名称在所有位置（请求、响应、错误）均使用 `snake_case`。唯一的例外是 **服务提供商目录** 响应中的 `params[]`，其中各个 `param_id` 值会以其原生大小写形式透传（`merchantAccount`、`HMAC_KEY`、`apple-merchant-id` 等），创建连接时您必须原样回传这些值。
* 所有 endpoint 的错误响应结构均相同：

```json theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
{
  "type": "validation_error",
  "code": "MISSING_REQUIRED_PARAM",
  "message": "Required param 'merchantAccount' is missing for provider 'ADYEN'",
  "details": { "provider_id": "ADYEN", "param_id": "merchantAccount" }
}
```

稳定的 `code` 值按 endpoint 分别列出。


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