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

# 网络令牌

> 介绍网络令牌、其生命周期状态，以及如何将其集成到银行卡支付中。

网络令牌是支付处理行业的一项重大进步，可作为敏感支付卡详细信息（包括信用卡号）的数字替代品。这些令牌由 Visa、Mastercard 和 American Express 等支付网络签发，在我们不断发展的数字环境中，处于提升交易安全性的前沿。

![](https://mintcdn.com/yuno-3979e326/MTlogjS0_SlxtlJG/images/reference/network-tokens/image1.png?fit=max\&auto=format\&n=MTlogjS0_SlxtlJG\&q=85\&s=e79dcff533c1ec0022ecc0fe95b69909)

### 网络令牌的优势

* **增强安全性**：通过在交易过程中替代实际的卡数据，网络令牌在加强安全措施方面发挥着关键作用，可显著降低遭受潜在欺诈的风险。
* **无缝集成**：只需遵循 EMVCo 网络令牌标准进行少量集成工作，我们的解决方案即可确保无缝、高效的实施流程，从而快速适应各种支付场景。
* **自动更新**：网络令牌由卡组织自动管理和更新，有助于减少购物者摩擦和被拒绝的支付。这种内在的适应性确保了比未使用网络令牌的交易更高的授权率。
* **认证支持**：为提升安全性和批准率，您可以将网络令牌与 [Network Token Authentication](https://docs.y.uno/zh-hans/docs/payment-features/network-token-authentication.md) 结合使用，直接通过卡组织实现基于通行密钥的购物者认证。

## 一次性令牌、vault 令牌与网络令牌

| 一次性令牌 | Vault 令牌 | 网络令牌 |
| :- | :- | :- |
| 使用 Yuno SDK 时，无论客户选择哪种支付方式，我们都会收集处理支付所需的全部信息，并将其存储在一次性令牌中。您将在创建支付时使用该令牌。请注意，此令牌只能使用一次。您需要为创建的每个结账会话生成新的一次性令牌。 | Vault 令牌由 Yuno 在支付方式完成注册并与客户信息一起存储后创建。您可以使用创建的 vault 令牌，在未来的支付中识别该支付方式。 | 敏感支付卡信息（例如信用卡号）的数字化表示，由 Visa、Mastercard 或 American Express 等主要支付网络签发。这些令牌用于在交易中替代实际的卡数据，从而通过尽量减少暴露于潜在欺诈活动的风险来增强安全性。 |

启用网络令牌功能后，Yuno 会为所有已注册并安全存储在我们 vault 中的卡生成网络令牌。此方法完全符合 Visa 和 Mastercard 在卡验证之后对网络令牌化预期工作方式的定义，可确保在定期交易和未来交易中获得更好的性能、安全性和可靠性。未存储在 Yuno 中的卡（例如一次性使用的卡）自然不在此流程之内，因为网络令牌化不适用于这些情况。

> [!NOTE]
>
> **重复注册**
>
> 如果同一张卡被多次注册，每次注册都会创建一个不同的 `vaulted_token`。对于网络令牌，Yuno 使用 `network_token_fingerprint`，其作用类似于卡 fingerprint，范围限定于您的组织以及 PCI vault 中网络令牌的唯一标识符。这意味着同一 PAN 的重复注册可以映射到同一个网络令牌。请使用[卡 fingerprint](https://docs.y.uno/zh-hans/docs/security-and-compliance/fingerprint.md) 在您这一侧检测 vault 令牌的重复项。

## 网络令牌生命周期

网络令牌可能具有以下部分所述的状态。

![](https://mintcdn.com/yuno-3979e326/MTlogjS0_SlxtlJG/images/reference/network-tokens/image2.png?fit=max\&auto=format\&n=MTlogjS0_SlxtlJG\&q=85\&s=04370c1dbecd23d39f77b5f6b41eeb2c)

| 状态 | 描述 |
| - | - |
| Created | 已创建的网络令牌的初始状态。 |
| Active | 网络令牌处于活动状态，可用于进行支付。 |
| Suspended | 如果持卡人联系发卡机构并要求阻止来自特定商户的支付，令牌可能会被暂停。 |
| Canceled | 令牌可能因各种原因被取消，例如与令牌关联的持卡人账户已关闭。 |

## 集成类型

要使用网络令牌进行支付，您有两个可用选项：

1. 让 Yuno 配置并收集网络令牌。
2. 使用您现有的网络令牌。

### 让 Yuno 配置并收集网络令牌

我们从领先的卡组织（包括 Visa、Mastercard 和 American Express）获取网络令牌。这些令牌安全地存储在 Yuno 基础设施中，并在授权过程中代替实际的卡使用。

当 Yuno 代表您管理令牌的申请和积累时，您无需进行额外集成即可获得网络令牌化的优势。只需遵循与您特定的银行卡支付集成相对应的标准支付流程即可。Yuno 会无缝处理该流程，用网络令牌替代卡详细信息，从而提高授权率。

要启用使用网络令牌的支付，请联系我们的支持团队，以配置或请求所需的凭证。

#### 响应示例

在注册或创建支付期间，您将收到相应操作中所用网络令牌的基本信息。

```json theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
{
    "description": "Test",
    "account_id": "{{account-code}}",
    "merchant_order_id": "0000023",
    "country": "DE",
    "merchant_reference" : "reference-{{$randomUUID}}",
    "amount": {
        "currency": "EUR",
        "value": 5000
    },
    "customer_payer": {
        "id":"967ecd18-d898-4b88-9400-dd5b01b18edc"
    },
    "workflow": "DIRECT",
    "payment_method": {
        "type":"CARD",
        "vaulted_token": "61d49d6e-7c0e-49d0-be79-7eb08871f998",
        "detail": {
           "card": {
               "network_token":{
                  "network":"MASTERCARD",
                  "status": "ACTIVE",
                  "par":"V0010014622074319305424002620",
                  "token_data":{
                    "iin":"45079900",
                    "lfd": "0010",
                    "expiration_month":"10",
                    "expiration_year":"2028",
                    "response":{
                      "code":"succeeded",
                      "message": "Transaction Succeeded"
                    }
                  }
              }
           }
        }
    }
  [...]
}
```

#### 按卡选择

The optional boolean `payment_method.network_token` lets you decide, per card, whether Yuno uses a network token. Send it on [Create Payment](https://docs.y.uno/reference/payments/create-payment.md) and on card enrollment ([Checkout flow](https://docs.y.uno/reference/payment-methods-checkout/enroll-payment-method-checkout.md) and [Direct API](https://docs.y.uno/reference/payment-methods-direct-workflow/enroll-payment-method-api.md)).

| `payment_method.network_token` | Payment | Card enrollment |
| - | - | - |
| `false` | Yuno never requests or reuses a network token: the PAN goes to the provider, even when the route has the network token toggle on. A token already stored for the card is kept, not deleted. | Yuno does not provision a network token for the card, including the migration path for cards enrolled without CVV. |
| `true` | On a vaulted card (`vaulted_token`, or `vault_on_success: true`), Yuno uses the card's network token, or provisions one, even when the route has the network token toggle off. | Yuno provisions a network token for the card, as it does today. |
| Omitted | The route decides, as today: the network token is used only when the route has the toggle on. | Yuno provisions a network token as today. |

The field is gated by network token onboarding: `true` only has an effect when your organization is onboarded to network tokens for the card's network and the provider supports them. When it is not, the request does not fail; the payment goes with the PAN.

The field has no effect on:

* Guest (non-vaulted) cards, which never get a network token.
* Wallet payments (Apple Pay, Google Pay, Samsung Pay).
* Network tokens you send yourself with their cryptogram (merchant external network tokens).

布尔值 `payment_method.network_token` 是一个请求选项。它与 `payment_method.detail.card.network_token` 对象是不同的字段，后者承载上方响应示例中显示的令牌数据，以及您自行发送的网络令牌（请参阅下一部分）。

```json theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
{
    "payment_method": {
        "type": "CARD",
        "vaulted_token": "61d49d6e-7c0e-49d0-be79-7eb08871f998",
        "network_token": false
    }
}
```

### 使用您现有的网络令牌

在您的 Yuno 账户中设置好所需的凭证并联系我们的支持团队后，您就可以无缝执行令牌化交易。

> [!CAUTION]
>
> 使用此选项时，Yuno 仅作为网络令牌信息的透传方。商户必须提供有关网络令牌的必要信息，以便 Yuno 将其分享给上游支付合作伙伴。

网络令牌交易使用现有的支付交易 API 请求。与使用信用卡详细信息创建支付类似，当商户使用 Yuno API 完成支付时，可以选择包含“network\_token”对象，以便在交易中使用网络令牌。

#### 支付请求字段

除 `card_data` 对象外，使用 Yuno API 发送支付时，还应将以下字段添加到 `payment_method.detail.card.network_token.token_data` 对象中。

| 字段 | 类型 | 描述 |
| - | - | - |
| `number` | number | \[必填]：令牌号码，不含任何分隔符。（最大 19；最小 8）仅适用于通过 PCI 认证的商户 |
| `holder_name` | string | 令牌上显示的持卡人全名（最大 26；最小 2），仅适用于通过 PCI 认证的商户 |
| `expiration_month` | integer | \[必填]：令牌的到期月份，MM（最大 2；最小 2），仅适用于通过 PCI 认证的商户 |
| `expiration_year` | integer | \[必填]：令牌的到期年份，YYYY（最大 4；最小 4），仅适用于通过 PCI 认证的商户 |
| `cryptogram` | string | \[必填]：发卡机构为交易中使用的网络令牌生成的唯一密文。对于定期交易为可选项 |
| `electronic_commerce_indicator` | string | \[仅部分服务提供商需要]：如果令牌已通过 Mastercard 认证，则应将该字段设置为 02。对于 Visa 或未经认证的令牌，无需发送该字段。 |
| `token_requestor_id` | string | \[仅部分服务提供商需要]：商户的令牌请求方 ID |

#### 请求示例

```json theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
{
  "description": "Test",
    "account_id": "{{account-code}}",
    "merchant_order_id": "0000023",
    "country": "DE",
    "merchant_reference" : "reference-{{$randomUUID}}",
    "amount": {
        "currency": "EUR",
        "value": 5000
    },
    "customer_payer": {
        "id":"967ecd18-d898-4b88-9400-dd5b01b18edc"
    },
    "workflow": "DIRECT",
    "payment_method": {
        "type":"CARD",
        "detail": {
           "card": {
             "card_data": {
                "number": "4000000000001026",
                "holder_name": "John Doe",
                "expiration_month": 1,
                "expiration_year": 26,
                "security_code": "123"
              },
             "network_token":{
                  "token_data":{
                    "number":"4000000000001026",
                    "holder_name":"Jhohn Doe",
                    "expiration_month":1,
                    "expiration_year":26,
                    "cryptogram":"CCADBxYzRTBBXXXXXXXYZa0AbZD"
                  }
              }
           }
        }
    }
  [...]
}
```

#### 响应示例

```json theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
{
    "description": "Test",
    "account_id": "{{account-code}}",
    "merchant_order_id": "0000023",
    "country": "DE",
    "merchant_reference" : "reference-{{$randomUUID}}",
    "amount": {
        "currency": "EUR",
        "value": 5000
    },
    "customer_payer": {
        "id":"967ecd18-d898-4b88-9400-dd5b01b18edc"
    },
    "workflow": "DIRECT",
    "payment_method": {
        "type":"CARD",
        "detail": {
           "card": {
              "card_data": {
                        "holder_name": "John Doe",
                        "iin": "48710499",
                        "lfd": "9910",
                        "number_length": 16,
                        "security_code_length": 3,
                        "brand": "VISABANCONTACT",
                        "issuer_name": "BNP PARIBAS FORTIS NVSA",
                        "issuer_code": null,
                        "country_code": "BE",
                        "category": "CLASSIC",
                        "type": "DEBIT",
                        "expiration_month": 3,
                        "expiration_year": 30,
                        "fingerprint": "4d486017-afa0-4f2c-ba51-a09af528bd38"
                        [...]
                    }, 
              "network_token":{
                  "network":"MASTERCARD",
                  "status": "ACTIVE",
                  "par":"V0010014622074319305424002620",
                  "token_data":{
                    "iin":"45079900",
                    "lfd": "0010",
                    "holder_name":"Jhohn Doe",
                    "expiration_month":10,
                    "expiration_year":28,
                    "response":{
                      "code":"succeeded",
                      "message": "Transaction Succeeded"
                    }
                  }
              }
           }
        }
    }
  [...]
}
```


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