> For the complete documentation index, see [llms.txt](https://docs.supefina.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.supefina.net/huan-ying-shi-yong-supefina-de-api-wen-dang/dai-shou-ju-he-shou-yin-tai/bi-lu.md).

# 秘鲁

### 目前支持的支付产品

1. Cash
2. Transfer

### 支付流程（具体支付方式的流程请查看代收列表中的文档）

1. 用户在商户网站进行下单付款.
2. 商户向Supefina发起API支付请求.
3. Supefina返回聚合收银台地址以及相关单号数据.
4. 用户在收银台上选择相关的支付方式并进行付款操作.
5. Supefina通知商户订单成功.

### 请求地址

<table data-full-width="true"><thead><tr><th width="135">环境名称</th><th>URL</th></tr></thead><tbody><tr><td>SandBox </td><td><mark style="color:blue;"><code>POST</code></mark><br>https://api.supefina.tech/api/supefina/transactions/payin</td></tr><tr><td><mark style="color:red;">正式环境</mark> </td><td><mark style="color:red;"><code>POST</code></mark><br><mark style="color:red;">https://api.supefina.net/api/supefina/transactions/payin</mark></td></tr></tbody></table>

### 请求参数

#### 请求头

<table data-full-width="true"><thead><tr><th>Key</th><th>Value</th></tr></thead><tbody><tr><td><code>Content-Type</code></td><td><code>application/json</code></td></tr></tbody></table>

#### 请求体

<table data-full-width="true"><thead><tr><th width="257">变量名</th><th width="104">类型</th><th width="100">必填</th><th width="428">描述</th></tr></thead><tbody><tr><td>countryId</td><td>String</td><td>是</td><td><p>国家编号<br>参照：<a href="/pages/17IKBEvxR4cpZue8BRdD#afwzp">字典表-国家编号</a></p><p>秘鲁：<code>PER</code></p></td></tr><tr><td>currency</td><td>String</td><td>是</td><td><p>币种<br>参照：<a href="/pages/17IKBEvxR4cpZue8BRdD#huo-bi-currency">字典表-货币</a></p><p>秘鲁索尔：<code>PEN</code></p></td></tr><tr><td>orderAmount</td><td>String</td><td>是</td><td>订单金额</td></tr><tr><td>payProduct</td><td>String</td><td>否</td><td><a href="/pages/17IKBEvxR4cpZue8BRdD#mfocd">支付类型</a><br>如果不传入则拉取商户配置下全部支付方式的收银台。<br>如果传入相关支付方式，则收银台上只展示对应的支付方式。<br><strong>注意：</strong><br><strong>如果此时传入没有配置的支付方式会返回异常信息。</strong></td></tr><tr><td>customerIdentification</td><td>String</td><td>是</td><td><p>用户证件号<br><code>00</code>：身份证（CC），8位<br><code>01</code>：外国人身份证（CE），大于9位<br><code>02</code>：税号，11位</p><p><code>03</code>：护照，大于9位</p><p><code>04</code>：离境证（PAR）<br><code>05</code>：军官证（LMI）</p><p>同一个证件号<code>customerIdentification</code>进行代收 不超过20次/天</p></td></tr><tr><td>customerIdentificationType</td><td>String</td><td>是</td><td><p>用户证件类型<br><code>00</code>：身份证（CC）<br><code>01</code>：外国人身份证（CE）</p><p><code>02</code>:   税号<br><code>03</code>：护照（PAS)<br><code>04</code>：离境证（PAR）<br><code>05</code>：军官证（LMI）</p></td></tr><tr><td>customerName</td><td>String</td><td>是</td><td>用户姓名</td></tr><tr><td>lastName</td><td>String</td><td>是</td><td>用户姓氏</td></tr><tr><td>customerPhone</td><td>String</td><td>是</td><td><p>用户电话,  9位数字</p><p>示例：975728895</p></td></tr><tr><td>customerEmail</td><td>String</td><td>是</td><td>用户邮箱</td></tr><tr><td>expireTimeL</td><td>Long</td><td>否</td><td>收银台过期时间（单位秒）<br><strong>1. 如果不传入默认12H</strong><br><strong>2.如果传入的时间小于3分钟或者大于7天，我们也会默认为12H</strong></td></tr><tr><td>merId</td><td>String</td><td>是</td><td>商户ID<br>商户ID获取路径：Supefina商户后台-商户管理-基本信息-商户ID</td></tr><tr><td>merOrderNo</td><td>String</td><td>是</td><td>商户订单号</td></tr><tr><td>description</td><td>String</td><td>是</td><td>付款相关描述</td></tr><tr><td>callbackUrl</td><td>String</td><td>否</td><td><p>回调地址</p><p>详见<a href="/pages/mfMq4AmXGJtMyIPchGsF">通知回调说明</a></p></td></tr><tr><td>checkOut</td><td>Boolean</td><td>是</td><td>拉取聚合收银台条件<br><strong>此模式下只支持传入true</strong></td></tr><tr><td>nonceStr</td><td>String</td><td>是</td><td>随机字符串<br>长度不能超过32位</td></tr><tr><td>sign</td><td>String</td><td>是</td><td>签名<br><a href="/pages/DR0Ieg3d88mBdWrXD882">具体参照：签名算法</a></td></tr></tbody></table>

