> 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/hou-duan-api-ji-cheng/hou-duan-fei-ka-pian-api-ji-cheng/hou-tai-api-diao-yong-liu-cheng-gai-lan/dian-zi-qian-bao.md).

# 电子钱包

## 电子钱包调用流程

<figure><img src="/files/9wF6qPG2IGSZwfrLqImJ" alt=""><figcaption></figcaption></figure>

对于电子钱包支付类型，商家将收到一个重定向链接，供用户完成支付。通常这个链接要么是深度链接（直接打开钱包应用），要么是重定向页面，用户需要填写一些额外信息并授权支付。

## 请求参数

<table><thead><tr><th width="148">参数</th><th width="95">类型</th><th width="116">长度</th><th>描述</th></tr></thead><tbody><tr><td>api_key</td><td>String</td><td>256</td><td><strong>必填</strong><br>Coda提供的API密钥 - 请参考 <a data-mention href="/pages/Knn2G4Gd1ZPSUbSS0PUS">/pages/Knn2G4Gd1ZPSUbSS0PUS</a> 了解如何获取。</td></tr><tr><td>project_id</td><td>String</td><td>10</td><td><strong>此字段仅适用于 v2.0 API，必填项</strong><br>由 Coda 提供的 Project ID，对每个标题产品都是唯一的。<br>请参阅 <a data-mention href="/pages/Knn2G4Gd1ZPSUbSS0PUS">/pages/Knn2G4Gd1ZPSUbSS0PUS</a> 了解</td></tr><tr><td>order_id</td><td>String</td><td>64</td><td><p><strong>必填</strong></p><p>您在支付请求发起时传递的订单ID</p></td></tr><tr><td>country</td><td>Number</td><td>N/A</td><td><strong>必填</strong><br>ISO 3166 的国家代码 <a data-mention href="/pages/7B3qZnefeSwkSs84sKuB">/pages/7B3qZnefeSwkSs84sKuB</a></td></tr><tr><td>lang</td><td>String</td><td>2</td><td><p><strong>必填</strong></p><p><a data-mention href="/pages/lumiE4ZV7er3NqdusLTc">/pages/lumiE4ZV7er3NqdusLTc</a></p></td></tr><tr><td>type</td><td>Number</td><td>1</td><td><p>1：数字内容物品</p><p>2：非数字内容物品</p></td></tr><tr><td>pay_type</td><td>Number</td><td>1</td><td><p><strong>必填</strong></p><p>运营商支电子钱包使用 <code>pay_type = 5</code>。<br><br>更多详情请参阅 <a data-mention href="/pages/9qMfw9ltzzDp2UjOhCld">/pages/9qMfw9ltzzDp2UjOhCld</a></p></td></tr><tr><td>pay_channel</td><td>Number</td><td>3</td><td>每个支付渠道的代码。</td></tr><tr><td>pay_at</td><td>Number</td><td>2</td><td><p>此字段指示客户应在哪里完成购买。</p><p></p><p>1 = 银行柜台<br>2 = 网络银行<br>3 = 在线账单支付<br>4 = 电子钱包<br>5 = 自动取款机<br>14 = 便利店</p></td></tr><tr><td>msisdn</td><td>Number</td><td>15</td><td><p><strong>可选</strong><br>MSISDN（未格式化；不包含国家代码）</p><p></p><p>仅在需要 MSISDN 而非电子邮件时包含此项。</p></td></tr><tr><td>email</td><td>String</td><td>128</td><td>仅在需要电子邮件而非 MSISDN 时包含此项。</td></tr><tr><td>merchant_name</td><td>String</td><td>128</td><td><p><strong>可选</strong><br>如果您希望指定商家名称，请在此字段中输入名称。</p><p><br>默认值为空。</p></td></tr><tr><td>items</td><td>ItemInfo</td><td>N/A</td><td><p><strong>必填</strong></p><p>用户购买的商品列表</p></td></tr><tr><td>items[].code</td><td>String</td><td>128</td><td><p><strong>必填</strong></p><p>商家的商品代码</p></td></tr><tr><td>items[].name</td><td>String</td><td>128</td><td><p><strong>必填</strong></p><p>商品名称，仅支持拉丁字符</p></td></tr><tr><td>items[].price</td><td>Number</td><td>N/A</td><td><strong>必填</strong><br>已含税的商品价格（已含税），以请求中指定的货币计价</td></tr><tr><td>items[].type</td><td>Number</td><td>N/A</td><td><strong>必填</strong><br>默认值=1</td></tr><tr><td>profile</td><td>Map</td><td>N/A</td><td><strong>必填</strong><br><a data-mention href="#profile-zi-duan">#profile-zi-duan</a></td></tr></tbody></table>

