场景模拟
模拟外部代理执行操作的分步说明。这些模拟包括接收和更新退款请求。
信息
这些请求没有返回负载(响应体),只有 201 响应状态。
1 - 模拟接收退款请求
模拟接收另一机构开立的退款请求。
重要
必须拥有有效的 pix_transfer_key 才能发送请求,不需要关注转账另一方的信息,因为第二参与者的所有信息都将在模拟过程中被替换。
请求
ENDPOINT
/mock/pix/refund_requestMÉTODO
POST请求体
重要
如果退款类型为 FRAUD,则需要针对同一 pix_transfer_key 存在已关闭的违规报告。
{
"pix_transfer_key": "d5856a5f-378f-43ed-818b-df33b9fae703",
"refund_request_type": "fraud",
"refund_request_details": "Foi identificada uma fraude na transação.",
"refund_request_status": "open",
}
请求体对象
| 字段 | 类型 | 描述 | 最大字符数 |
|---|---|---|---|
pix_transfer_key * | string | QI 系统中 PIX 转账的标识密钥(UUIDv4)。 | 36 |
refund_request_type * | enum | 退款请求类型。 | refund_request_type 枚举值 |
refund_request_status * | string | 退款请求的初始状态。"open" | 36 |
refund_request_details | string | 退款请求报告的详情。 | 2000 |
refund_request_type 枚举值
| 字段 | 类型 | 描述 | 字符数 |
|---|---|---|---|
fraud | string | 退款请求源于欺诈行为。 | 5 |
operational_flaw | string | 退款请求源于内部错误。 | 16 |
2 - 模拟更新退款请求
模拟间接参与者开立的退款请求的状态更新。
退款请求更新的模拟选项为:
1 - 取消:模拟"目标"参与者对其自身先前开立的退款请求进行取消(cancel)。
2 - 关闭:模拟"目标"参与者对间接参与者开立的退款请求进行关闭(close)。该报告必须已经以 open 状态被确认。
请求
ENDPOINT
/mock/pix/refund_requestMÉTODO
PATCH请求体 - 取消
重要
由 refund_request_key 标识的退款请求必须已在退款请求创建模拟中预先创建。
{
"refund_request_status": "cancelled",
"refund_request_key": "c3e5664f-04bb-4625-9ef3-c8555d210c71"
}
请求体 - 完全接受关闭
重要
由 refund_request_key 标识的退款请求必须已由间接参与者预先创建。
重要
退款转账密钥必须已通过退款接收模拟预先创建,金额等于原始交易金额。
{
"refund_request_key": "42035bdd-0551-41c5-aaae-cb27d108160a",
"refund_request_status": "closed",
"analysis_result": "totally_accepted",
"analysis_details": "Teste",
"refund_transfer_key": "6f421127-892f-415f-8efc-4e20cf5d622d"
}
请求体 - 部分接受关闭
重要
由 refund_request_key 标识的退款请求必须已由间接参与者预先创建。此外,退款金额不得等于或超过原始交易的总金额。
重要
退款转账密钥必须已通过退款接收模拟预先创建,金额小于原始交易金额。
{
"refund_request_key": "42035bdd-0551-41c5-aaae-cb27d108160a",
"refund_request_status": "closed",
"analysis_result": "partially_accepted",
"analysis_details": "Teste",
"refund_transfer_key": "6f421127-892f-415f-8efc-4e20cf5d622d"
}
请求体 - 拒绝关闭
重要
由 refund_request_key 标识的退款请求必须已由间接参与者预先创建。
{
"refund_request_key": "47633091-7d44-4d10-9d00-1f937104e537",
"refund_request_status": "closed",
"analysis_result": "rejected",
"analysis_details": "Teste",
"reject_reason": "no_balance"
}
请求体对象
| 字段 | 类型 | 描述 | 最大字符数 |
|---|---|---|---|
refund_request_status * | string | 退款请求的初始状态。"cancelled"、"closed" | 36 |
refund_request_key * | string | 退款请求的唯一密钥。 | 36 |
analysis_result * | string | 退款请求分析结果。"totally_accepted"、"partially_accepted"或"rejected"。 | 36 |
analysis_details | string | 退款请求分析详情。 | 2000 |
refund_transfer_key | float | 退款转账标识符,接受情况下为必填项。 | 20 |
reject_reason | string | 退款拒绝原因(仅当 analysis_result 等于 rejected 时)。"no_balance"、"account_closure" 或 "other"。 | 15 |