Build eSocial Event XML (S-1200 Remuneração)
Skill: Convert payroll/labor data into an eSocial event XML
Region: Brazil (Brasil) Category: Payroll — eSocial (Sistema de Escrituração Digital das Obrigações Fiscais, Previdenciárias e Trabalhistas) Does: Takes a worker's monthly payroll/labor data and produces an eSocial event XML — e.g. S-1200 (Remuneração de trabalhador vinculado ao RGPS) with its companion S-1210 (Pagamentos) — per the leiaute do eSocial, signed with certificado ICP-Brasil and transmitted to the Ambiente Nacional do eSocial web service, which returns a recibo de entrega. Standard: eSocial — leiaute vigente (Schemas XSD do eSocial, MOS — Manual de Orientação do eSocial)
eSocial events are individual signed XML documents grouped in a
eSocialenvelope and posted to the web service (lote de eventos). Each event carries anIdof 36 characters (ID+ tipo + CNPJ/CPF + timestamp + sequencial). Events follow an ordering (tabelas → não-periódicos → periódicos S-1200/S-1210 → fechamento S-1299). Confirm the active leiaute version (e.g. the currentversaoin the namespace) and the correct event for the fact before use.
When this applies
- Monthly reporting of remuneração of workers (empregados, contribuintes individuais, etc.) and the associated bases de cálculo of INSS, FGTS and IRRF.
- S-1200 carries the remuneração and its rubricas; S-1210 reports the actual pagamentos; the movement is closed by S-1299 (Fechamento dos eventos periódicos) which liberates the totals for the DCTFWeb.
- Rubricas and natureza must first exist in the tabela S-1010 (Rubricas); the worker in S-2200/S-2300 (admissão / TSV).
Input data required
| Group | Fields |
|---|---|
Identificação do evento (ideEvento) |
tpAmb, procEmi, verProc, indRetif, perApur (AAAA-MM) |
Empregador (ideEmpregador) |
tpInsc (1 CNPJ), nrInsc (CNPJ raiz, 8 dígitos) |
Trabalhador (ideTrabalhador) |
cpfTrab |
Demonstrativo (dmDev) |
ideDmDev, codCateg, estabelecimento (tpInsc/nrInsc), lotação (codLotacao) |
Rubricas (itensRemun) |
codRubr, ideTabRubr, qtdRubr, vrRubr, indApurIR |
| Pagamentos (S-1210) | tpPgto, dtPgto, vrLiq, detPgtoFl referenciando o perApur |
Document structure (S-1200)
eSocial (xmlns="http://www.esocial.gov.br/schema/evt/evtRemun/v_S_01_..._00")
└── evtRemun Id="ID1<CNPJ8><...><seq>"
├── ideEvento (indRetif, perApur, tpAmb, procEmi, verProc)
├── ideEmpregador (tpInsc=1, nrInsc = CNPJ raiz 8 dígitos)
├── ideTrabalhador (cpfTrab)
│ └── infoComplem / infoInterm (when applicable)
└── dmDev
└── ideDmDev (codCateg, ...)
└── infoPerApur
└── ideEstabLot (tpInsc, nrInsc, codLotacao)
└── remunPerApur
└── itensRemun (codRubr, ideTabRubr, vrRubr, indApurIR)
└── Signature (ds:Signature, ICP-Brasil)
S-1210 (evtPgtos) mirrors the structure with ideBenef/infoPgto referencing the same perApur.
Calculation rules
- The sum of rubricas in
itensRemunper natureza forms the bases de cálculo: INSS (salário-de-contribuição até o teto), FGTS (8% sobre a base), IRRF (after deductions). - Each rubrica's tax/contribution incidence (
incCP,incIRRF,incFGTS) is defined in the tabela S-1010, not in the event — the event only referencescodRubr/ideTabRubr. - INSS do segurado is progressive (faixas de alíquota up to the teto do RGPS); the employer's cota patronal and FGTS are computed over the bases.
S-1299consolidates all periódicos; the totals feed the DCTFWeb for the period.- Retification: set
indRetif=2and carry thenrReciboof the event being retificado.
Worked example (S-1200, one rubrica, outline)
<?xml version="1.0" encoding="UTF-8"?>
<eSocial xmlns="http://www.esocial.gov.br/schema/evt/evtRemun/v_S_01_03_00">
<evtRemun Id="ID1123456780000002026060410150000001">
<ideEvento>
<indRetif>1</indRetif>
<perApur>2026-05</perApur>
<tpAmb>1</tpAmb>
<procEmi>1</procEmi>
<verProc>FolhaExemplo-1.0</verProc>
</ideEvento>
<ideEmpregador>
<tpInsc>1</tpInsc>
<nrInsc>12345678</nrInsc>
</ideEmpregador>
<ideTrabalhador>
<cpfTrab>12345678909</cpfTrab>
</ideTrabalhador>
<dmDev>
<ideDmDev>1</ideDmDev>
<codCateg>101</codCateg>
<infoPerApur>
<ideEstabLot>
<tpInsc>1</tpInsc>
<nrInsc>12345678000195</nrInsc>
<codLotacao>0001</codLotacao>
<remunPerApur>
<matricula>EMP-0001</matricula>
<itensRemun>
<codRubr>1000</codRubr>
<ideTabRubr>01</ideTabRubr>
<vrRubr>5000.00</vrRubr>
<indApurIR>0</indApurIR>
</itensRemun>
</remunPerApur>
</ideEstabLot>
</infoPerApur>
</dmDev>
</evtRemun>
<!-- Signature ICP-Brasil -->
</eSocial>
The signed event is enviado em lote ao Ambiente Nacional do eSocial, which returns the recibo de entrega; after S-1299 the bases feed the DCTFWeb.
Validation checklist
- Correct event chosen (S-1200 remuneração / S-1210 pagamentos) and current leiaute/versão namespace used;
tpAmbcorrect (1 produção / 2 homologação) -
Idof 36 characters well-formed;perApur(AAAA-MM) correct;indRetif/nrReciboset when retificando -
ideEmpregadornrInscis the CNPJ raiz (8 dígitos);cpfTrabvalid; worker exists via S-2200/S-2300 - Each
itensRemunreferences acodRubrthat exists in tabela S-1010, with the rightideTabRubr - Bases de INSS/FGTS/IRRF derivam das rubricas e respeitam tetos/faixas;
codCateg/codLotacaoválidos - Event signed with certificado ICP-Brasil; schema-valid against the eSocial XSD
- Sent in lote, recibo obtained; S-1299 fecha o período so the totals flow to the DCTFWeb
Last updated: 2026-06-04 — confirm the active layout version, field codes, and SEFAZ/Receita Federal requirements against the current specifications before use.