## Profile 字段

<table><thead><tr><th width="199">参数</th><th width="106">类型</th><th width="110">长度</th><th>描述</th></tr></thead><tbody><tr><td>user_id</td><td>String</td><td>128</td><td><p><strong>必填</strong></p><p>客户的用户 ID</p></td></tr><tr><td>client_ip</td><td>String</td><td>15</td><td><p><strong>可选</strong></p><p>客户的 IP 地址 (仅支持IPv4)</p></td></tr><tr><td>user_agent</td><td>String</td><td>512</td><td><p><strong>可选</strong></p><p>客户的用户代理数据（浏览器和操作系统的详细信息）</p></td></tr><tr><td>name</td><td>String</td><td>256</td><td><p><strong>可选</strong></p><p>用户的全名。</p></td></tr><tr><td>id_no</td><td>Number</td><td>14</td><td><p><strong>可选</strong></p><p>巴西/墨西哥/阿根廷的身份证明文件称为 CPF。</p></td></tr><tr><td>document_type</td><td>String</td><td>N/A</td><td><p><strong>可选</strong></p><p>用户文件类型：</p><p>a. Cédula de ciudadanía（公民身份证）。<br>b. Tarjeta de identidad del menor de edad（未成年人身份证）。<br>c. Cédula de extranjería（外国人身份证）。</p></td></tr><tr><td>document_number</td><td>Number</td><td>N/A</td><td><p><strong>可选</strong></p><p>CC - Cédula de ciudadanía（公民身份证）。</p><p>TI - Tarjeta de identidad del menor de edad（未成年人身份证）。</p><p>CE - Cédula de extranjería（外国人身份证）。</p></td></tr></tbody></table>

### v2.0 请求示例

{% tabs %}
{% tab title="带MSISDN 和电子邮件的示例" %}

```json
{
  "project_id": "1", //此字段仅适用于 2.0 API
  "country": "458",
  "api_key": "test_e944d44f065eade8157737385a09",
  "order_id": "<Your OrderID>",
  "lang": "en",
  "merchant_name": "Codapay",
  "type": "1",
  "pay_type": "5",
  "pay_channel": "-77",
  "email": "test@codapayments.com",
  "msisdn": "<Your Number>",
  "items": [
    {
      "code": "1",
      "name": "Test item",
      "price": 3.0
    }
  ],
  "profile": {
    "user_id": "12345"
  }
}
```

{% endtab %}

{% tab title="带用户姓名和身份证号的示例" %}

```json
{
  "project_id": "1", //此字段仅适用于 2.0 API
  "country": "458",
  "api_key": "test_e944d44f065eade8157737385a09",
  "order_id": "<Your OrderID>",
  "lang": "en",
  "merchant_name": "Codapay",
  "type": "1",
  "pay_type": "5",
  "pay_channel": "-77",
  "email": "test@codapayments.com",
  "msisdn": "<Your Number>",
  "items": [
    {
      "code": "1",
      "name": "Test item",
      "price": 3.0
    }
  ],
  "profile": {
        "name":"CodaUser",
        "user_id":"12345",
        "id_no":"88899988811"
  }
}
```

{% endtab %}

{% tab title="不带 MSISDN 和电子邮件的示例" %}

```json
{
  "project_id": "1", //此字段仅适用于 2.0 API
  "country": "458",
  "api_key": "test_e944d44f065eade8157737385a09",
  "order_id": "<Your OrderID>",
  "lang": "en",
  "merchant_name": "Codapay",
  "type": "1",
  "pay_type": "5",
  "pay_channel": "-77"
  "items": [
    {
      "code": "1",
      "name": "Test item",
      "price": 3.0
    }
  ],
  "profile": {
    "user_id": "12345"
  }
}
```

{% endtab %}

{% tab title="带身份证号和类型的示例" %}

