Renegotiate one or more legado loans into a new contract
Proxies renegociar-emprestimo-legado-trabalhador (Manual 007 v1.4 §3.3): folds every contract named in contratosLegados into a single new Plataforma contract. codigoTipoRenegociacao selects Padrão (1) or Portabilidade (2); this gateway proves the structural half of the Portabilidade rules before the rail is called — numeroUnico populated only under Portabilidade, at least one item carrying it, and no two items sharing the same one — while whether the requester actually holds each legado contract, whether an existing folha (tipoContrato=2) contract was included, and whether the new rate undercuts the original are left to the rail’s own judgment (Dataprev performs no documental validation of legado contracts, §2.2.1.3). On Portabilidade (§2.2.1.3): the ported contract itself is NOT excluded automatically — exclusion is the origin bank’s own responsibility; every contract of the REQUESTER that carries no numeroUnico is excluded automatically once the operation completes; and any troco (change) is only permitted when every contract INVOLVED in the operation — including the ported one itself — is fully settled (§2.2.1.3). A SUCCESSFUL round trip is codigo SUCESSO with a non-empty numeroContrato: read codigo and errosContratosPortados in the response body — the rail can report per-legado-contract failures inside that same 200 while the new contract still averbates; any other codigo means no new contract was minted and surfaces as a 422 naming the rail’s own code. X-Idempotency is required; this operation names no idempotency pair of its own, so a retry is refused by the rail on its own terms.
Authorizations
JWT bearer token issued by the identity provider.
Headers
Client-chosen idempotency key. REQUIRED: an absent key is 422, never a generated default.
"idem-legado-renegociar-0001"
Body
Employer inscription type: 1 CNPJ, 2 CPF.
1, 2 "1"
1 = Padrão; 2 = Portabilidade. Portabilidade requires at least one contratoLegado carrying numeroUnico; Padrão forbids numeroUnico on every item.
1, 2 1
Every legado contract folded into this renegociação (§3.3.1, Obrigatório=Sim).
1Worker CPF, exactly 11 digits.
^[0-9]{11}$"99999999999"
End date of the NEW consignado contract, RFC 3339 UTC.
"2026-06-23T00:00:00Z"
Start date of the NEW consignado contract, RFC 3339 UTC.
"2025-04-03T00:00:00Z"
Date of the first payroll deduction of the NEW contract, RFC 3339 UTC.
"2025-04-23T00:00:00Z"
Matrícula assigned to the worker by the employer. Cannot be blank or whitespace-only.
30^\S(.*\S)?$"99999999999-A"
Worker's full name (Manual 007 §3.3.1 publishes 90 characters — the mirrored Swagger's 100 is not the bound this gateway enforces). Cannot be blank or whitespace-only.
90^\S(.*\S)?$"Trabalhador 99999999999"
The NEW contract's number, minted by the CLIENT. 1 to 15 alphanumeric characters, no diacritics (§3.3.1 + its footnote 3).
1 - 15^[A-Za-z0-9]+$"99999999999AN1"
Employer inscription number: 14 digits for CNPJ, 11 for CPF (matching codigoInscricaoEmpregador; §3.3.1's own '15 algarismos' is a stale maximum, see ports.ValidateNumeroInscricaoEmpregador).
^[0-9]{11,14}$"42422253000101"
Total number of instalments of the NEW contract.
1 <= x <= 99915
valorCETAnual — Custo Efetivo Total, annual percent decimal string.
^[0-9]+(\.[0-9]{1,2})?$"4.91"
valorCETMensal — Custo Efetivo Total, monthly percent decimal string.
^[0-9]+(\.[0-9]{1,2})?$"0.4"
valorEmprestimo — the new contract's principal (decimal string, BRL).
^[0-9]+(\.[0-9]{1,2})?$"12000.00"
valorIOF — the IOF charged, in reais (decimal string, BRL). Required by the manual despite the mirrored Swagger's required list omitting it.
^[0-9]+(\.[0-9]{1,2})?$"0.00"
valorLiberado — amount delivered to the worker (decimal string, BRL). Required by the manual despite the mirrored Swagger's required list omitting it.
^[0-9]+(\.[0-9]{1,2})?$"12000.00"
valorParcela — the new contract's instalment amount (decimal string, BRL).
^[0-9]+(\.[0-9]{1,2})?$"825.10"
valorTaxaAnual — annual interest rate, percent decimal string. Must stay below the original legado contract's own rate — a comparison this gateway holds no local record of and leaves to the rail.
^[0-9]+(\.[0-9]{1,2})?$"4.91"
valorTaxaMensal — monthly interest rate, percent decimal string.
^[0-9]+(\.[0-9]{1,2})?$"0.4"
CNPJ of the operator (correspondente, cooperado or similar) responsible for the operation, exactly 14 digits, unpunctuated. Optional (§3.3.1) — omitted entirely rather than sent malformed; competenciaInicioDesconto below is the other optional field on this body. Dataprev performs no documental validation of legado data (§2.2.1.3), so this shape guard is the only one the CNPJ gets before the rail is spent.
^[0-9]{14}$"99999999999962"
Payroll competência of the first deduction, yyyyMM. Optional; the rail assumes the current competência when omitted.
^[0-9]{6}$"202504"
Response
OK
The rail's own outcome code — a closed enum of roughly 290 values including SUCESSO. NOT redundant with the 200 status: read this field.
"SUCESSO"
Payroll competência of the first deduction, yyyyMM.
"202504"
The rail's own message.
"Renegociacao efetuada com sucesso"
The new contract's number, as confirmed by the rail.
"99999999999AN1"
Top-level errors, if any.
Per-legado-contract failures, if any. A non-empty list here does NOT mean the new contract failed to averbate.

