Skip to main content
Exclude a contract from your institution after the worker moves it to another institution by portability.
This flow is a suggested interpretation of the Dataprev manuals for Crédito do Trabalhador. The manuals prevail over this page. Your institution validates the flow and implements it on the Lerian APIs. See how to read the diagrams.

Participants


  • Your institution. The origin institution, which holds the contract until the exclusion.
  • Lerian. Lerian Consignado. It exchanges the requests with Dataprev, and exposes the API and the events your institution uses.
  • Dataprev. Runs the Crédito do Trabalhador system: the portability requests and the registry of payroll loans.

Diagram


Release a payroll loan by portability

Steps


Your institution receives the número único and the destination institution outside Lerian. The contract must be a contract that Lerian holds for your institution: registered through Lerian, or imported with POST /v1/consignado/contracts/{numero_contrato}/import. Any other contract answers 404, and Lerian does not call Dataprev. The same holds for a contract that the follow-up read of Lerian shows at Dataprev as excluded, ended or closed by renegotiation. Send the exclusion before the destination institution sends its averbação, with or without FGTS collateral. After Dataprev accepts the exclusion, Lerian sends a final outstanding balance of 0.00 for the contract. When Dataprev refuses the exclusion with a code that Lerian recognizes, Lerian publishes consignado.portabilidade.rejeitada. If the answer does not settle the command, Lerian parks it and answers 503 OUTCOME_UNKNOWN. Do not send the command again under a new key. The same key meets RAIL_COMMAND_OUTCOME_UNRESOLVED, which means that Lerian does not know the outcome yet. Read the command with GET /v1/consignado/rail-commands. When nothing ran at Dataprev, Lerian closes the command refused. A 503 DATAPREV_UNAVAILABLE whose detail says so means that the call never left Lerian, or that Dataprev answered only OZ, its competência-turnover code. A 422 with the Dataprev codes in upstream means that the codes prove nothing ran. Send a corrected command under a new key. The old key answers RAIL_COMMAND_ALREADY_REFUSED. Lerian publishes consignado.portabilidade.rejeitada for these closes too. Its reason_code is GW-NAO-ENVIADO, OZ or the Dataprev code.

How you know it finished


The answer carries competenciaExclusao, and Lerian publishes consignado.portabilidade.efetivada.