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

# Card Account Updater

> 自动刷新已存储支付方式中过期或被替换的卡信息，以避免扣款失败

Card Account Updater（CAU）是 Yuno 提供的一项功能，用于维护已存储信用卡或借记卡的完整性，防止因卡信息过期或陈旧而导致的问题。当客户为定期账单或订阅服务提供卡信息时，Card Account Updater 可确保其存储的卡数据始终保持最新。使用 Yuno 的 Card Account Updater，无需任何额外开发工作：您的卡信息会在后台自动更新。

![Yuno Card Account Updater 示意图：Yuno 与 Visa、Mastercard 以及银行交换卡数据](https://mintcdn.com/yuno-3979e326/xfsBNkbN7r6yxkZH/images/reference/card-account-updater/image1.png?fit=max\&auto=format\&n=xfsBNkbN7r6yxkZH\&q=85\&s=3f1b613ac89da8a715d8cfe4f19303e4)

## Card Account Updater 的优势

* **提高支付成功率**：自动更新卡信息可降低因卡过期或被替换而导致交易失败的可能性，从而提高定期支付的成功率。
* **提升客户体验**：服务不会中断，客户无需手动更新卡信息，体验更加顺畅、积极。
* **降低运营成本**：自动更新减少了人工干预以及与支付问题相关的客服咨询，节省时间和资源。
* **增加收入**：更高的交易批准率意味着更少的漏收款项，并可能带来更多收入。
* **安全与合规**：在 vault 中集中进行卡更新，可确保敏感卡信息得到安全处理，并符合相关法规和标准。
* **运营效率**：简化卡信息更新流程，有助于在各支付系统之间保持运营效率和一致性。
* **客户留存**：尽量减少因支付失败造成的服务中断，有助于维持客户忠诚度和留存率。

## 工作原理

Card Account Updater 服务以异步方式运行，独立于支付流程。卡更新会自动执行，因此无需处理该服务返回的单个响应。

Yuno 会在以下情况下更新卡信息：

* 卡已过有效期。
* 与该卡关联的账户处于关闭、停用或被标记状态。

当卡的有效期已过时，Yuno 可以更新全部卡信息，也可以仅更新有效期。具体采用哪种方式，取决于发卡机构的换卡做法。

卡更新后，Yuno 会发送 webhook 通知您该变更。**已注册卡的 `vaulted_token` 和 `fingerprint` 将保持不变，因此您无需对集成做任何更改**。此 webhook 将包含以下内容：

* 最新的有效期、卡号后四位以及发卡机构识别号（IIN）。
* 更新原因。
* 被替换卡的详细信息。

以下代码块展示了一个通知示例：

```json theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
{
  "type": "enrollment",
  "type_event": "enrollment.update",
  "account_id": "493e9374-510a-4201-9e09-de669d75f256",
  "retry": 0,
  "version": 2,
  "data": {
    "payment_method": {
      "id": "03c3aae1-ed42-4be6-bc24-de5487f58491",
      "account_id": "493e9374-510a-4201-9e09-de669d75f256",
      "name": "VISA ****1111",
      "description": "VISA ****1111",
      "type": "CARD",
      "category": "CARD",
      "country": "CO",
      "status": "ENROLLED",
      "customer_id": "2f38972e-2427-43b7-95be-ee4cf21cef1b",
      "created_at": "2024-09-10T15:04:10.453741Z",
      "updated_at": "2024-09-10T15:04:10.453745Z",
      "enrollment": {
        "session": null,
        "sdk_action_required": false
      },
      "verify": {
        "vault_on_success": false,
        "currency": null,
        "payment": null
      },
      "detail": {
        "card": {
          "holder_name": "John Doe",
          "expiration_month": 3,
          "expiration_year": 26,
          "iin": "41111111",
          "lfd": "1111",
          "security_code_length": 3,
          "number_length": 16,
          "brand": "VISA",
          "issuer_name": "JPMORGAN CHASE BANK N A",
          "issuer_code": null,
          "type": "CREDIT",
          "category": "CREDIT",
          "country_code": "US",
          "country_name": "United States of America",
          "fingerprint": "d244e20d-43a1-43f7-9b48-0a76423be35e",
          "created_at": "2024-09-10T15:04:10.453799Z",
          "updated_at": "2024-09-10T15:04:10.453800Z"
        },
        "card_data_history": [
         {
          "holder_name": "John Doe",
          "expiration_month": 3,
          "expiration_year": 24,
          "iin": "4222222",
          "lfd": "2222",
          "security_code_length": 3,
          "number_length": 16,
          "brand": "VISA",
          "issuer_name": "JPMORGAN CHASE BANK N A",
          "issuer_code": null,
          "type": "CREDIT",
          "category": "CREDIT",
          "country_code": "US",
          "country_name": "United States of America",
          "fingerprint": "d244e20d-43a1-43f7-9b48-0a76423be35e",
          "provider_data": {
                 "id": "MASTERCARD",
                 "status": "UPDATED"
          },
          "created_at": "2024-09-10T15:04:10.453799Z",
          "updated_at": "2024-09-10T15:04:10.453800Z"
        }
       ]
      }
    }
  }
}

```

## 按卡控制 Account Updater

默认情况下，当您的账户启用 Card Account Updater 后，该账户下注册的每张符合条件的卡都会自动保持最新。您可以在注册时使用 `account_updater` 字段，针对单张卡覆盖此行为：

* 将 `account_updater` 设置为 `false`，即可将该卡**排除**在 Card Account Updater 之外。该卡将不会收到自动的卡信息更新。
* 省略该字段（或将其设置为 `true`），即可让该卡沿用您账户的 Card Account Updater 配置。

通过[注册支付方式](https://docs.y.uno/reference/payment-methods-direct-workflow/enroll-payment-method-api.md) endpoint（Direct 工作流）或 SDK 注册流程注册卡时，以及在支付过程中将卡存入 vault 时于[创建支付](https://docs.y.uno/zh-hans/reference/payments/create-payment.md)请求的 `payment_method` 对象中，均可使用 `account_updater` 字段。

## 批量注册已存储的卡

对于在启用 Card Account Updater 之前已存储的卡（或注册时被排除的卡），您可以使用[为 Account Updater 注册已存储的卡](https://docs.y.uno/reference/payment-methods-direct-workflow/register-cards-for-account-updater-api.md) endpoint 批量注册。每个请求最多可发送 100 个支付方式 ID（`vaulted_token`）。验证同步进行，且要么全部通过、要么全部失败；注册则在后台异步执行。

## 支持的卡组织

Card Account Updater 目前支持 Visa 和 Mastercard。

## 激活 Card Account Updater

如需在您的 Yuno 账户中激活 Card Account Updater，请通过 [support@y.uno](mailto:support@y.uno) 联系 Yuno 支持团队。请注意，注册直接在卡组织处进行，新客户最多可能需要 10 个工作日。


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