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

# 交易重试

> 在 96 小时内自动重试失败的捕获或退款交易，最多 7 次

Yuno 为商户提供重试捕获和退款交易的能力，适用于遇到错误或被服务提供商拒绝的交易。此功能旨在提高交易成功率并改善用户体验。在[捕获](https://docs.y.uno/reference/payments/capture-authorization.md)和[退款](https://docs.y.uno/reference/payments/refund-payment.md)请求中将 `simplified_mode` 字段设置为 `true` 后，Yuno 将在 96 小时内自动重试失败的交易，最多 7 次。系统在重试过程中会处理以下场景：

#### 捕获交易

捕获交易在重试过程中及重试之后可能出现多种状态。下表详细说明了这些状态：

| 重试进行中的支付 | 重试成功后的支付 | 重试失败后的支付 |
| :- | :- | :- |
| SUCCEEDED / CAPTURE\_RETRY\_IN\_PROCESS | SUCCEEDED / CAPTURED 或 PARTIALLY\_CAPTURED，取决于金额。 | SUCCEEDED / CAPTURE\_RETRY\_PROCESS\_FAILED |

#### 退款交易

退款交易在重试过程中及重试之后也有特定的状态。下表概述了这些状态：

| 重试进行中的支付 | 重试成功后的支付 | 重试失败后的支付 |
| :- | :- | :- |
| SUCCEEDED / REFUND\_RETRY\_IN\_PROCESS | REFUNDED / REFUNDED 或 SUCCEEDED / PARTIALLY\_REFUNDED，取决于金额。 | SUCCEEDED / APPROVED |

## 优势

此功能具有以下几项优势：

* **提高交易成功率**：自动重试提高了交易成功完成的可能性，从而带来更高的批准率。
* **改善用户体验**：通过自动重试失败的交易，减少用户摩擦，提升整体客户满意度和留存率。
* **提高运营效率**：自动执行重试尝试可减少对失败交易的人工干预，从而优化时间和资源，让团队专注于战略性任务。

## 重试方案

重试方案旨在通过在策略性间隔安排重试来最大限度地提高交易成功率。

下表描述了每次重试之间的间隔。请注意，每次重试都根据上一次尝试的时间进行安排，即重试之间的时间是累积的：

| 事件 | 首次尝试后的截止时间 |
| :- | :- |
| 第 1 次尝试 | - |
| 第 2 次尝试 | 5 分钟 |
| 第 3 次尝试 | 50 分钟 |
| 第 4 次尝试 | 6 小时 |
| 第 5 次尝试 | 24 小时 |
| 第 6 次尝试 | 48 小时 |
| 第 7 次尝试 | 96 小时 |

此表说明每次重试都根据自上一次尝试以来经过的时间执行，而不是自首次尝试以来的时间。例如，第 4 次重试发生在第 3 次重试之后 6 小时，而不是首次尝试之后 6 小时。整个计划总共跨越 7 天 7 小时。

## 示例

以下是使用简化模式的捕获授权和退款请求示例。

```Text Capture theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
curl --request POST \
     --url https://api-sandbox.y.uno/v1/payments/id/transactions/transaction_id/capture \
     --header 'X-Idempotency-Key: <Your X-Idempotency-Key>' \
     --header 'accept: application/json' \
     --header 'charset: utf-8' \
     --header 'content-type: application/json' \
     --header 'private-secret-key: <Your private-secret-key>' \
     --header 'public-api-key: <Your public-api-key>' \
     --data '
{
  "amount": {
    "currency": "JPY",
    "value": 300
  },
  "simplified_mode": true,
  "description": "Confirmed",
  "reason": "PRODUCT_CONFIRMED",
  "merchant_reference": "AAB01-432245"
}
'
```

```sh Refund theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
curl --request POST \
     --url https://api-sandbox.y.uno/v1/payments/id/transactions/transaction_id/refund \
     --header 'X-Idempotency-Key: <Your X-Idempotency-Key>' \
     --header 'accept: application/json' \
     --header 'charset: utf-8' \
     --header 'content-type: application/json' \
     --header 'private-secret-key: <Your private-secret-key>' \
     --header 'public-api-key: <Your public-api-key>' \
     --data '
{
  "simplified_mode": true,
  "description": "Refund",
  "reason": "REQUESTED_BY_CUSTOMER",
  "merchant_reference": "AAB01-432245"
}
'
```


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