> ## 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 中创建客户时生成的 `customer_id`（唯一的客户标识符）。客户会话可访问所有可用于注册的支付方式，您可以将这些支付方式提供给客户。

> [!NOTE]
>
> **可用的支付方式**
>
> 创建任一类型的会话（客户会话或结账会话）时，Yuno 系统都会返回所有已启用支付方式的列表。这些支付方式是您在 Yuno Dashboard 的 Connections 和 Checkout builder 部分中配置的。

有关如何使用**创建客户会话** endpoint 的更多详细信息，请参阅 [API 参考](https://docs.y.uno/reference/customer-sessions-enrollment/the-customer-session-object.md)。

## 结账会话

使用结账会话来创建支付或发起支付流程。客户每次进行支付时，您都必须创建一个新的会话。您需要在 Yuno 中创建客户时生成的 `customer_id`（唯一的客户标识符）。结账会话可访问该客户的所有可用支付方式，无论这些支付方式之前是否已注册。结账会话在创建 2.5 小时后过期，更新会话不会延长该时间。

> [!NOTE]
>
> **在没有结账会话的情况下创建支付**
>
> 直接集成不需要 Yuno 的 SDK，因此您可以在没有结账会话的情况下创建支付。

有关如何使用**创建结账会话** endpoint 的更多详细信息，请参阅 [API 参考](https://docs.y.uno/reference/checkout-sessions/the-checkout-session-object.md)。


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