> ## 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 客户可选择的分期付款期数。

![](https://mintcdn.com/yuno-3979e326/CeL_8iNMmYV6B_wt/images/reference/merchant-installments/installments.gif?s=421e2b03029ee80b73b7a9c9342a54da)

## 如何使用商户分期付款？

根据您与 Yuno 的连接方式，配置分期付款的流程可能有所不同。下面介绍如何在 Direct 工作流和 SDK 集成中告知 Yuno 分期付款选项。

### Direct 工作流

使用 [Direct 集成](https://docs.y.uno/zh-hans/docs/direct-integration-use-cases/direct-flow.md)时，您负责管理前端 checkout 体验。在这种情况下，您需要在使用 [Create Payment](https://docs.y.uno/zh-hans/reference/payments/create-payment.md) endpoint 创建支付时告知 Yuno 分期付款期数。分期付款期数通过 `payment_method.detail.card.installments` 参数定义。

### SDK 集成

使用 Yuno 的 SDK 时，由 Yuno 负责向客户展示每笔支付可用的分期付款选项。因此，您需要告知 Yuno 您的账户可使用哪些分期付款选项。在这种情况下，分期付款配置通过 [Yuno 的 Dashboard](https://auth.y.uno/u/login?) 完成。要完成此配置，请执行下面描述的两个步骤。

1. 首先，在 Yuno Dashboard 中配置服务提供商[连接](https://docs.y.uno/zh-hans/docs/using-yuno/dashboard-overview/connections.md)时，您需要启用分期付款选项。这样，当客户在 SDK checkout 中选择信用卡选项表单时，Yuno 会显示分期付款选项。

![](https://mintcdn.com/yuno-3979e326/CeL_8iNMmYV6B_wt/images/reference/merchant-installments/image1.png?fit=max\&auto=format\&n=CeL_8iNMmYV6B_wt\&q=85\&s=06c01a2af3d9b1b204c1494c2c8485e1)

2. 启用分期付款后，您需要使用 [Create Installments Plan](https://docs.y.uno/reference/installments/create-installments-plan.md) endpoint 创建分期付款方案。创建方案时，您需要指定接受的币种、金额、卡品牌、日期等。方案生效后，Yuno 会自动将其应用于匹配的支付，并向客户展示相应的分期付款选项。

> [!WARNING]
>
> **Secure Fields SDK 集成**
>
> 使用 Secure Fields SDK 集成时，您需要在启动 checkout 流程时[启用分期付款选项](https://docs.y.uno/docs/sdks/customization/secure-fields/payment-secure-fields)。

对于商户创建的分期付款，您还可以通过以下任一方式为每个会话指定方案：

* 在[创建会话](https://docs.y.uno/zh-hans/reference/checkout-sessions/create-checkout-session.md)时使用 `plan_id`。
* 在[创建结账会话](https://docs.y.uno/zh-hans/reference/checkout-sessions/create-checkout-session.md)时使用 `plan structure`。

> [!CAUTION]
>
> **使用备用服务提供商的路由**
>
> 为银行卡支付方式设置[路由](https://docs.y.uno/zh-hans/docs/using-yuno/dashboard-overview/routing.md)时，请务必注意：如果您在使用分期付款时配置了备用服务提供商，当第一笔交易被拒绝时，我们会尝试进行备用支付。因此，务必确保两个服务提供商都支持您账户设置的分期付款期数。如果不支持，您可以为每种场景设置不同的路由以避免问题。


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