场景模拟
在 PIX 自动支付框架内模拟创建定期付款和自动付款的分步说明。这些模拟包括创建定期付款和创建预定付款。
1 - 模拟创建定期付款
请求
ENDPOINT
/mock/incoming_recurrence方法
POSTRequest Body: 固定金额定期付款
{
"request_control_key": "01585acf-b0c3-4389-baf3-a58abbe92d58",
"recurrence_type": "fixed_amount",
"transaction_amount": 100.50,
"periodicity": "monthly",
"journey_type": "journey_one",
"start_date": "2025-07-01",
"is_retry_allowed": true,
"payer_account_information": {
"owner_name": "John Doe",
"document_number": "06975239000136",
"ispb": "32402502",
"account_digit": "7",
"account_branch": "3",
"account_number": "9552432"
}
Request Body: 可变金额定期付款
{
"request_control_key": "01585acf-b0c3-4389-baf3-a58abbe92d58",
"recurrence_type": "variable_amount",
"minimum_transaction_amount": 50.00,
"periodicity": "monthly",
"journey_type": "journey_one",
"start_date": "2025-07-01",
"is_retry_allowed": true,
"payer_account_information": {
"owner_name": "John Doe",
"document_number": "06975239000136",
"ispb": "32402502",
"account_digit": "7",
"account_branch": "3",
"account_number": "9552432"}
Request Body 对象
| 字段 | 类型 | 描述 | 最大字符数 |
|---|---|---|---|
| request_control_key* | string | uuid4 格式的请求唯一标识键。 | 36 |
| recurrence_type* | string | 定期付款类型(fixed_amount 或 variable_amount)。 | 20 |
| transaction_amount | number, null | 固定金额定期付款(fixed_amount)的交易金额。 | 10 |
| minimum_transaction_amount | number, null | 可变金额定期付款(variable_amount)的最低交易金额。 | 10 |
| periodicity* | string | 定期付款的周期。 | 20 |
| journey_type* | string | 授权旅程类型。 | 50 |
| start_date* | string | 定期付款开始日期(YYYY-MM-DD 格式)。 | 10 |
| end_date | string, null | 定期付款结束日期(YYYY-MM-DD 格式)。 | 10 |
| is_retry_allowed* | boolean | 是否允许交易重试。 | - |
| payer_account_information* | object | 付款方账户数据。 | - |
| pix_message | string, null | 与交易关联的 PIX 消息。 | 140 |
注意
transaction_amount 或 minimum_transaction_amount 中至少有一个字段必须提供非空值。两个字段不能同时为空。
payer_account_information 对象
| 字段 | 类型 | 描述 | 最大字符数 |
|---|---|---|---|
| owner_name* | string | 账户持有人姓名。 | 150 |
| document_number* | string | 账户持有人的 CPF 或 CNPJ(仅数字)。 | 14 |
| ispb* | string | 金融机构 ISPB 代码。 | 8 |
| account_digit* | string | 账户校验位。 | 1 |
| account_branch* | string | 账户支行。 | 6 |
| account_number* | string | 账户号码。 | 20 |
定期付款类型
- 固定金额定期付款(fixed_amount):使用
transaction_amount字段,不发送minimum_transaction_amount。 - 可变金额定期付款(variable_amount):使用
minimum_transaction_amount字段,不发 送transaction_amount。
响应
STATUS
200Response Body
{
"incoming_recurrence_key": "e13c5986-f4d1-4d07-a56b-eda90862630a",
"incoming_recurrence_spi_id": "RR32402502202507170197A5B7CB9",
"incoming_recurrence_status": "pending_confirmation",
"created_at": "2025-07-17T14:44:38Z",
"account_key": "ba685cfd-3aee-4992-b6bf-58f8038faa6b"
}
Response Body
| 字段 | 类型 | 描述 | 字符数 |
|---|---|---|---|
incoming_recurrence_key | uuid | 入账定期付款的唯一标识键。 | 36 |
incoming_recurrence_spi_id | string | 入账定期付款的 SPI 标识符。 | 29 |
incoming_recurrence_status | enumerator | 入 账定期付款的当前状态。 | Enumeradores incoming_recurrence_status |
created_at | string | 定期付款创建的日期和时间(ISO 8601 格式)。 | - |
account_key | uuid | 账户的唯一标识键。 | 36 |
Enumeradores incoming_recurrence_status
| 枚举值 | 描述 |
|---|---|
pending_confirmation | 定期付款待确认 |
active | 定期付款已激活 |
cancelled | 定期付款已取消 |
suspended | 定期付款已暂停 |
expired | 定期付款已到期 |
2 - 模拟创建付款
请求
ENDPOINT
/mock/incoming_recurrence/INCOMING_RECURRENCE_SPI_ID/outgoing_payment方法
POSTRequest Body
{
"transaction_amount": 100.50,
"target_account_data": {
"owner_name": "John Doe",
"owner_document_number": "06975239000136",
"ispb": "32402502",
"account_digit": "7",
"account_branch": "3",
"account_type": "checking_account",
"account_number": "9552432"
},
"receiver_conciliation_id": "3d7d6a2bf72f44z7bb2079a2b94dff56452",
"outgoing_payment_spi_id": "7d2d1b6cd72f44z7bb2079a2b94dff52673",
"end_to_end_id": "E60701190202110191604DY5LHIZ9O66",
"next_execution_datetime": "2023-06-01"
}
Request Body 对象
| 字段 | 类型 | 描述 | 最大字符数 |
|---|---|---|---|
| transaction_amount* | number | 交易金额。 | 10 |
| target_account_data | object | 目标账户数据。 | - |
| receiver_conciliation_id* | string | 接收方对账标识。 | 35 |
| outgoing_payment_spi_id* | string | 付款 SPI 标识符。 | 20 |
| end_to_end_id* | string | SPI 中 PIX 交易的幂等键。 | 32 |
| next_execution_datetime | string | 下次执行的日期和时间(YYYY-MM-DD 格式)。 | 10 |
target_account_data 对象
| 字段 | 类型 | 描述 | 最大字符数 |
|---|---|---|---|
| owner_name* | string | 账户持有人姓名。 | 150 |
| owner_document_number* | string | 账户持有人的 CPF 或 CNPJ(仅数字)。 | 14 |
| ispb_number* | string | 金融机构 ISPB 代码。 | 8 |
| account_digit* | string | 账户校验位。 | 1 |
| account_branch* | string | 账户支行。 | 6 |
| account_type* | string | 账户类型。 | 20 |
| account_number* | string | 账户号码。 | 20 |
Enumerador account_type
| 枚举值 | 描述 |
|---|---|
| checking_account | 支票账户 |
| salary_account | 工资账户 |
| saving_account | 储蓄账户 |
| payment_account | 支付账户 |
Enumeradores periodicity
| 枚举值 | 描述 |
|---|---|
| weekly | 每周定期 |
| monthly | 每月定期 |
| quarterly | 每季定期 |
| semiannual | 每半年定期 |
| annual | 每年定期 |