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

# 创建无参考退款

> 创建无参考退款（独立贷记）。

此请求用于创建无参考退款：一笔直接推送到支付方式、且不引用原始支付交易的贷记。

> [!NOTE]
>
> **何时使用无参考退款**
>
> 当原始扣款是在 Yuno 之外处理的（旧版计费系统、外部订阅引擎），或者您需要发送善意补偿/促销贷记时，请使用此 endpoint。如需冲正通过 Yuno 捕获的支付，请改用[通过交易进行支付退款的 endpoint](https://docs.y.uno/zh-hans/reference/payments/refund-payment.md)。
>
> 服务提供商账户必须允许无参考退款。部分服务提供商按商户账户启用此功能（例如 Adyen），因此在使用此 endpoint 之前，请先与服务提供商确认。

> [!NOTE]
>
> **服务提供商原始数据**
>
> `provider` 对象在两个字段中携带与服务提供商之间未经改动的交互数据。这两个字段的结构由服务提供商而不是 Yuno 定义，因此会因服务提供商和操作而异。
>
> | 字段 | 内容 | 可用性 |
> | - | - | - |
> | `raw_request` | Yuno 发送给服务提供商的确切 payload。 | 适用于已启用服务提供商原始数据的账户。如需申请访问权限，请联系您的 Yuno 客户经理。否则省略。 |
> | `raw_response` | 服务提供商返回的完整 payload。 | 此 endpoint 不返回。请使用[按 ID 检索无参考退款](https://docs.y.uno/zh-hans/reference/unreferenced-refunds/retrieve-unreferenced-refund-by-id.md)并设置 `include_raw_responses=true` 来获取。 |
>
> `raw_response_code` 和 `raw_response_message` 是服务提供商响应的摘要，始终会返回，与上述两个字段无关。

**public-api-key** `string` *required*

您账户的唯一公共 API 密钥。您可以在 [Yuno Dashboard](https://dashboard.y.uno/) 上找到它。

**private-secret-key** `string` *required*

您账户的唯一私有密钥。您可以在 [Yuno Dashboard](https://dashboard.y.uno/) 上找到它。

**X-Idempotency-Key** `string` *required*

用于安全重试请求的唯一 UUID v4 标识符。使用相同的键重试会返回最初创建的退款。

**account\_id** `string` *required*

账户的唯一标识符。您可以在 [Yuno Dashboard](https://dashboard.y.uno/) 上找到此信息（UUID，36 个字符）。

**merchant\_order\_id** `string` *required*

您内部贷记/退款的唯一标识符（MAX 255; MIN 3）。

**merchant\_reference** `string`

可选的关联 ID。默认为 `merchant_order_id`（MAX 255; MIN 3）。

**description** `string` *required*

退款的描述。显示在 Dashboard 和对账单上（MAX 255; MIN 3）。

**country** `string` *required*

必须处理该退款的国家/地区（MAX 2; MIN 2; [ISO 3166-1](https://docs.y.uno/zh-hans/reference/country-reference.md)）。决定服务提供商路由。

**amount** `object` *required*

指定退款金额对象，包括金额和币种。

**属性**

**value** `number` *required*

退款金额（0.0001 的倍数）。必须大于 0。

**currency** `string` *required*

退款使用的币种（MAX 3; MIN 3; [ISO 4217](https://docs.y.uno/zh-hans/reference/country-reference.md)）。

**provider\_data** `object`

将退款固定到特定的 gateway，绕过路由规则。当目标服务提供商由原始支付的处理位置决定时，此字段很有用。

**属性**

**id** `string` *required*

服务提供商标识符。允许的值：`ADYEN`、`STRIPE`、`NUVEI`、`BRAINTREE`、`GOCARDLESS`、`ORBITAL`、`WORLDPAY`、`VANTIV`、`CARDCONNECT`、`FISERV_COMMERCEHUB`、`MONERIS`、`NMI`、`FIRSTDATA`、`WINDCAVE`、`SAFERPAY`、`JPM`、`PAYPAL_EXPRESS_CHECKOUT`、`MASTERCARD`、`CITI`、`WELLSFARGO`、`SAGEPAY`、`FATZEBRA`、`HELIX`、`24HF`、`MERCHANTE_SOLUTIONS`、`ANB`、`AUTHORIZE_NET`、`SPECTRUM`。

**connection\_id** `string`

将退款固定到该服务提供商内特定的 PSP 连接（UUID）。当服务提供商有多个连接且贷记必须指向确切的某一个连接时（例如计费迁移），请使用此字段。必须与 `id` 一起发送；不带 `id` 的 `connection_id` 会被拒绝，并返回 `400`。

**payment\_method** `object` *required*

指定退款的目标地址：存储令牌、原始卡、银行转账或钱包。必须且只能设置 `vaulted_token` 或 `detail.<card|wallet|bank_transfer>` 中的一个。

**属性**

**vaulted\_token** `string`

Yuno 侧对先前存储的支付方式的 vault 引用。首选方式，可将 PCI 范围降至最低。

**detail** `object`

内联支付方式详情。在您没有存储令牌时使用。必须且只能填充一个子对象：`card`、`wallet` 或 `bank_transfer`。

**属性**

**card** `object`

当您需要将退款推送到原始卡时使用（Yuno 会在边缘加密 PAN）。

**属性**

**card\_data** `object` *required*

**属性**

**number** `string` *required*

卡号（PAN）。在边缘加密。

**holder\_name** `string` *required*

卡面上显示的姓名。

**expiration\_month** `integer` *required*

卡片有效期月份（1 到 12）。

**expiration\_year** `integer` *required*

卡片有效期年份。

**security\_code** `string`

CVV/CVC。大多数收单机构的贷记不需要此字段。

**brand** `string` *required*

以下之一：`VISA`、`MASTERCARD`、`AMEX`、`DINERS`、`DISCOVER`、`JCB`、`UNIONPAY`、`UATP`、`ELO`、`HIPERCARD`、`MAESTRO`。

**type** `string`

卡片类型：`CREDIT`、`DEBIT`、`PREPAID`。

**soft\_descriptor** `string`

持卡人对账单上显示的文本（MAX 255）。

**stored\_credentials** `object`

用于定期贷记流程的存储凭证元数据。与 `/v1/payments` 使用相同的结构。

**network\_token** `object`

退款到令牌化的网络凭证时使用的网络令牌元数据（Visa Token Service/Mastercard MDES）。

**bank\_transfer** `object`

用于 SEPA/IBAN、ACH 和 GoCardless 委托退款。

**属性**

**provider\_token** `string`

服务提供商侧对已有银行对象的引用。**GoCardless 必填**：携带 `mandate_id`（例如 `MD000ABCDEF123`）。提供此字段时，`bank_account` 和 `bank_id` 为可选。

**bank\_account** `string`

IBAN（SEPA）或账号（ACH/本地）。未提供 `provider_token` 时必填。

**bank\_id** `string`

BIC/SWIFT（非 SEPA 的欧盟通道）或 ABA-9 路由号码（ACH）。ACH 必填。

**account\_type** `string` *required*

以下之一：`IBAN`、`CHECKING`、`SAVINGS`、`CLABE`、`CCI`、`LOCAL`、`MANDATE`。

**beneficiary\_name** `string` *required*

账户上的收款方姓名。

**beneficiary\_type** `string`

`INDIVIDUAL` 或 `ENTITY`。

**beneficiary\_document** `object`

收款方的税号/国民身份证号。ACH（SSN/EIN）以及 LATAM 类 SEPA 通道必填。

**属性**

**document\_type** `string`

例如 SSN、EIN

**document\_number** `string`

例如 123-45-6789

**wallet** `object`

用于 PayPal Express Checkout 退款。

**属性**

**payment\_token** `string` *required*

收款方的 PayPal `payerID`。

**customer\_payer** `object`

指定退款的收款方。对于 ACH、SEPA 和 PayPal 目标地址，此字段为必填，以满足 OFAC 和 AML 筛查要求。

**属性**

**id** `string`

现有的 Yuno 客户 UUID。可替代内联提供客户 PII。

**merchant\_customer\_id** `string`

您的外部客户标识符。

**first\_name** `string`

收款方的名字。

**last\_name** `string`

收款方的姓氏。

**email** `string`

收款方的 email 地址。

**phone** `object`

`{ country_code, number, extension }`。

**document** `object`

国民身份证件。`{ document_type, document_number }`。

**date\_of\_birth** `string`

YYYY-MM-DD。

**nationality** `string`

ISO 3166-1 alpha-2 国家/地区代码。

**ip\_address** `string`

收款方的 IP 地址（如已知）。

**billing\_address** `object`

邮政地址。

**shipping\_address** `object`

与 `billing_address` 结构相同。

**type** `string`

`INDIVIDUAL` 或 `ENTITY`。

**business\_name** `string`

当 `type = ENTITY` 时必填。

**metadata** `array of objects`

可选的键值对列表，供您自己参考。会在响应和 webhook payload 中原样返回。

**属性**

**key** `string`

自由格式的标签。

**value** `string`

自由格式的值。最多 512 个字符。

**callback\_url** `string`

Yuno 为此退款发送 webhook 事件的 HTTPS URL。如果省略，则回退到您账户级别的 webhook。

**fraud\_screening** `object`

当 `stand_alone: true` 时，Yuno 会在提交给服务提供商之前运行 ML 欺诈检查。建议用于原始卡退款。

**属性**

**stand\_alone** `boolean`

当为 `true` 时，在提交给服务提供商之前执行欺诈检查。

```json Example request theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
{
  "account_id": "9f6e0a4c-1d2b-4e3f-8a9b-1c2d3e4f5a6b",
  "merchant_order_id": "REFUND-2026-05-14-001",
  "merchant_reference": "credit-note-7891",
  "description": "Subscription correction — duplicate charge",
  "country": "US",
  "amount": {
    "value": 25.00,
    "currency": "USD"
  },
  "provider_data": {
    "id": "STRIPE",
    "connection_id": "8821cf99-89a5-4ecb-aba9-149cb08624fa"
  },
  "payment_method": {
    "vaulted_token": "550e8400-e29b-41d4-a716-446655440000"
  },
  "customer_payer": {
    "id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
    "merchant_customer_id": "cust_4521",
    "first_name": "John",
    "last_name": "Doe",
    "email": "john@example.com"
  },
  "metadata": [
    { "key": "billing_cycle_id", "value": "bc_2026_05" },
    { "key": "support_ticket", "value": "ZD-99214" }
  ],
  "callback_url": "https://merchant.example.com/yuno/webhooks/refunds"
}
```

```json 201 - Refund created theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
{
  "id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
  "account_id": "9f6e0a4c-1d2b-4e3f-8a9b-1c2d3e4f5a6b",
  "merchant_order_id": "REFUND-2026-05-14-001",
  "merchant_reference": "credit-note-7891",
  "country": "US",
  "description": "Subscription correction — duplicate charge",
  "amount": {
    "value": 25.00,
    "currency": "USD"
  },
  "status": "CREATED",
  "sub_status": "CREATED",
  "payment_method": {
    "vaulted_token": "550e8400-e29b-41d4-a716-446655440000",
    "detail": {
      "card": {
        "card_data": {
          "brand": "VISA",
          "last_four": "1111",
          "type": "CREDIT"
        }
      }
    }
  },
  "customer_payer": {
    "id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
    "merchant_customer_id": "cust_4521",
    "first_name": "John",
    "last_name": "Doe"
  },
  "provider": {
    "name": "STRIPE",
    "type": "PSP",
    "connection_id": "6ba7b811-9dad-11d1-80b4-00c04fd430c8",
    "reference": "re_3OqQz92eZvKYlo2C0g6XK1Yj",
    "category": "APPROVED",
    "raw_response_code": "succeeded",
    "raw_request": {
      "amount": 2500,
      "currency": "usd",
      "payment_method": "pm_1OqQz92eZvKYlo2C7Kx9Vbnm",
      "metadata": { "merchant_order_id": "REFUND-2026-05-14-001" }
    }
  },
  "metadata": [
    { "key": "billing_cycle_id", "value": "bc_2026_05" }
  ],
  "created_at": "2026-05-14T11:47:13.482Z",
  "updated_at": "2026-05-14T11:47:13.482Z"
}
```

```json 400 - Validation error theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
{
  "code": "VALIDATION_ERROR",
  "messages": [
    "One or more fields did not pass validation."
  ]
}
```

```json 422 - Routing or permission failure theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
{
  "code": "UNREFERENCED_REFUND_NOT_SUPPORTED",
  "messages": [
    "No provider supports this payment method for non-referenced refunds."
  ]
}
```


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