Build Contabilidad Electrónica XML (Catálogo de Cuentas + Balanza)
Skill: Convert the ledger into the SAT Contabilidad Electrónica XML deliverables
Region: Mexico (México)
Category: Accounting — Contabilidad Electrónica
Does: Takes the chart of accounts and the trial balance and produces the Contabilidad Electrónica XML deliverables required by the SAT — the Catálogo de Cuentas (catalogocuentas:Catalogo) and the monthly Balanza de Comprobación (BCE:Balanza) — built to the SAT XSD and submitted through the Buzón Tributario.
Standard: SAT Contabilidad Electrónica (Anexo 24) — Catálogo de cuentas 1.3 + Balanza de comprobación 1.3
Contabilidad Electrónica requires uploading the Catálogo de Cuentas (once, then when it changes) and a monthly Balanza de Comprobación mapped to the SAT código agrupador (the standardized account grouping). Each account in the catálogo declares its
CodAgrup,NumCta,NivelandNatur(D/A); the balanza reports opening, debit, credit and closing balances per account. Files are signed with the e.firma (FIEL) and delivered through the Buzón Tributario. Validate against the Anexo 24 XSD before sending.
When this applies
- Taxpayers required to keep electronic accounting send the Catálogo de Cuentas when it is first set up or modified, and the Balanza de Comprobación monthly (legal persons generally by the 3rd day, physical persons by the 5th day, of the second following month).
- A balanza de cierre (annual closing trial balance,
TipoEnvio="C") is filed after year-end adjustments. - The SAT may additionally request Pólizas del periodo and Auxiliares (the
PLZ/auxiliary schemas) on review.
Input data required
| Deliverable | Key nodes / attributes |
|---|---|
| Catálogo header | Catalogo@Version=1.3, @RFC, @Mes, @Anio |
| Each account | Ctas@CodAgrup (código agrupador SAT), @NumCta, @Desc, @Nivel, @Natur (D/A) |
| Balanza header | Balanza@Version=1.3, @RFC, @Mes, @Anio, @TipoEnvio (N normal / C complementaria) |
| Each balance line | Ctas@NumCta, @SaldoIni, @Debe, @Haber, @SaldoFin |
| Signing | e.firma (FIEL) certificate + sello over the XML |
Mexican specifics: the NumCta in the balanza must exist in the uploaded catálogo; the código agrupador (CodAgrup) maps each account to the SAT's standard grouping so the authority can read any taxpayer's accounts uniformly. Amounts are in MXN with 2 decimals.
Document structure
catalogocuentas:Catalogo (Version=1.3, RFC, Mes, Anio)
└── catalogocuentas:Ctas (CodAgrup, NumCta, Desc, SubCtaDe, Nivel, Natur) [one per account]
BCE:Balanza (Version=1.3, RFC, Mes, Anio, TipoEnvio)
└── BCE:Ctas (NumCta, SaldoIni, Debe, Haber, SaldoFin) [one per account]
Both files carry namespaces under http://www.sat.gob.mx/esquemas/ContabilidadE/1_3/... and xsi:schemaLocation to the Anexo 24 XSD.
Calculation rules
Natur=Dfor accounts of debit nature (activo, costos, gastos),Afor credit nature (pasivo, capital, ingresos).- Balanza per account:
SaldoFin = SaldoIni ± (Debe − Haber)per the account's nature (debit-nature:SaldoIni + Debe − Haber; credit-nature:SaldoIni − Debe + Haber). - Σ
Debeacross all accounts = ΣHaber(the trial balance must balance) for the period's movements. - Every
NumCtain the balanza must be present in the active catálogo;Nivelreflects the account hierarchy depth. - Amounts in MXN to 2 decimals; the closing balanza (
TipoEnvio="C") includes year-end adjustment entries.
Worked example (Catálogo + Balanza, abridged)
<?xml version="1.0" encoding="UTF-8"?>
<catalogocuentas:Catalogo
xmlns:catalogocuentas="http://www.sat.gob.mx/esquemas/ContabilidadE/1_3/CatalogoCuentas"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Version="1.3" RFC="AAA010101AAA" Mes="06" Anio="2026">
<catalogocuentas:Ctas CodAgrup="101.01" NumCta="101-01" Desc="Caja" Nivel="2" Natur="D"/>
<catalogocuentas:Ctas CodAgrup="102.01" NumCta="102-01" Desc="Bancos nacionales" Nivel="2" Natur="D"/>
<catalogocuentas:Ctas CodAgrup="201.01" NumCta="201-01" Desc="Proveedores nacionales" Nivel="2" Natur="A"/>
<catalogocuentas:Ctas CodAgrup="401.01" NumCta="401-01" Desc="Ventas y/o servicios gravados" Nivel="2" Natur="A"/>
</catalogocuentas:Catalogo>
<?xml version="1.0" encoding="UTF-8"?>
<BCE:Balanza
xmlns:BCE="http://www.sat.gob.mx/esquemas/ContabilidadE/1_3/BalanzaComprobacion"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Version="1.3" RFC="AAA010101AAA" Mes="06" Anio="2026" TipoEnvio="N">
<BCE:Ctas NumCta="102-01" SaldoIni="150000.00" Debe="500000.00" Haber="420000.00" SaldoFin="230000.00"/>
<BCE:Ctas NumCta="201-01" SaldoIni="80000.00" Debe="300000.00" Haber="350000.00" SaldoFin="130000.00"/>
<BCE:Ctas NumCta="401-01" SaldoIni="0.00" Debe="0.00" Haber="450000.00" SaldoFin="450000.00"/>
</BCE:Balanza>
Each file is signed with the e.firma (FIEL) and uploaded through the Buzón Tributario for the period.
Validation checklist
- Catálogo
Version="1.3"withRFC,Mes,Anio; every account hasCodAgrup,NumCta,Desc,Nivel,Natur -
CodAgrupmaps each account to the current SAT código agrupador - Balanza
Version="1.3"with correctTipoEnvio(Nnormal,Ccomplementaria); annual closing balanza when due - Every
NumCtain the balanza exists in the active catálogo - Per account
SaldoFin = SaldoIni ± (Debe − Haber)by nature; ΣDebe= ΣHaber - Amounts in MXN to 2 decimals; passes Anexo 24 XSD validation
- Files signed with e.firma (FIEL) and delivered via the Buzón Tributario by the deadline
Last updated: 2026-06-04 — confirm the active CFDI/SAT schema version, catálogos, and PAC/portal requirements against the current SAT specifications before use.