INSS 手册 - 新增信贷或再融资
另请参阅
注意!
QI Tech 的 webhook 不应以严格方式映射。 返回的 webhook payload 中可能会添加额外字段。
Webhook 重发
您可以按照文档中的详细说明查询并重发 webhook:Webhook 重发。
授权条款有效期
授权条款自签署之日起有效期为 30 天。在有效期内,可以在无需重新发送客户授权的情况下查询福利数据。
1 - 通过合作方完成授权条款后查询福利列表:
Request
情形 1:福利持有人即为授权条款的签署人。
ENDPOINT
/social_security/benefits_requestMÉTODO
POSTRequest 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:福利持有人不是授权条款的签署人(有法定代表人)。
ENDPOINT
/social_security/benefits_requestMÉTODO
POSTRequest 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
ENDPOINT
/social_security/benefits_requestMÉTODO
POSTResponse Body
{
"benefits_request_key": "\<GUID DA CONSULTA DE BENEFÍCIO\>",
"status": "pending_search"
}
福利列表查询成功时:
Webhooks
WEBHOOK_TYPE
social_security_benefits_requestSTATUS
SuccessWebhook 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_TYPE
social_security_benefits_requestSTATUS
FailureWebhook 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
ENDPOINT
/social_security/balance_requestMÉTODO
POSTRequest Body
{
"document_number": "14950479032",
"benefit_number": "22255220"
}