> For the complete documentation index, see [llms.txt](https://docs.coda.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.coda.co/https-coda-payments.gitbook.io-zhong-wen-coda-private-technical-documentation/codapay/tokenization-api-2.0.md).

# Tokenization API 2.0

Tokenization幫助您收集客户授权并通过 Codapay 提供的支付渠道进行一键点击 (one-click) 或订阅来启用后续付款的一种方式。因此，Codapay 将提供所有必要的方法，以便您能够保存用户的付款方式，并在需要时方便地向用户收费。

## Tokenization 如何运作？

对于每个支持Tokenization的支付渠道，Codapay 提供了四个核心功能：

1. 保存用户付款信息
2. 向用户收费
3. 查询收费状态
4. 一键点击 (one-click) 或发起定期收费（订阅）

## 此文档包含哪些新消息？

| 版本  | 更新日期       | 备注                                                                    |
| --- | ---------- | --------------------------------------------------------------------- |
| 2.0 | 28.07.2023 | <ul><li>API 初始文档</li></ul>                                            |
| 2.1 | 28.11.2023 | <ul><li>添加 Mada</li><li>Webhook 请求头</li><li>新增扣款用户操作</li></ul>        |
| 2.2 | 28.02.2024 | <ul><li>添加 DANA Wallet</li><li>修改了电子邮件验证流程</li><li>新增账户解绑流程</li></ul> |

## 定义和概念

<details>

<summary>Shopper</summary>

Shopper ID 是分配给客户的唯一标识符。您可以通过调用 shopper 端点来生成一个 shopper。Shopper 可以通过以下信息进行识别：

* **Shopper ID**（由 Coda 生成）
* **Partner Shopper ID**（对应于您自己的客户标识符）
* **电子邮件地址**
* **电话号码**
* **状态码**（激活/未激活）

</details>

<details>

<summary>Payment Method</summary>

支付方式ID是链接购物者和付款方式的独特识别码。您可以在[此处](/https-coda-payments.gitbook.io-zhong-wen-coda-private-technical-documentation/codapay/ji-cheng-zhi-nan/zhi-fu-qu-dao-xin-xi/tokenization-api-2.0.md)参考可用付款方式的列表。支付方式可以通过以下信息来识别：

* 付款方式 ID（Coda 将生成）
* 购物者 ID（您最初使用 Coda 生成的）
* 类型（对应支付方式名称，例如Go-Pay、card）
* 具体支付方式详情（参见支付方式详情章节）

</details>

<details>

<summary>Token</summary>

Token ID是链接支付方式和Token的独特识别码。Token 可以通过以下信息来识别：

* Token ID（Coda 将生成）
* 支付方式 ID（您最初使用 Coda 生成的）
* Token状态（有效或过期）

</details>

<details>

<summary>Charge</summary>

**Charge ID** 是用于标识收费交易的唯一标识符。Charge 可以通过以下信息进行识别：

* **Charge ID**（由 Coda 生成）
* **Token ID**（您最初与 Coda 生成的令牌）
* **产品详情**（商品名称）
* **收费金额**
* **状态**（收费是否成功）

</details>

<details>

<summary>Subscription Plan</summary>

**Subscription Plan** 可通过以下信息进行识别：

* **Subscription Plan ID**（由 Coda 生成）
* **周期性收费金额**
* **重复周期**（每 X 周/月/季度/年）

</details>

<details>

<summary>Subscription</summary>

**Subscription** 可通过以下信息进行识别：

* **Subscription Plan ID**（订阅计划标识符）
* **Token ID**（您最初与 Coda 生成的令牌）

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.coda.co/https-coda-payments.gitbook.io-zhong-wen-coda-private-technical-documentation/codapay/tokenization-api-2.0.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
