Fetch a worker's available consignable margin
Opens or reuses the worker’s authorization and reads available payroll margin — the rail’s autorizar-consulta-dados-trabalhador (Manual 002 v1.15 §3.1) and consultar-dados-trabalhador (Manual 002 v1.15 §3.3) behind ONE operation, because the adapter performs them as one. POST, not GET: it opens a consent, and the consent evidence plus the CPF must travel in a body rather than in a path or query string. The worker’s authorization token is NEVER returned. A consignado.margin.fetched fact is emitted on this path exactly as on the lender event path, so a client integrating by API keeps its other consumers fed.
CONSENT WINDOW (Manual 002 v1.15 §5.6). dataHoraAutorizacaoDigital starts two clocks, measured in calendar days from the worker’s signature: the authorization may be CONSULTED for 30 days, and a request may be MADE against it for 45. Both boundaries are INCLUSIVE — the instant exactly 30 or 45 days after the signature is still inside its window, and only the next nanosecond is outside.
Outside either window the gateway refuses LOCALLY, before a byte reaches the rail: 422 with code CLT-0006 and a detail telling you to obtain a fresh worker authorization. THAT REFUSAL IS NOT RETRYABLE. Repeating the request performs the very read the lapsed authorization withdrew; only new authorization evidence makes it succeed. A dataHoraAutorizacaoDigital carrying a non-UTC offset, or dated ahead of the gateway’s clock, is the same 422 with a different detail — correct the timestamp; the worker’s consent is not in question.
Contrast the rail’s OWN consent rejection (Dataprev EX/IV on a stale tokenAutorizacao): that is 503 and IS retryable, because the gateway drops the cached token and the next attempt opens a fresh consent from the same evidence.
Authorizations
JWT bearer token issued by the identity provider.
Body
Employer inscription TYPE code: 1 = CNPJ, 2 = CPF.
1, 2 "1"
The worker's grupo-1 consent evidence. Relayed verbatim; never synthesized here.
Worker CPF, exactly 11 digits — a CPF is eleven digits by definition (Manual 002 v1.15 §3.1.1 p.8 types the request field Número, 11 algarismos). Body-only by design: a path or query CPF lands in proxy and ingress logs.
^[0-9]{11}$"12345678901"
Employment bond matrícula (Texto 1..30, Manual 002 v1.15 §3.3.1, errors OT/SI).
30"M-1"
Employer inscription number, relayed verbatim as Texto. Required: Manual 002 v1.15 §3.3.1 marks it Obrigatório on the worker data read.
1"12345678000199"
Client-chosen correlation reference echoed onto the emitted consignado.margin.fetched fact.
"req-1"
Response
OK
Instant the gateway observed this margin (UTC).
"2026-07-30T12:00:00Z"
Available consignable margin (decimal string, BRL). Never a float.
"1234.56"
Disposable remuneration base (decimal string, BRL). Never a float.
"5000.00"
How many consignados already sit active or suspended on this bond. Manual 002 v1.15 §3.3.2 p.17 publishes the ceiling: 9 per employment bond, so a bond at 9 takes no tenth however much margin it shows. Absent when the rail said nothing; 0 is a live count.
2
The consignado block on this employment bond (Manual 002 v1.15 §3.3.2 table p.18: 0 no block, 1 blocked by the worker, 2 blocked by the MTE). A blocked bond can show a POSITIVE margin and still take no consignado, so this is not derivable from availableMargin. Code 0 is a live value.
The correlation reference the request supplied.
"req-1"
The rail's own eligibility verdict for this worker. ABSENT when the read carried no verdict — which is NOT the same statement as false. Decode into a nullable boolean: collapsing absence into false recreates a refusal the rail never made.
true
The employer's registration data as eSocial holds it (Manual 002 v1.15 §3.3.2). Absent when the rail sent none of it. It carries no trade name and no legal nature: Dataprev publishes neither.
The employment bond's registration data (Manual 002 v1.15 §3.3.2). Absent when the rail sent none of it.
The worker's gross pay for the period the margin was computed against (decimal string, BRL). The denominator the margin is a slice of. Absent when the rail did not publish it — never "0".
"7000.00"
WHY the rail refused (Manual 002 v1.15 §3.3.2 code table p.16: 1 legacy loan in eSocial, 2 legacy loan reported by the institution, 3 zero remuneration, 4 bond has a termination date, 5 no remuneration in the last competência, 6 invalid labour regime, 7 invalid worker category, 8 bond whose previous loan closed on termination, 9 employer not in the programme). The codes are not one kind: 3 and 5 clear with the next payroll competência, 4 never clears.
The share of severance pay available as collateral on this bond (Manual 002 v1.15 §3.3.2 p.17, NÚMERO(3,2)) — a PERCENT PER the manual, as an exact decimal string relayed verbatim and never converted. 40.00 means forty percent, not 0.40.
"40.00"
The BOND's termination date (Manual 002 v1.15 §3.3.2 p.15). A bond with one has no future payroll for an instalment to be discounted from. Absent when the bond is not terminated.
"2026-06-30T00:00:00Z"
The eSocial termination-reason code, relayed VERBATIM and never interpreted. Manual 002 v1.15 §3.3.2 p.15 types it "Número, 2 algarismos" and points at the eSocial "Motivos de Desligamento" table rather than reproducing it; JSON has no leading-zero literal, so a code beginning with 0 arrives one digit short and travels that way. Zero-pad to the published width before looking it up.
"2"
The worker's registration data as Dataprev returns it on this read (Manual 002 v1.15 §3.3.2). Absent when the rail sent none of it.

