Recuperar el margen consignable disponible de un trabajador
Abre o reutiliza la autorización del trabajador y lee el margen de nómina disponible: autorizar-consulta-dados-trabalhador (Manual 002 v1.15 §3.1) y consultar-dados-trabalhador (Manual 002 v1.15 §3.3) de la red detrás de la operación una, porque el adaptador los realiza como uno solo. POST, no GET: abre un consentimiento, y la evidencia del consentimiento más CPF debe viajar en un cuerpo en lugar de en una ruta o cadena de consulta. Se devuelve el token de autorización del trabajador nunca. Se emite un hecho consignado.margin.fetched en esta ruta exactamente igual que en la ruta del evento del prestamista, por lo que un cliente que se integra mediante API mantiene alimentados a sus otros consumidores.
VENTANA DE CONSENTIMIENTO (Manual 002 v1.15 §5.6). DataHoraAutorizacaoDigital pone en marcha dos relojes, medidos en días calendario a partir de la firma del trabajador: la autorización puede ser CONSULTADA por 30 días, y una solicitud puede ser PRESENTADA en su contra por 45. Ambos límites son inclusivos: el instante exactamente 30 o 45 días después de que la firma todavía está dentro de su ventana, y solo el siguiente nanosegundo está afuera.
fuera de cualquiera de las ventanas, la gateway rechaza localmente, antes de que un byte llegue a la red: 422 con el código MYS-0006 y un detalle que le indica que obtenga una nueva autorización de trabajador. Esa negativa es no REINTENTABLE. Al repetir la solicitud se realiza la misma lectura de la autorización caducada y retirada; sólo nueva evidencia de autorización hace que tenga éxito. Un dataHoraAutorizacaoDigital que lleva un desplazamiento que no es UTC, o que tiene una fecha anterior al reloj de la gateway, es el mismo 422 con un detalle diferente: corrija la marca de tiempo; el consentimiento del trabajador no está en duda.
compare el rechazo de consentimiento propio de la red (Dataprev ex/iv en un tokenAutorizacao obsoleto): es 503 y se puede volver a intentar, porque la gateway descarta el token almacenado en caché y el siguiente intento abre un nuevo consentimiento a partir de la misma evidencia.
Autorizaciones
JWT bearer token issued by the identity provider.
Cuerpo
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 leaks into access logs and spans.
^[0-9]{11}$"12345678901"
Employment bond matrícula.
"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"
Respuesta
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 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"

