> 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-fu/ba-xi/pix.md).

# PIX

请注意：在使用PIX代付时，可能会出现两次回调的情况。尽管订单已收到成功回调，后续仍可能收到状态更改为失败的回调。出现这种情况的原因可能是用户主动发起退款或用户银行系统波动导致退款。这种情况发生概率较小。

对于这种先成功后失败的情况，我们建议商户以最后一次收到的回调状态为准。由于用户行为和银行处理时间的不确定性，Supefina系统无法预测是否会有第二次回调及其具体时间。

### 请求地址

<table data-full-width="true"><thead><tr><th width="114">环境名称</th><th width="619">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/payout</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/payout</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="225">变量名</th><th width="96">类型</th><th width="128">必填</th><th width="602">描述</th></tr></thead><tbody><tr><td>account</td><td>String</td><td>是</td><td>收款方账户号<br>509.281.038-62（CPF）<br>12345@qq.com(EMAIL）<br>12345678911（PHONE）<br>01eb9090-73e5-4187-b43d-0d80a149e1dc（EVP：类似UUID的字符串</td></tr><tr><td>accountType</td><td>String</td><td>是</td><td>收款方账户类型<br><code>03</code>：CPF<br><code>04</code>：EMAIL<br><code>05</code>：PHONE<br><code>06</code>：EVP</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>countryId</td><td>String</td><td>是</td><td>国家编号<br>参照：<a href="/pages/17IKBEvxR4cpZue8BRdD#afwzp">字典表-国家编号</a><br>巴西，<code>BRA</code></td></tr><tr><td>currency</td><td>String</td><td>是</td><td>币种<br>参照：<a href="/pages/17IKBEvxR4cpZue8BRdD#huo-bi-currency">字典表-货币</a><br>雷亚尔：<code>BRL</code></td></tr><tr><td>customerName</td><td>String</td><td>是</td><td><p>收款人姓名</p><p>首尾不得包含空格，但姓名之间可以有空格</p></td></tr><tr><td>customerIdentification</td><td>String</td><td>否</td><td>用户证件号（CPF）</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>nonceStr</td><td>String</td><td>是</td><td>随机字符串<br>长度不能超过32位</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>PIX：<code>24</code></td></tr><tr><td>sign</td><td>String</td><td>是</td><td>签名<br><a href="/pages/DR0Ieg3d88mBdWrXD882">具体参照：签名算法</a></td></tr></tbody></table>

#### 请求示例<br>

{% code fullWidth="true" %}

```json
{
	"account": "509.281.038-62",
	"accountType": "03",
	"callbackUrl": "http://test.com",
	"countryId": "BRA",
	"currency": "BRL",
	"customerIdentification": "45143065844",
	"customerName": "Arjun Choudhury",
	"merId": "8302996847200585",
	"merOrderNo": "2025072513360034120802820",
	"nonceStr": "3652d4090aab4b2ea41aab3faf5ddb37",
	"orderAmount": "5.00",
	"payProduct": "24",
	"sign": "B957D315EA6E6887B3D032EE6CAA66FA"// 大写
}
```

{% endcode %}

签名组装字符串

account=509.281.038-62\&accountType=03\&callbackUrl=<http://test.com\\&countryId=BRA\\&currency=BRL\\&customerIdentification=45143065844\\&customerName=Arjun> Choudhury\&merId=8302996847200585\&merOrderNo=2025072513360034120802820\&nonceStr=3652d4090aab4b2ea41aab3faf5ddb37\&orderAmount=5.00\&payProduct=24\&key=9dbb958a68f04252bae26a6b6d98e0ab

### 响应参数

<table data-full-width="true"><thead><tr><th width="225">变量名</th><th width="140">类型</th><th width="503">描述</th></tr></thead><tbody><tr><td>code</td><td>String</td><td>响应编码<br>具体参照：<a href="/pages/j56ENY9y4TEhx8ssOv8a">响应状态码</a></td></tr><tr><td>data</td><td>Object</td><td>响应数据</td></tr><tr><td>amount</td><td>BigDecimal</td><td>订单金额</td></tr><tr><td>fee</td><td>BigDecimal</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>transactionStatus</td><td>String</td><td>下单状态<br>该笔订单的的发起状态是否成功，与订单真正的交易状态无关。<br><code>00</code>：下单成功<br><code>04</code>：下单失败</td></tr><tr><td>msg</td><td>String</td><td>响应信息</td></tr></tbody></table>

#### 响应示例

{% code fullWidth="true" %}

```json
{
	"code": "200",
	"msg": "success ",
	"data": {
		"merCode": "8302996847200585",
		"merOrderNo": "2025072513360034120802820",
		"supefinaOrderNo": "20250725053600755000038489",
		"amount": 5.0,
		"transactionStatus": "00"
	}
}
```

{% endcode %}

### 回调通知

提交方式：`POST`

<table data-full-width="true"><thead><tr><th width="225">变量名</th><th width="96">类型</th><th width="722">描述</th></tr></thead><tbody><tr><td>amount</td><td>String</td><td>订单金额</td></tr><tr><td>countryId</td><td>String</td><td>国家编号<br>参照：字典表-国家编号<br>秘鲁，<code>PER</code></td></tr><tr><td>customerName</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>商户ID</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>sign</td><td>String</td><td>签名</td></tr><tr><td>status</td><td>String</td><td>交易状态<br>具体参照：<a href="/pages/17IKBEvxR4cpZue8BRdD#kxzkj">字典表——交易订单状态</a></td></tr><tr><td>successTime</td><td>String</td><td>交易成功时间</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>：代收<br><code>02</code>：代付</td></tr></tbody></table>

#### 回调通知示例

{% code fullWidth="true" %}

```json
{
	"amount": "5.00",
	"countryId": "BRA",
	"customerName": "Arjun Choudhury",
	"fee": "5.25",
	"identifier": "",
	"merId": "8302996847200585",
	"merOrderId": "2025072513360034120802820",
	"msg": "SUCCESS",
	"nonceStr": "a14bfa37-4434-4b97-ba3c-46a722",
	"realityAmount": "5.00",
	"realityFee": "5.25",
	"reference": "7d7376fb-e369-4b",
	"sign": "81ECA00FD49087CE4DD23B8C61F91A72",// 大写
	"status": "01",
	"supefinaOrderId": "20250725053600755000038489",
	"transactionType": "02"
}
```

{% endcode %}

签名组装字符串

amount=5.00\&countryId=BRA\&customerName=Arjun Choudhury\&fee=5.25\&merId=8302996847200585\&merOrderId=2025072513360034120802820\&msg=SUCCESS\&nonceStr=a14bfa37-4434-4b97-ba3c-46a722\&realityAmount=5.00\&realityFee=5.25\&reference=7d7376fb-e369-4b\&status=01\&supefinaOrderId=20250725053600755000038489\&transactionType=02\&key=9dbb958a68f04252bae26a6b6d98e0ab

**回调通知响应**

商户成功收到回调后需同步返回指定字符串：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-fu/ba-xi/pix.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.