### 请求示例

1. 开通全部支付方式 — 不传入payProduct

```json
{
    "customerIdentificationType": "00",
    "lastName": "xxxx",
    "merOrderNo": "20240920195501",
    "sign": "xxxxxx",
    "customerIdentification": "22345678",
    "countryId": "PER",
    "nonceStr": "20240920195501",
    "customerName": "xxxx",
    "customerPhone": "1234567890",
    "orderAmount": 100,
    "customerEmail": "123456@qq.com",
    "merId": "xxxxxxx",
    "checkOut": "true",
    "description":"supefina",
    "currency": "PEN",
    "callbackUrl": "xxxxxxxx"
}
```

2. 传入指定的支付方式

* payProduct：03

```json
{
    "customerIdentificationType": "00",
    "payProduct":"03",
    "lastName": "xxxx",
    "merOrderNo": "20240920195501",
    "sign": "xxxxxx",
    "customerIdentification": "22345678",
    "countryId": "PER",
    "nonceStr": "20240920195501",
    "customerName": "xxxx",
    "customerPhone": "1234567890",
    "orderAmount": 100,
    "customerEmail": "123456@qq.com",
    "merId": "xxxxxxx",
    "checkOut": "true",
    "description":"supefina",
    "currency": "PEN",
    "callbackUrl": "xxxxxxxx"
}
```

* payProduct：12

```json
{
    "customerIdentificationType": "00",
    "payProduct":"12",
    "lastName": "xxxx",
    "merOrderNo": "20240920195501",
    "sign": "xxxxxx",
    "customerIdentification": "22345678",
    "countryId": "PER",
    "nonceStr": "20240920195501",
    "customerName": "xxxx",
    "customerPhone": "1234567890",
    "orderAmount": 100,
    "customerEmail": "123456@qq.com",
    "merId": "xxxxxxx",
    "checkOut": "true",
    "description":"supefina",
    "currency": "PEN",
    "callbackUrl": "xxxxxxxx"
}
```

### 响应参数

<table data-full-width="true"><thead><tr><th width="215">变量名</th><th width="119">类型</th><th width="355">描述</th></tr></thead><tbody><tr><td>code</td><td>String</td><td>响应编码<br>具体参照：<a href="/pages/j56ENY9y4TEhx8ssOv8a">响应状态码</a></td></tr><tr><td>msg</td><td>String</td><td>响应描述</td></tr><tr><td>data</td><td>Object</td><td>响应数据</td></tr><tr><td>merCode</td><td>String</td><td>商户ID</td></tr><tr><td>merOrderNo</td><td>String</td><td>商户订单号</td></tr><tr><td>supefinaOrderNo</td><td>String</td><td>Supefina订单号</td></tr><tr><td>amount</td><td>BigDecimal</td><td>订单金额</td></tr><tr><td>url</td><td>String</td><td>交易链接</td></tr><tr><td>currency</td><td>String</td><td>币种</td></tr></tbody></table>