```json
{
  "project_id": "1", //此字段仅适用于 2.0 API
  "country": "458",
  "api_key": "test_e944d44f065eade8157737385a09",
  "order_id": "<Your OrderID>",
  "lang": "en",
  "merchant_name": "Codapay",
  "type": "1",
  "pay_type": "5",
  "pay_channel": "255",
  "email": "test@codapayments.com",
  "msisdn": "<Your Number>",
  "items": [
    {
      "code": "1",
      "name": "Test item",
      "price": 300.0,
      "type": "0",
    }
  ],
  "profile": {
    "document_number": "1134568011",
    "user_id": "12345",
    "document_type": "CC"
  }
}
```

{% endtab %}
{% endtabs %}

### v1.0 请求示例

{% tabs %}
{% tab title="带MSISDN 和电子邮件的示例" %}

```json
{
    "api_key":"<YOUR API KEY>",
    "order_id":"<Your Order ID>",
    "lang":"en",
    "merchant_name":"Koko eBooks",
    "pay_type":"5",
    "pay_channel":"20",
    "type":"1",
    "msisdn":"<phone number>",
    "email":"<email address>" ,
    "items":[{
        "code":"456789",
        "name":"One Day",
        "price":1000.00
    }],
    "profile":{"user_id":"12345"}
}
```

{% endtab %}

{% tab title="带用户姓名和身份证号的示例" %}

```json
{
    "api_key": "<YOUR API KEY>",
    "order_id": "<Your Order ID>",
    "lang": "en",
    "merchant_name": "Koko eBooks",
    "type": "1",
    "pay_type": "5",
    "pay_channel": "98",
    "email": "test@codapayments.com",
    "msisdn": "123432",
    "items": [
        {
            "code": "1",
            "name": "One Day",
            "price": 3
        }
    ],
    "profile":{"name":"CodaUser","user_id":"12345","id_no":"88899988811"}
}js
```

{% endtab %}

{% tab title="不带 MSISDN 和电子邮件的示例" %}

```json
{
    "api_key":"<YOUR API KEY>",
    "order_id":"<Your Order ID>",
    "lang":"en",
    "merchant_name":"Koko eBooks",
    "pay_type":"5",
    "pay_channel":"39",
    "type":"1",
    "items":[{
        "code":"456789",
        "name":"One Day",
        "price":1000.00
    }],
    "profile":{"user_id":"12345"}
}
```

{% endtab %}

{% tab title="带身份证号和类型的示例" %}

```json
{
  "api_key": "<YOUR API KEY>",
  "order_id": "<Your Order ID>",
  "lang": "en",
  "pay_type": "5",
  "pay_channel": "255",
  "email": "test@codapayments.com",
  "type": "1",
  "merchant_name": "Koko eBooks",
  "items": [
    {
      "code": "1",
      "name": "Free Fire",
      "price": "1000.0",
      "type": "0",
    }
  ],
  "profile": {
    "document_number": "1134568011",
    "user_id": "12345",
    "document_type": "CC"
  }
}
```

{% endtab %}
{% endtabs %}

## 响应参数

<table><thead><tr><th width="153.33333333333331">参数</th><th width="141">类型</th><th width="94">长度</th><th>描述</th></tr></thead><tbody><tr><td>result_code</td><td>Number</td><td>N/A</td><td><p>ResultCode将帮助指示交易的状态。<br></p><p><code>ResultCode = 0</code> 表示交易成功。<br><br>错误代码列表请参阅 <a data-mention href="/pages/Ijfanb3Eb2mtXRsbF81n">/pages/Ijfanb3Eb2mtXRsbF81n</a></p></td></tr><tr><td>result_desc</td><td>String</td><td>512</td><td>如果resultCode返回错误，则该值描述错误信息。</td></tr><tr><td>txn_id</td><td>Number</td><td>N/A</td><td>支付请求发起返回的Coda订单ID。</td></tr><tr><td>txn_timeout</td><td>Number</td><td>N/A</td><td>交易超时时间（分钟）</td></tr><tr><td>total_price</td><td>Number</td><td>N/A</td><td>用户支付的总金额，以本地货币计价。</td></tr><tr><td>pay_instructions</td><td>String</td><td>15</td><td>如果响应返回了此值，商家应在页面上向客户显示提供的支付指引。</td></tr><tr><td>profile</td><td>Number</td><td>N/A</td><td>请参考 <a data-mention href="#profile-zi-duan-1">#profile-zi-duan-1</a></td></tr></tbody></table>

