Consultas e Enumeradores
Endpoints auxiliares e tabelas de referência para o fluxo de Port+Refin INSS.
9 - Consulta de Lista de Parcticipantes do CTC - CIP:
Request
- MÉTODOGET
- ENDPOINT/v2/credit_transfer/participants
Response:
response.json
[
{
"name": "\<NOME DO BANCO\>",
"bank_code": "\<CÓDIGO DO BANCO\>",
"ispb": "\<BASE DO CNPJ DO BANCO\>"
}
]
10 - Recuperar resposta da última request
O last response é uma forma de mapear, de forma simples e objetiva, a resposta da comunicação entre a QI e a Dataprev, possibilitando saber quando essa requisição foi feita e qual o retorno obtido (através de um enumerador). Os enumeradores estão diretamente relacionados aos códigos de retorno da Dataprev e são divididos em duas formas: "errors" e "success".
Cada enumerador tem uma descrição detalhada e o código de referência da Dataprev. Podemos conferir abaixo, com mais detalhes, como serão apresentados os dados do last response.
Casos de sucesso
Request - Credit Transfer
PATH PARAMETERS credit-operation-type
| Enumerador | Descrição |
|---|---|
| refinancing_credit_operation | Operação de refinanciamento |
| portability_credit_operation | Operação de portabilidade |
Response
Response Body
{
"collateral_data":{
"benefit_number":1976703155,
"state":"PI",
"last_response":{
"success":[
{
"enumerator":"succesfully_included",
"reservation_method":"portability"
}
]
},
"last_response_event_datetime":"2023-05-22T19:13:02Z",
"status":"reserved"
},
"collateral_constituted":true,
"collateral_type":"social_security"
}
Detalhamento de campos no retorno da request
| Campo | Descrição | Valores |
|---|---|---|
| enumerator | Retorno mapeado do código Dataprev | Enumeradores |
| reservation_method | Método de averbação da reserva | portability, new_credit, refinancing |
Casos de erro
Request
Response
Response Body
{
"collateral_constituted": false,
"collateral_type": "type",
"updated_at": "2023-05-24 19:13:02",
"collateral_data": {
"state": "SP",
"benefit_number": 1976703155,
"status": "pending_reservation",
"last_response": {
"errors": [
{
"enumerator": "benefit_blocked_by_tbm",
"reservation_method" : "portability"
},
{
"enumerator": "benefit_blocked_by_tbm",
"reservation_method" : "new_credit"
}
]
},
"last_response_event_datetime": "2023-05-22T19:13:02Z"
}
}
Detalhamento de campos no webhook de falha
| Campo | Descrição | Valores |
|---|---|---|
| enumerator | Retorno mapeado do código Dataprev | Enumeradores |
| reservation_method | Método de averbação da reserva | portability, new_credit, refinancing |
11 - Webhook de resposta da última tentativa de averbação
Caso a operação não tenha sucesso na averbação, a mesma ficará em retentativa e será enviado o seguinte webhook, detalhando o motivo da não averbação, o horário desta tentativa e o método de averbação utilizado:
Ver exemplos de webhook
- Webhook portabilidade
- Webhook refinanciamento
{
"webhook_type": "credit_transfer.proposal.collateral",
"proposal_key": "\<PROPOSAL-KEY\>",
"event_datetime": "2022-11-24T15:42:12",
"data": {
"credit_operation_type": "portability",
"credit_operation_key": "\<CREDIT-OPERATION-KEY\>",
"collateral_type": "social_security",
"collateral_constituted": false,
"collateral_data": {
"status": "pending_reservation",
"last_response": {
"errors": [{
"enumerator": "consignable_margin_excceded"
}]
},
"last_response_event_datetime": "2023-05-22T19:13:02Z",
"reservation_method": "new_credit",
}
}
}
{
"webhook_type": "credit_operation.collateral",
"key": "\<CREDIT-OPERATION-KEY\>",
"event_time": "2022-11-24T15:42:12",
"data": {
"collateral_type": "social_security",
"collateral_constituted": false,
"collateral_data": {
"status": "pending_reservation",
"last_response": {
"errors": [{
"enumerator": "consignable_margin_excceded"
}]
},
"last_response_event_datetime": "2023-05-22T19:13:02Z",
"reservation_method": "refinancing",
}
}
}
Detalhamento de campos no webhook de falha
| Campo | Descrição | Valores |
|---|---|---|
| enumerator | Retorno mapeado do código Dataprev | Enumeradores |
| reservation_method | Método de averbação da reserva | portability, new_credit, refinancing |
12 - Consulta de portabilidade de origem
É possível consultar os dados da portabilidade do banco de origem como, por exemplo, o número do benefício, a data de início da portabilidade, o número dos contratos excluídos, os valores das parcelas desaverbadas, ultima parcela paga, data de exclusão, entre outros.
Request
- MÉTODOPOST
- ENDPOINT/social_security/reservation/external_key/CREDIT-OPERATION-KEY/portability_origin_contract
Payload:
payload.json
{
"request_type":"portability_number",
"portability_number": "202402070000298096242"
}
Response
- MÉTODOPOST
- ENDPOINT/social_security/reservation/external_key/CREDIT-OPERATION-KEY/portability_origin_contract
body.json
{
"origin_contract_request_key": "9bb68c89-4b88-400d-9359-99ad8d42a69e",
"status": "pending_search",
"status_events": [
{
"status": "pending_search"
}
]
}
Em caso de sucesso na consulta do número de benefício
Webhook
- WEBHOOK_TYPEsocial_security_portability_origin_contract_request
- STATUSSuccess
body.json
{
"webhook": {
"key": "25e93655-4713-488b-8800-7ac4fddf745f",
"data": {
"portability_number": 9223372036854776000,
"portability_status": "open",
"benefit_number": 1544326820,
"portability_start_date": "2024-02-22",
"deleted_contracts": [
{
"origin_bank": {
"bank_code": 752,
"name": "CETELEM-BNP"
},
"contract_number": "22-844817807/20",
"last_installment_paid": 84,
"exclusion_date": "22022024",
"period_amount": 165.73
}
]
},
"status": "success",
"webhook_type": "social_security_portability_origin_contract_request",
"event_datetime": "2024-02-26T21:36:22"
}
}
Em caso de falha na consulta do número de benefício
Webhook
- WEBHOOK_TYPEsocial_security_portability_origin_contract_request
- STATUSFailure
body.json
{
"webhook": {
"key": "522b5d7d-2dfc-4e92-99b7-d4df3d97edb2",
"data": {
"enumerator": "invalid_bank_code",
"description": "Invalid bank code"
},
"status": "failure",
"webhook_type": "social_security_portability_origin_contract_request",
"event_datetime": "2024-02-26T21:36:22"
}
}
13. Diminuir o valor das parcelas
Este endpoint permite a redução do valor das parcelas de um contrato de portabilidade de crédito. Esta funcionalidade é especialmente útil em casos onde a margem consignável é excedida devido ao banco de origem desaverbar uma quantia menor do que a esperada.
Request
- MÉTODOPUT
- ENDPOINT/v2/credit_transfer/proposal/PROPOSAL-KEY/portability_credit_operation
Payload:
payload.json
{
"installment_face_value": 382.18
}
Response sucesso - HTTP 200
body.json
{
"credit_operation_key": "7aa77bca-c724-4c1a-bfae-9b1b7bd81ab2",
"contract_number": "0000000007/WO",
"document_key": "045a8f35-6170-4112-8d83-29a753d0c78e",
"document_url": "http://teste.com",
"signed_url": "signed_url_test",
"credit_operation_status": "waiting_signature",
"fine_configuration": {
"contract_fine_rate": 0.02,
"interest_base": "calendar_days",
"monthly_rate": 0.01
},
"disbursement_accounts": [
{
"account_digit": "3",
"account_branch": "0001",
"account_number": "94134",
"ispb": "32402502",
"name": "Wilker Teste",
"document_number": "37197645832"
}
],
"disbursement_options": [
{
"prefixed_interest_rate": {
"annual_rate": 3.0,
"daily_rate": 0.00385824,
"interest_base": "calendar_days",
"monthly_rate": 0.12246205
},
"total_iof": 7.03,
"external_contract_fee_amount": 0.0,
"external_contract_fees": [],
"contract_fee_amount": 0.0,
"number_of_installments": 3,
"contract_fees": [],
"disbursed_issue_amount": 1000.0,
"issue_amount": 1007.03,
"disbursement_date": "2022-08-24",
"cet": 12.6,
"annual_cet": 315.3944,
"installments": [
{
"business_due_date": "2022-08-30",
"calendar_days": 5,
"due_date": "2022-08-29",
"due_principal": 1007.03,
"installment_number": 1,
"pre_fixed_amount": 84.43554587915118,
"principal_amortization_amount": 297.73445412084885,
"total_amount": 382.17,
"workdays": 3
},
{
"business_due_date": "2022-09-30",
"calendar_days": 31,
"due_date": "2022-09-29",
"due_principal": 709.2955458791512,
"installment_number": 2,
"pre_fixed_amount": 47.97894031795043,
"principal_amortization_amount": 334.19105968204957,
"total_amount": 382.17,
"workdays": 22
},
{
"business_due_date": "2022-11-01",
"calendar_days": 32,
"due_date": "2022-10-31",
"due_principal": 375.1044861971016,
"installment_number": 3,
"pre_fixed_amount": 7.055513802898396,
"principal_amortization_amount": 375.1044861971016,
"total_amount": 382.16,
"workdays": 21
}
],
"final_disbursement_amount": 997.87
}
],
"final_disbursement_amount": 997.87,
"collateral_is_constituted": false
}
14. Mapeamento de enumeradores
Enumeradores Retention Reason
| Enumerador | Descrição |
|---|---|
| issuer_retention | Retenção do Cliente |
| different_from_original | Condições da proposta divergentes do contrato original |
| issuer_lawsuit | Cliente com ação judicial |
| insurance_in_progress | Indenização de seguro em andamento |
| collateral_in_execution | Garantia em Execução |
| contract_not_found | Contrato não encontrado |
| invalid_contract_type | Tipo de contrato inválido |
| portability_in_progress | Portabilidade em andamento |
| assigned_contract | Contrato cedido |
| issuer_document_number_invalid | CPF não é do contrato |
| unrelated_issuer_document_number | CPF informado não é o do titular |
| assigned_without_co_obligation | Contrato cedido sem coobrigação |
| fgts_in_use | FGTS AMORTIZAR em uso |
| fgts_funding | FGTS funding |
| portability_not_requested | O cliente não solicitou a portabilidade |
| wrong_original_financial_institution | IF Credora Original Incorreta |
Tabela de retorno de erros Dataprev - averbação
| Código Dataprev | Enumerador | Descrição | Ação Qi |
|---|---|---|---|
| HW | consignable_margin_excceded | Exceeded consignable margin | Teimosinha |
| IT | benefit_blocked_by_tbm | Benefit blocked due to benefit transfer | Teimosinha |
| IE | benefit_blocked_by_beneficiary | Benefit blocked by beneficiary | Teimosinha |
| AN | invalid_disbursement_account | Invalid disbursement bank account | Teimosinha |
| HX | reservation_already_included | Reservation already included | Confirmar averbação |
| IF | benefit_blocked_by_granting_process | Benefit blocked during granting process | Teimosinha |
| AV | processing_payroll | Operation couldn`t be done during processing payroll period | Teimosinha |
| OF | invalid_cbc | Invalid cbc | Teimosinha |
| IA | first_name_mismatch | First name mismatch benefit owner or legal representative | Teimosinha |
| OS | legal_representative_document_number_mismatch | Document number mismatch legal representative | Teimosinha |
| AY | invalid_state | Invalid state | Teimosinha |
| HZ | operation_not_allowed_on_this_reservation_status | Operation couldn`t be done with current reservation status | Teimosinha |
| AP | invalid_contract_date | Accrual, end or start contract date is invalid | Teimosinha |
| GA | required_fields_missing | Required fields are missing | Teimosinha |
| BC | cbc_missing | CBC is missing | Teimosinha |
| NC | contract_number_missing | Contract number is missing | Teimosinha |
| NB | benefit_number_missing | Benefit number is missing | Teimosinha |
| CA | invalid_bank_code | Invalid bank code | Teimosinha |
| HR | exceeded_number_of_allowed_contracts | Amount of contracts is above the limit | Teimosinha |
| PV | invalid_image_format | Image with wrong format | Teimosinha |
| IR | operation_not_allowed_IR | Operation date is greater than benefit expiration | Teimosinha |
| PK | wrong_bank_code_destination | Portability number was found with wrong bank code destination | Teimosinha |
| PH | wrong_benefit_number_on_portability | Portability number was found with wrong benefit number | Teimosinha |
| PI | invalid_contract_total_amount | Reservation contract total amount should be greater than Dataprev reference amount | Teimosinha |
Todas as taxas e valores do contrato são validados no momento da criação da reserva.
A crítica "invalid_contract_total_amount" ocorre nos casos em que os contratos se estendem por muito tempo sem serem averbados, o que impacta os valores previamente estabelecidos.
Tabela de retorno de sucesso - averbação
| Código Dataprev | Enumerador | Descrição |
|---|---|---|
| BD | successfully_included | Inclusion has been successfully done |
| BF | successfully_removed | Removal has been successfully done |
| BR | successfully_reactivated | Reactivation has been successfully done |
| BS | successfully_suspended | Suspension has been successfully done |
Tabela de retorno de erros na consulta de saldo
| Código | Enumerador | Descrição |
|---|---|---|
| CR | not_found_legal_representative | no legal representative for the beneficiary |
| CD | inexistent_beneficiary | no beneficiary found |
| AS | benefity_without_legal_representative | beneficiary does not have a legal representative |
| BI | inexistent_benefit | no benefit found |
| D1 | inconsistent_balance_benefit_data | The balance benefit data registered is either inconsistent, null or incomplete. |
Tabela de retorno de erros na consulta de benefícios
| Código | Enumerador | Descrição |
|---|---|---|
| CR | not_found_legal_representative | no legal representative for the beneficiary |
| CD | inexistent_beneficiary | no beneficiary found |
| AS | benefity_without_legal_representative | beneficiary does not have a legal representative |
Tabela de situação de benefícios
| Items |
|---|
| active |
| excluded |
| terminated |
| suspended |
| suspended_by_CONPAG |
| terminated_by_SISOBI |
| receiving_monthly_recover_6_months |
| receiving_monthly_recover_18_months |
| suspended_by_name_error |
| suspended_by_credentialed_payer |
| suspended_by_inspection |
| suspended_by_audit |
| terminated_by_inspection |
| terminated_by_audit |
| receiving_monthly_recover_6_months_inspection |
| receiving_monthly_recover_18_months_inspection |
| suspended_by_SISOBI |
| canceled_by_audit |
Tabela de status de benefícios
| Enumerador | Descrição |
|---|---|
| Elegible | Elegível para empréstimo |
| Inelegible | Benefício inelegível para empréstimo |
| Blocked | Benefício elegível, porém bloqueado para empréstimo |
Tabela de tipos de bloqueio
| Enumerador | Descrição |
|---|---|
| 0 | Sem bloqueio |
| 1 | Bloqueado pelo Segurado |
| 2 | Bloqueado por TBM |
| 3 | Bloqueado na Concessão |
Tabela de tipos de politicamente exposto
| Enumerador | Descrição |
|---|---|
| 0 | Pessoa Não Exposta Politicamente |
| 1 | Pessoa Exposta Politicamente - Nível 1 |
Tabela de benefícios
| código | benefício |
|---|---|
| 1 | pension_by_death_rural_worker |
| 2 | pension_by_death_accident_rural_worker |
| 3 | pension_by_death_rural_employer |
| 4 | retirement_invalidity_rural_emploee |
| 5 | retirement_invalidity_accident_rural_worker |
| 6 | retirement_invalidity_rural_employer |
| 7 | retirement_by_eldness_rural_worker |
| 8 | retirement_by_age_rural_employer |
| 9 | complement_by_work_accident_rural_worker |
| 11 | support_invalidity_rural_worker |
| 12 | support_by_age_rural_worker |
| 13 | aid_sickness_rural_worker |
| 15 | aid_time_off_rural_worker |
| 16 | aid_federal |
| 17 | international_agreement |
| 18 | inclusion_benefit |
| 19 | pension_student_law7004 |
| 20 | pension_by_death_diplomat |
| 21 | pension_by_death |
| 22 | pension_by_death_statute |
| 23 | pension_by_death_veteran |
| 24 | pension_special_institutional_act |
| 25 | aid_time_off |
| 26 | pension_by_death_special_law593 |
| 27 | pension_by_death_federal_emploee |
| 28 | pension_by_death_general_regime_law20465 |
| 29 | pension_by_death_marine_veteran |
| 30 | monthly_income_lifetime_invalidity |
| 31 | aid_sickness |
| 32 | retirement_invalidity_social_security |
| 33 | retirement_invalidity_aeronautic |
| 34 | retirement_invalidity_marine_law1756 |
| 35 | aid_sickness_veteran |
| 36 | aid_social_security_accident |
| 37 | retirement_capin_extra_emploee |
| 38 | retirement_federal_extra_emploee |
| 39 | aid_invalidity_student_law7004 |
| 40 | monthly_income_lifetime_by_age_upper70_law6179 |
| 41 | retirement_by_age |
| 42 | retirement_by_contribution_time |
| 43 | retirement_by_time_of_service_veteran |
| 44 | retirement_special_aeronautic |
| 45 | retirement_by_time_of_service_journalist |
| 46 | retirement_special |
| 47 | allowance_25 |
| 48 | allowance_20 |
| 49 | retirement_ordinary |
| 50 | aid_sickness_extinct_basic_plan |
| 51 | retirement_invalidity_extinct_basic_plan |
| 52 | retirement_by_age_extinct_basic_plan |
| 53 | aid_time_off_extinct_basic_plan |
| 54 | pension_indemnity_federal |
| 55 | pension_by_death_extinct_basic_plan |
| 56 | pension_lifetime_syndrome_thalidomide |
| 57 | retirement_by_teacher_labor_time |
| 58 | retirement_anisty |
| 59 | pension_by_death_amnesty |
| 60 | indemnity |
| 61 | aid_birth |
| 62 | aid_funeral |
| 63 | aid_funeral_rural_worker |
| 64 | aid_funeral_rural_employer |
| 65 | savings_special_autarchy |
| 67 | savings_mandatory_ipase_law5128 |
| 68 | savings_special_retirement_ps_affiliated_upper60 |
| 69 | savings_student_law7004 |
| 70 | restitution |
| 71 | monthly_income |
| 72 | retirement_by_time_of_service_law1756 |
| 73 | monthly_income_family_statute |
| 74 | complement_pension_federal |
| 75 | complement_retirement_federal |
| 76 | monthly_income_statute |
| 77 | monthly_income_sinpas_family_statute |
| 78 | retirement_by_age_law1756 |
| 79 | advantage |
| 80 | monthly_income_maternity |
| 81 | compulsory_retirement |
| 82 | retirement_by_time_of_service_sasse |
| 83 | retirement_invalidity_ex_sasse |
| 84 | pension_by_death_sasse |
| 85 | pension_lifetime_rubber_tapper_law7986 |
| 86 | pension_lifetime_rubber_tapper_dependent_law7986 |
| 87 | continuous_aid_physical_disabilities |
| 88 | continuous_aid_eldness |
| 89 | pension_special_hemodialysis_victim_caruaru |
| 90 | medic_assistency_work_accident |
| 91 | aid_sickness_by_work_accident |
| 92 | retirement_invalidity_work_accident |
| 93 | pension_by_death_work_accident |
| 94 | aid_work_accident |
| 95 | aid_additional_work_accident |
| 96 | pension_special_leprosy_law11520 |
| 97 | savings_by_death_work_accident |
| 98 | aid_longshoreman |
| 99 | time_off_15 |