### 响应示例 — 成功

```json
{
    "code": "200",
    "msg": "success ",
    "data": {
        "merCode": "xxxxxx",
        "merOrderNo": "20240920195501",
        "supefinaOrderNo": "2025011877295415489306624",
        "amount": 100,
        "url": "http://h5.supefina.tech/combineCashier?token=349472b99a184e0f9da91a3b290d4ad7",
        "currency": "PEN"
    }
}
```

### 响应示例 — 失败

```json
{
    "code": "400",
    "msg": "param error customerName cannot be empty"
}
```

### 回调通知 — 提交方式：`POST`

<table data-full-width="true"><thead><tr><th width="222">变量名</th><th width="138">类型</th><th width="447">描述</th></tr></thead><tbody><tr><td>amount</td><td>String</td><td>订单金额</td></tr><tr><td>countryId</td><td>String</td><td>国家编号</td></tr><tr><td>fee</td><td>String</td><td>预收手续费</td></tr><tr><td>identifier</td><td>String</td><td>付款参考<br>Clabe</td></tr><tr><td>merId</td><td>String</td><td>商户编号</td></tr><tr><td>merOrderId</td><td>String</td><td>商户订单号</td></tr><tr><td>msg</td><td>String</td><td>消息</td></tr><tr><td>nonceStr</td><td>String</td><td>随机字符串<br>长度不能超过32位</td></tr><tr><td>realityAmount</td><td>String</td><td>实收金额</td></tr><tr><td>realityFee</td><td>String</td><td>实收手续费</td></tr><tr><td>reference</td><td>String</td><td>标识符</td></tr><tr><td>sign</td><td>String</td><td>签名</td></tr><tr><td>status</td><td>String</td><td><a href="/pages/17IKBEvxR4cpZue8BRdD#kxzkj">交易状态</a><br>具体参照：<a href="/pages/17IKBEvxR4cpZue8BRdD#kxzkj">字典表——交易订单状态</a></td></tr><tr><td>successTime</td><td>Date</td><td>交易成功时间<br>UTC时间</td></tr><tr><td>supefinaOrderId</td><td>String</td><td>supefina订单号</td></tr><tr><td>transactionType</td><td>String</td><td>交易类型<br><code>01</code>：代收</td></tr></tbody></table>

#### 回调通知示例

{% code fullWidth="true" %}

```json
{
    "amount": "230.00",
    "countryId": "PER",
    "customerName": "Test Name",
    "fee": "6.90",
    "identifier": "90911988431",
    "merId": "8202980903390150",
    "merOrderId": "17922853818122896811753697281175369728",
    "nonceStr": "935111b9-968e-4b3d-9036-fd1acf",
    "realityAmount": "230",
    "realityFee": "6.90",
    "reference": "90911988431",
    "sign": "69DF96903B85CD1408BD6849C62254C0",
    "status": "01",
    "successTime": 1716149235000,
    "supefinaOrderId": "202405190101010696298b1ca1141",
    "transactionType": "01"
}
```

{% endcode %}

**回调通知响应**

商户成功收到回调后需同步返回指定字符串：SUCCESS 不返回或返回其他内容默认通知失败\
如：

{% code fullWidth="true" %}

```java
public String test(){
	return "SUCCESS";
}
```

{% endcode %}


---

# 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.supefina.net/huan-ying-shi-yong-supefina-de-api-wen-dang/dai-shou-ju-he-shou-yin-tai/bi-lu.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.
