Import a contract already averbado outside this gateway
Adopts a contract that is ALREADY averbado on the payroll rail — registered on the Dataprev portal by hand, by a previous provider, or carried in from a book you are migrating — so its recurring saldo devedor obligation (Manual 015 §2.2) exists here and its first M015 report is scheduled.
It does NOT averbate anything and it moves no money: the only call it makes to Dataprev is consultar-emprestimo-trabalhador (Manual 005 v1.13 §3.2.1), a read, under your own credential. Everything the obligation needs — the worker’s CPF and matrícula, the employer inscription, the instalment count, the instalment amount and the first discount competência — is taken from that read. You send the contract number and, optionally, how many competências have already amortized; you never send worker or employer identifiers, and none come back.
Only a LIVE contract can be imported: situação 0 (Ativo), 7 (Contrato suspenso), 8 (Suspenso banco) or 17 (Contrato suspenso por antecipação de parcela). A suspension is not a closure — the deduction is still attached to the worker and the debt is still reportable. Situação 2, 3, 15 and 16 are closed and refused 422 whose detail names the código the registry published (situacaoEmprestimo 3 não é vigente) and nothing else — Dataprev’s own descrição is never relayed into the body. Importing one would make this gateway file recurring reports about a debt the registry already ended. A read that carries no situação at all, no competência de início de desconto, or one that answers about a different contract number, is refused 422 the same way rather than guessed at.
The import is not idempotent in the ordinary sense: a contract this tenant already holds an obligation for is answered 409 CONTRACT_ALREADY_REGISTERED, with nothing changed and the parcelas_pagas you sent NOT applied. X-Idempotency is still required, and the transport middleware replays the answer of a duplicate request under the same key.
Authorizations
JWT bearer token issued by the identity provider.
Headers
Required idempotency key. Absent is 422, never a generated default.
"idem-import-1"
Path Parameters
The contract number as the RAIL holds it (Manual 005 v1.13 §3.2.1 p.13, 2..15 alphanumerics). It is the only identifier the import takes: everything else about the contract is read back from Dataprev.
2 - 15"199971600000"
Body
How many monthly competências of this contract have ALREADY amortized under whoever averbou it. It must lie between 0 and the contract's own total de parcelas as the rail reports it; anything outside that is refused 422. Leave it at 0 only for a contract that has genuinely not been discounted yet — a higher value than reality makes the first saldo devedor report understate the debt, and a lower one overstates it.
x >= 07
Response
Created
The first payroll competência the discount runs in, as the rail's verbatim AAAAMM literal.
"202601"
The contract that was imported.
"199971600000"
The contract's total de parcelas, as the rail reports it. Read back, never supplied.
24
Always "importado" on this route — the provenance stamped on the obligation, distinguishing it forever from one this gateway averbou.
importado "importado"
The amortized count recorded on the obligation — the value sent with the request.
7
Always true on a 201: the contract's first M015 saldo devedor report was scheduled durably alongside the obligation. It does NOT mean the report has been delivered to Dataprev — the outbox does that afterwards.
true
The rail's own situação código for the contract at the moment it was imported (Manual 005 §3.2.2 p.17). Only 0, 7, 8 and 17 are importable.
0
The instalment, as the rail reports it, verbatim (BRL decimal string).
"1116.31"

