1. Configure a tenant
Before a tenant can call the rail, register:- an ICP-Brasil A1 client certificate and private key
- OAuth2 client credentials
- the tenant’s three-digit Dataprev requester code
- optionally, the worker portal base URL offered as a formalization contact in bid proposals
2. Read worker data and margin
The margin endpoint authenticates the tenant, obtains the worker’s Dataprev authorization context, and returns the rail response without turning it into an underwriting decision. The API also exposes new employment links, termination reports, authorized FGTS records, and FGTS balance reads.3. Discover auctions and submit proposals
A scheduled discovery loop lists open loan requests. A client can then submit a bid through the authenticated HTTP API. The gateway retains the durable bid payload needed to prove what the client sent and later publishes the accepted-proposal witness. Every proposal must reach the worker through at least one contact. The gateway adds the tenant’s formalization portal as a contact when the tenant registers one. A bid may override that portal for its own submission. The gateway refuses a proposal with no registered portal and no client contact before it calls Dataprev. Portability auctions use a separate response operation and a bounded Dataprev request window.4. Register and fund the contract
The registration flow:- registers the contract with Dataprev
- attaches the CCB document when required
- exposes registration status and rail documents
- records the client’s disbursement confirmation
- publishes immutable booking and payment facts through the outbox
5. Service the contract
The API covers the rail lifecycle after registration: suspension, reactivation, term changes, installment anticipation and reversal, and exclusion. It also covers refinancing and reversal, renegotiation, portability registration, and legacy-contract operations. Portability runs in both directions. As the proponent institution, register the incoming portability. As the origin institution, exclude the contract the worker moved away. The gateway accepts that only for a contract it registered itself. It refuses anything else before it calls the rail. Reversing a refinancing works the same way. You can reverse a refinancing through this gateway only if the gateway registered it. The 7-business-day window is judged against the gateway’s own record of when that refinancing committed. Exclusion is a recoverable operation. The initial authenticated command records the intent, and a scheduled recovery loop drives admitted work to a terminal rail state. Repeating the same idempotent command does not create a second exclusion. Refinancing, reversal, renegotiation, and origin-side portability exclusion have a recovery loop of their own for the same reason. The loop converges a command whose outcome nobody established against the rail registry instead of losing it.6. Reconcile payroll and repasse
The reconciliation worker reads two independent Dataprev sources:- bookkeeping records, keyed by the payroll competence and contract context
- CEF repasse records, which represent the settlement movement
7. Operate portfolios and guarantees
Additional API families cover operational calendars, employment terminations, FGTS guarantee execution, funds, assigned credits, assignments, per-tenant throughput, usage, and event-delivery subscriptions.The API reference comes from the product’s
develop contract. Use the operation page for exact required headers, idempotency rules, validation ranges, and response schemas.
