FinchContext
Run with

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 eSocial envelope and posted to the web service (lote de eventos). Each event carries an Id of 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 current versao in the namespace) and the correct event for the fact before use.


When this applies


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


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


Last updated: 2026-06-04 — confirm the active layout version, field codes, and SEFAZ/Receita Federal requirements against the current specifications before use.