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

# 货币转换

> 说明 Yuno 的货币转换服务如何以商户币种和客户币种结算支付

Yuno 的货币转换服务让您可以同时以您的币种和客户的币种结算支付。货币转换是将一种货币兑换为另一种货币的过程，需要使用汇率来确定目标货币中的等值金额。

### 优势

* **全球覆盖**：让企业能够以多种货币收款和付款，从而开展国际业务。
* **客户便利**：客户可以使用自己偏好的货币付款，提升购买体验。
* **成本效益**：优化转换汇率可以降低交易成本。
* **收入优化**：企业可以利用有利的汇率实现利润最大化。

### 部分用例

* **电子商务平台**：面向国际销售商品的在线商店使用货币转换，以本地货币显示价格并相应地处理支付。
* **汇款服务**：提供跨境资金转账的公司依靠货币转换，确保收款方以本地货币收到资金。
* **旅游和酒店业**：该行业的企业使用货币转换处理来自国际旅客的支付。
* **投资平台**：提供外国股票、债券或加密货币交易的金融科技平台使用货币转换，管理不同货币之间的投资。

## 实施

在 Yuno 中，我们连接了不同的货币转换服务提供商，因此您无需担心各个集成之间的差异。服务的实施方式取决于您选择合作的货币转换服务提供商。

### 关键概念

* **汇率**：一种货币可兑换为另一种货币的比率。可以是固定汇率，也可以是根据市场情况波动的浮动汇率。
* **基础货币**：您要转换的原始货币。
* **持卡人货币**：您要转换成的目标货币。
* **转换价差**：买入汇率与卖出汇率之间的差额，代表提供转换服务的实体的利润率。
* **实时转换**：使用最新汇率，在交易发生的确切时间执行转换。

### API 实施

要使用货币转换服务，您可以选择两种 API 实施方式。

#### 服务提供商的汇率服务

商户可以使用外部服务提供商的货币转换服务，并在 Yuno 的支付中直接发送相应信息。

示例：

```json theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
 "amount": {
    "currency": "USD",
    "value": 1000.00,
    "currency_conversion": {
      "cardholder_currency": "QAR",
      "cardholder_amount": 3640.00,
      "cardholder_accepted": true,
      "rate": 3.6400,
      "rate_margin_percentage": 3.75,
      "rate_source": "ECB",
      "provider": "FEXCO",
      "description": "You have chosen to pay in QAR. Amount: 3640.00 QAR. Rate: 3.6400.",
      "created_at": "2026-04-24T14:30:00Z",
      "expires_at": "2026-04-24T15:30:00Z"
    }
  }
```

## 参数参考

下表描述了 `amount.currency_conversion` 对象的参数：

### 请求字段

| 字段 | 类型 | 必填 | 描述 |
| - | - | - | - |
| `cardholder_currency` | `string` | ✅ | 向持卡人收费所用的货币。ISO 4217 alpha-3 代码。 |
| `cardholder_amount` | `number` | ✅ | 以 `cardholder_currency` 向持卡人收取的总金额。 |
| `cardholder_accepted` | `boolean` | ✅ | 持卡人对 DCC 报价的明确同意。 |
| `rate` | `number` | ✅ | 适用的 FX 汇率（含加价）。 |
| `rate_margin_percentage` | `number` | ✅ | 在批发汇率之上增加的加价，以百分比表示。 |
| `rate_source` | `string` | 条件必填 | 报价所用的批发基准汇率。当 `rate_margin_percentage > 0` 时必填。 |
| `provider` | `string` | ✅ | 出具报价的 DCC 服务提供商（例如 `FEXCO`、`PLANET`）。 |
| `description` | `string` | 可选 | 向持卡人显示的原样披露文本。 |
| `created_at` | `string` | ✅ | DCC 服务提供商出具报价的时间戳（ISO 8601）。 |
| `expires_at` | `string` | 可选 | 报价到期的时间戳（ISO 8601）。 |

### Webhook / 响应新增字段

| 字段 | 类型 | 描述 |
| - | - | - |
| `code` | `string` | Yuno 为该 DCC 记录分配的内部标识符。 |
| `status` | `string` | 转换的生命周期状态（例如 `APPLIED`、`DECLINED`）。 |
| `error_reason` | `string` | 仅在无法应用 DCC 时填充。 |
| `provider_data` | `object` | 底层服务提供商适配器返回的收单机构往返数据。 |

## 生命周期状态

| 值 | 含义 |
| - | - |
| `QUOTED` | 报价已接收并通过验证，尚未应用于授权。 |
| `APPLIED` | 报价已成功应用于授权。 |
| `EXPIRED` | 报价在应用前已过期。 |
| `DECLINED` | 持卡人已拒绝 DCC 报价。 |
| `REVERSED` | 转换已作为取消或退款的一部分被冲正。 |

要使用此功能，请**联系您的技术客户经理**，确保信息设置正确。


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