INSS 手册 - 新增信贷或再融资
QI Tech 的 webhook 不应以严格方式映射。 返回的 webhook payload 中可能会添加额外字段。
您可以按照文档中的详细说明查询并重发 webhook:Webhook 重发。
授权条款自签署之日起有效期为 30 天。在有效期内,可以在无需重新发送客户授权的情况下查询福利数据。
1 - 通过合作方完成授权条款后查询福利列表:
Request
情形 1:福利持有人即为授权条款的签署人。
Request Body
{
"document_number": "14950479032",
"authorization_term": {
"document_number": "14950479032",
"signature": {
"signer": {
"name": "Maria da Silva",
"email": "maria.silva@email.com",
"phone": {
"number": "999538380",
"area_code": "11",
"country_code": "55"
},
"document_number": "87237271016"
},
"authentication_type": "opt_in",
"authenticity": {
"timestamp": "2024-11-07T14:28:23.382748Z",
"ip_address": "179.145.48.219",
"fingerprint": {},
"third_party_additional_data": {},
"session_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
},
"signed_object": {
"document_key": "93a0f18b-f58f-4a22-ab63-2b796cbf7383"
}
}
}
}
情形 2:福利持有人不是授权条款的签署人(有法定代表人)。
Request Body
{
"document_number": "14950479032",
"authorization_term": {
"document_number": "14950479032",
"legal_representative_document_number": "87237271016",
"signature": {
"signer": {
"name": "Maria da Silva",
"email": "maria.silva@email.com",
"phone": {
"number": "999538380",
"area_code": "11",
"country_code": "55"
},
"document_number": "87237271016"
},
"authentication_type": "opt_in",
"authenticity": {
"timestamp": "2024-11-07T14:28:23.382748Z",
"ip_address": "179.145.48.219",
"fingerprint": {},
"third_party_additional_data": {},
"session_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
},
"signed_object": {
"document_key": "93a0f18b-f58f-4a22-ab63-2b796cbf7383"
}
}
}
}
在有法定代表人的 情况下,需要在 "legal_representative_document_number" 字段中填写法定代表人的 CPF,且 "signer" 对象中的数据也应填写法定代表人的信息。
"document_key":使用 /upload 端点返回的 GUID。
除了在 "authorization_term.signed_object.document_key" 对象中使用已签署 PDF 文档的密钥外,也可以通过 "authorization_term.signed_object.raw_text" 对象发送授权条款的原始文本。
Response
Response Body
{
"benefits_request_key": "\<GUID DA CONSULTA DE BENEFÍCIO\>",
"status": "pending_search"
}
福利列表查询成功时:
Webhooks
Webhook Body
{
"webhook_type": "social_security_benefits_request",
"key": "\<GUID benefits_request_key\>",
"event_datetime": "\<DATA E HORA DO ENVIO DO WEBHOOK\>",
"status": "success",
"data": [{
"benefit_number": "\<No. DO BENEFÍCIO\>",
"benefit_status": "inelegible",
"grant_date": "2023-06-13"
}]
}
| 字段 | 描述 | 值 |
|---|---|---|
| benefit_status | 福利状态 | 枚举值 |
福利列表查询失败时
Webhook Body
{
"webhook_type": "social_security_benefits_request",
"key": "\<GUID benefits_request_key\>",
"event_datetime": "\<DATA E HORA DO ENVIO DO WEBHOOK\>",
"status": "failure",
"data": {
"enumerator": "not_found_legal_representative",
"description": "no legal representative for the beneficiary"
}
}
失败 webhook 字段详解
| 字段 | 描述 | 值 |
|---|---|---|
| enumerator | Dataprev 代码的映射返回值 | 枚举值 |
在 Sandbox 中模拟福利查询的成功与失败场景:
场景模拟基于操作中提供的 CPF 的第一位数字。
11.1. 对于以数字 1 开头的 CPF,将通过 Webhook 返回异步成功响应。
11.2. 对于其他 CPF,将根据输入的 CPF 的第一位数字,按照下表返回异步错误响应。
| CPF 首位数字 | 枚举值 | 描述 |
|---|---|---|
| 2 | inexistent_beneficiary | no beneficiary found |
所有第一位数字未映射到对应场景的 CPF,将收到一个包含未映射测试场景标准错误的 webhook。
| 枚 举值 | 描述 |
|---|---|
| mock_error | Informed document number is not a valid mock on test environment |
2 - 查询福利数据:
情形 1
使用已提交的授权条款查询福利数据。
Request
Request Body
{
"document_number": "14950479032",
"benefit_number": "22255220"
}
Response
Response Body
{
"balance_request_key": "\<GUID DA CONSULTA DE DADOS DO BENEFÍCIO\>",
"status": "pending_search"
}
情形 2
提交授权条款时查询福利数据。
Request
Request Body
{
"document_number": "14950479032",
"benefit_number": "22255220",
"authorization_term": {
"document_number": "14950479032",
"legal_representative_document_number": "87237271016",
"signature": {
"signer": {
"name": "Maria da Silva",
"email": "maria.silva@email.com",
"phone": {
"number": "999538380",
"area_code": "11",
"country_code": "55"
},
"document_number": "87237271016"
},
"authentication_type": "opt_in",
"authenticity": {
"timestamp": "2024-11-07T14:28:23.382748Z",
"ip_address": "179.145.48.219",
"fingerprint": {},
"third_party_additional_data": {},
"session_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
},
"signed_object": {
"document_key": "93a0f18b-f58f-4a22-ab63-2b796cbf7383"
}
}
}
}
授权条款自签署之日起有效期为 30 天。在有效期内,可以在无需重新发送客户授权的情况下查询福利数据。如果尚未发送授权,则需要在此请求中发送条款。
在有法定代表人的情况下,需要在 "legal_representative_document_number" 字段中填写法定代表人的 CPF,且 "signer" 对象中的数据也应填写法定代表人的信息。
Response
Response Body
{
"balance_request_key": "\<GUID DA CONSULTA DE DADOS DO BENEFÍCIO\>",
"status": "pending_authorization"
}
成功 webhook
福利数据查询成功时
Webhook Body
{
"webhook_type": "social_security_balance_request",
"key": "\<GUID balance_request_key\>",
"event_datetime": "\<DATA E HORA DO ENVIO DO WEBHOOK\>",
"status": "success",
"data": {
"name": "IVOLANDO MIRANDA",
"state": "SP",
"alimony": "not_payer",
"birth_date": "07021961",
"grant_date": "2022-09-02",
"credit_type": "checking_account",
"block_type": "not_blocked",
"benefit_card": {
"limit": 2083.2,
"balance": 0
},
"benefit_number": "22255220",
"benefit_status": "elegible",
"payroll_card": {
"limit": 2083.2,
"balance": 0
},
"assistance_type": "retirement_by_age",
"document_number": "14950479032",
"benefit_end_date": "2020-12-01",
"consigned_credit": {
"balance": 1000
},
"benefit_situation": "active",
"max_total_balance": 2000,
"used_total_balance": 1000,
"politically_exposed": {
"type": "politically_exposed_level_1",
"is_politically_exposed": true
},
"has_power_of_attorney": false,
"available_total_balance": 1000,
"has_judicial_concession": false,
"number_of_portabilities": 0,
"disbursement_bank_account": {
"bank_code": "341",
"account_digit": "6",
"account_branch": "0155",
"account_number": "000059923"
},
"has_entity_representation": false,
"social_benefit_max_balance": 2000,
"social_benefit_used_balance": 1000,
"benefit_quota_expiration_date": null,
"number_of_active_reservations": 0,
"number_of_suspended_reservations": 0,
"number_of_refinanced_reservations": 0,
"number_of_active_suspended_reservations": 3
}
}