FGTS 周年提款手册
QI Tech 的 webhook 不应以严格方式映射。 返回的 webhook payload 中可能会包含额外字段。
您可以按照文档中的详细说明查询和重发 webhook:Webhook 重发。
本手册描述了 FGTS 周年提款预付款操作(以 FGTS 周年提款作为担保的个人信用)的查询、模拟、发行、放款及其他操作步骤。
前提条件
1 - 借款人必须选择 FGTS 周年提款模式;
2 - 借款人必须授权 QI 在 CEF(联邦储蓄银行)应用程序中查询其 FGTS 余额;
1 - 查询可用余额
1.1. 执行余额查询:
Request
Request Body
{
"document_number": "06568225037"
}
| 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|
document_number | string(11) | 是 | 借款人 CPF |
余额查询成功后,主要返回活跃合同数量以及受益人的 FGTS 余额是否可用。
Response
Response Body
{
"available_balance_key": "7521981f-0b06-43d2-9a75-d3a1f215fbbf",
"document_number": "06568225037",
"status": "pending",
"status_events": [{
"event_datetime": "2022-12-26T13:36:16",
"status": "pending"
}]
}
| 字段 | 类型 | 描述 |
|---|---|---|
available_balance_key | string (UUID) | 余额查询的唯一键 |
document_number | string(11) | 借款人 CPF |
status | string | 查询状态(pending、success、failed) |
status_events[] | array | 状态事件历史 |
status_events[].event_datetime | string (datetime) | 事件日期/时间 |
status_events[].status | string | 事件状态 |
1.1.1. 若在 CEF 中余额查询成功,合作伙伴将收到以下 webhook:
Webhooks
Body
{
"webhook_type": "available_balance",
"event_datetime": "2022-12-26T13:36:16",
"key": "7521981f-0b06-43d2-9a75-d3a1f215fbbf",
"status": "success",
"data": {
"reference_date": "2022-07-28",
"periods": [{
"due_date": "2022-08-01",
"amount": 500.1
},
{
"due_date": "2023-08-01",
"amount": 400.2
}
]
}
}
| 字段 | 类型 | 描述 |
|---|---|---|
webhook_type | string | Webhook 类型(available_balance) |
event_datetime | string (datetime) | 事件日期/时间 |
key | string (UUID) | 余额查询键 |
status | string | 状态(success) |
data.reference_date | string (date) | 余额参考日期 |
data.periods[] | array | 可用提款期 |
data.periods[].due_date | string (date) | 提款到期日 |
data.periods[].amount | number | 该期可提款金额 |
1.1.2. 若在 CEF 中余额查询失败,合作伙伴将收到以下 webhook:
Body
{
"webhook_type": "available_balance",
"event_datetime": "2022-12-26T13:36:16",
"key": "7521981f-0b06-43d2-9a75-d3a1f215fbbf",
"status": "failed",
"data": {
"error_description": "Client does not have membership for anniversary withdraw on current date",
"error_enumerator": "inexistent_anniversary_membership"
}
}
| 字段 | 类型 | 描述 |
|---|---|---|
webhook_type | string | Webhook 类型(available_balance) |
event_datetime | string (datetime) | 事件日期/时间 |
key | string (UUID) | 余额查询键 |
status | string | 状态(failed) |
data.error_description | string | 错误描述 |
data.error_enumerator | string | 错误枚举值 |
1.1.3. 若因操作日期不被允许而导致在 CEF 中余额查询失败,合作伙伴将在 "data" 字段中收到包含额外信息的 webhook:
Body
{
"webhook_type": "available_balance",
"event_datetime": "2022-12-26T13:36:16",
"key": "7521981f-0b06-43d2-9a75-d3a1f215fbbf",
"status": "failed",
"data": {
"error_description": "Not permitted action on current date",
"error_enumerator": "on_locked_date_range",
"error_data": {
"operation_not_allowed_until_date": "2023-01-03"
}
}
}
| 字段 | 类型 | 描述 |
|---|---|---|
webhook_type | string | Webhook 类型(available_balance) |
event_datetime | string (datetime) | 事件日期/时间 |
key | string (UUID) | 余额查询键 |
status | string | 状态(failed) |
data.error_description | string | 错误描述 |
data.error_enumerator | string | 错误枚举值 |
data.error_data.operation_not_allowed_until_date | string (date) | 操作被允许的起始日期 |
余额查询失败的可能枚举值列于第 2 节。
1.2. 查询特定余额查询的结果:
可以使用创建时返回的键(available_balance_key)查询已执行余额查询的结果。
Request
Response
Response Body
{
"available_balance_key": "7521981f-0b06-43d2-9a75-d3a1f215fbbf",
"document_number": "06568225037",
"status": "success",
"reference_date": "2022-07-28",
"number_of_active_contracts": 0,
"has_unavailable_balance": false,
"periods": [
{
"due_date": "2022-08-01",
"amount": 500.1
},
{
"due_date": "2023-08-01",
"amount": 400.2
}
],
"has_succeeded": true,
"error_message": null
}
| 字段 | 类型 | 描述 |
|---|---|---|
available_balance_key | string (UUID) | 余额查询的唯一键 |
document_number | string(11) | 借款人 CPF |
status | string | 查询状态(success、pending、failed) |
reference_date | string (date) | 余额参考日期 |
number_of_active_contracts | integer | FGTS 活跃合同数量 |
has_unavailable_balance | boolean | 是否存在不可用余额 |
periods[] | array | 可用提款期 |
periods[].due_date | string (date) | 提款到期日 |
periods[].amount | number | 可提款金额 |
has_succeeded | boolean | 查询是否成功 |
error_message | string/null | 错误信息(如有) |
1.3. 取消待处理的余额查询:
如需取消状态为 pending 的余额查询,请使用以下端点。
Request
Response
该端点返回状态码 204,响应体为空。
在 Playground 中测试2 - 在 Sandbox 中模拟余额查询的成功与失败 场景:
2.1. 对于以 0、1、2、3、4、5、6 和 7 开头的 CPF,将通过 Webhook(1.1.1.)返回异步成功响应。
2.2. 对于以 8 开头的 CPF,余额查询将返回异步成功响应(1.1.1.),但期数为零,可用于测试。
2.3. 模拟可用余额查询失败的情况:
所有以 9 开头的 CPF 查询都将通过 webhook(1.1.2. 或 1.1.3.)返回异步错误响应,包含以下错误之一。
以下是在 Sandbox 中测试失败案例的模拟,使用借款人文档前几位数字的逻辑:
| CPF 开头 | error_enumerator | error_description |
|---|---|---|
| 90 | ongoing_operation | There's an ongoing operation |
| 91 | unauthorized_institution | Institution isn't authorized by the client |
| 92, 920 | inexistent_anniversary_membership | Client does not have membership for anniversary withdraw on current date |
| 93 | on_locked_date_range | Not permitted action on current date |
| 94 | anniversary_membership_egress | Client moving away from anniversary membership. It need to be canceled before requesting a reserve |
| 95, 950 | processing_pending_changes | Changes on profile info happened on client's FGTS account |
| 96, 97, 98, 99 | caixa_error | Request wasn't able to process due to an error on CEF |