## Profile 字段

<table><thead><tr><th width="172">参数</th><th width="123">类型</th><th width="104.33333333333331">长度</th><th>描述</th></tr></thead><tbody><tr><td>extInfoByte</td><td>Number</td><td>N/A</td><td>请忽略此字段。</td></tr><tr><td>redirect_url</td><td>String</td><td>128</td><td><p>仅当所选支付渠道遵循重定向 URL 流程时，才返回支付网关的重定向 URL。</p><p></p><p>例如：泰国 Rabbit Line Pay。</p></td></tr><tr><td>merchantType</td><td>String</td><td>128</td><td>这请忽略此字段。</td></tr><tr><td>qr_code_url</td><td>String</td><td>128</td><td><p>仅当所选支付渠道支持 QR 码流程时，才会返回支付网关的 QR 码 URL。</p><p></p><p>例如：马来西亚 Touch &#x26; Go 电子钱包。</p></td></tr></tbody></table>

## 响应示例

{% tabs %}
{% tab title="带MSISDN 和电子邮件的示例" %}

```json
{
   "txn_id": <coda transaction ID>,
   "txn_timeout": 20,
   "result_code": 431,
   "result_desc": "Please wait a few minutes for your transaction to be completed. Need Help? Visit our <a href=“http://bit.ly/idCODAhelp” target=“_blank”>Help Center</a>.",
   "total_price": 1000.0,
   "pay_instructions": "",
   "profile": {
        "extInfoByte": "11",
        "user_id": "12345",
        "merchantType": "Codapay",
        "payment_code": ""
    }
}
```

{% endtab %}

{% tab title="带用户姓名和身份证号的示例" %}

```json
{
    "txn_id": <coda transaction ID>,
    "txn_timeout": 1445,
    "result_code": 431,
    "result_desc": null,
    "total_price": 3.03,
    "pay_instructions": "",
    "profile": {
        "extInfoByte": "0",
        "id_no": "88899988811",
        "user_id":"12345",
        "redirect_url": "https://homolog.latamgateway.com/picpay/finish/8053d22c-2e78-4c2d-bd20-da32014440f1",
        "payment_code": ""
    }
}
```

{% endtab %}

{% tab title="不带 MSISDN 和电子邮件的示例" %}

```json
{
    "txn_id": <coda transaction ID>,
    "txn_timeout": 11,
    "result_code": 0,
    "result_desc": null,
    "total_price": 1000.0,
    "pay_instructions": "",
    "profile": {
        "redirect_url": "https://linkaja/checkout/payment?message=LS0tLS1CRUdJTiBQR1AgTUVTU0FHRS0tLS0tClZlcnNpb246IEJDUEcgdjEu",
        "extInfoByte": "0",
        "payment_code": ""
    }
}
```

{% endtab %}

{% tab title="带身份证号和类型的示例" %}

```json
{
    "txn_id": <coda transaction ID>,
    "txn_timeout": 17,
    "result_code": 431,
    "total_price": 1000.0,
    "pay_instructions": "",
    "profile": {
        "extInfoByte": "0",
        "document_number": "1134568011",
        "user_id": "12345",
        "merchantType": "Codapay",
        "redirect_url": "https://cdn.safecharge.com/safecharge_resources/v1/validation-code-72309.html?notifyUrl=https%3A%2F%2Fapm.safecharge.com%2FApmConnector%2F8192341EAC1F4C9C3AAC718DA1F1AB22&locale=en_CO",
        "document_type": "CC",
        "payment_code": ""
    }
}
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %} <mark style="color:orange;">**USD 订单交易参考**</mark>&#x20;

请查看[此指南](/https-coda-payments.gitbook.io-zhong-wen-coda-private-technical-documentation/codapay/hou-duan-api-ji-cheng/hou-duan-fei-ka-pian-api-ji-cheng/usd-ding-dan-jiao-yi-gai-lan.md)，了解更多关于 USD 交易的信息。
{% endhint %}


---

# 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/hou-duan-api-ji-cheng/hou-duan-fei-ka-pian-api-ji-cheng/hou-tai-api-diao-yong-liu-cheng-gai-lan/dian-zi-qian-bao.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.
