PIX Cash Out - 按密钥转账
使用收款方的 PIX 密钥执行 PIX 转账。
端点
POST /api/v2/external/pix/cash-out请求头
| 请求头 | 类型 | 必填 | 描述 |
|---|---|---|---|
| Authorization | String | 是 | Bearer {access_token} |
| Content-Type | String | 是 | application/json |
| hmac | String | 是 | 请求体的 HMAC-SHA512 签名(十六进制) |
身份验证
通过 Auth Token 获取 access_token。HMAC 签名须按照 HMAC-SHA512 中的说明生成。
请求体
| 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|
amount | Integer | 是 | 金额(分)。R$ 100.00 = 10000 |
pix_key | String | 是 | 收款方 PIX 密钥 |
pix_key_type | String | 是 | 密钥类型:cpf、cnpj、email、phone、evp |
description | String | 否 | 转账描述(最多 140 个字符) |
金额以分为单位
API 中所有货币金额均以分(整数)表示。发送 R$ 1,500.75 请填写 150075。
示例
bash
curl -X POST https://api.owem.com.br/api/v2/external/pix/cash-out \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-H "hmac: $HMAC" \
-d '{
"amount": 10000,
"pix_key": "12345678901",
"pix_key_type": "cpf",
"description": "供应商付款"
}'成功响应 -- 200
json
{
"worked": true,
"transaction_id": "PIXOUT20260309a1b2c3d4e5f6",
"end_to_end_id": "E37839059202603091530abcdef01",
"amount": 10000,
"fee": 0,
"status": "processing",
"detail": "PIX 已提交处理"
}| 字段 | 类型 | 描述 |
|---|---|---|
worked | Boolean | true 表示请求已被接受 |
transaction_id | String | 交易唯一标识 |
end_to_end_id | String | SPI/BACEN 中的端到端标识(格式 E{ISPB}...) |
amount | Integer | 转账金额(分) |
fee | Integer | 收取的手续费(分) |
status | String | 初始状态:processing |
detail | String | 描述信息 |
错误响应 -- 400
json
{
"worked": false,
"detail": "PIX 密钥无效"
}错误响应 -- 422
json
{
"worked": false,
"detail": "余额不足"
}PIX 密钥类型
| 类型 | 格式 | 示例 |
|---|---|---|
cpf | 11 位数字(无标点) | 12345678901 |
cnpj | 14 位数字(无标点) | 12345678000199 |
email | 电子邮件地址 | nome@empresa.com.br |
phone | +55 + 区号 + 号码 | +5511999998888 |
evp | UUID v4 | a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d |
后续步骤
创建转账后,可通过以下方式查询状态:
或通过 Webhook 自动接收确认通知。