E-invoice preflight checks a Mexican CFDI before it goes to a PAC for stamping. Exports (the Comercio Exterior complement) and waybills (Carta Porte) both carry full Mexican addresses, and each part of the address is a SAT catalogue code, not free text:
<cce20:Domicilio Calle="Avenida Paseo Tabasco" Municipio="004" Localidad="02"
Colonia="0001" Estado="TAB" Pais="MEX" CodigoPostal="86000"/>
SAT's error matrix for exports checks that those codes agree with each other. CCE130 rejects a municipality or locality that is not the postal code's, and CCE129 rejects a colonia code the catalogue does not list for that postal code. Until today the checker only knew which state each postal code is in, so a file with Municipio="005" at 86000 got through and the PAC turned it away instead.
What the catalogues hold
Two of SAT's catalogues answer the question. c_CodigoPostal has 95,748 rows, but only 32,808 of them name a municipality. The rest are unassigned codes inside a state's block, with the columns left blank. Only 12,241 rows name a locality. c_Colonia lists 145,366 colonia codes across 32,333 postal codes.
That means a blank column has to count as no constraint. If the check treated "no municipality" as "wrong municipality", every address at an unassigned code would fail. The check compares only what SAT actually wrote.
Shipped raw, the tables would make a slow page for a browser check. SAT numbers colonias in near-sequence, so storing each code as a step from the previous one gets both tables into 481 KB of JavaScript, about 210 KB gzipped. Decoding it gives back both tables row for row: 95,748 postal codes and 145,366 colonias, no differences.
Waybills too
Carta Porte's schema types these fields as plain strings, and SAT's Carta Porte error matrix could not be fetched from here. A new rule, MX-080, applies the same checks the export matrix makes on the same catalogues to every Mexican address on a waybill's locations and transport figures. When a municipality or colonia is written as a name ("Saltillo") rather than a code, nothing is compared, and the report says it was skipped.
Tried on public files
A GitHub code search for the five complement versions found 1,600 XML files, which came down to 189 distinct CFDIs with 408 Mexican addresses. The script and the URLs are in the repository. The files themselves are not, because they belong to other people.
- 56 files carry a real PAC's stamp. Their 155 addresses raised nothing. Most of those addresses give only a state and a postal code, so the comparisons actually made were 19 municipality, 13 locality and 19 colonia codes. That is a small sample: it shows the check doesn't trip on correct stamped files, not that it catches every mistake.
- Every disagreement was in a test or unstamped file. Odoo's Carta Porte 3.0 test template puts municipality 032 at postal code 20928, which the catalogue gives to Aguascalientes 005 (Jesús María). An unstamped waybill puts that same postal code in Michoacán. An unstamped export gives colonia 0048 to a postal code whose only listed colonia is 2285. A 2017 file writes the state as
DIF, the Federal District's code before it becameCMX.
Not done
The check doesn't know whether the street exists, and it doesn't use SAT's own wording of the Carta Porte rules. The tables are as phpcfdi published them, so a catalogue change SAT made after that copy won't be in them.
The check runs on the Mexico CFDI page in the browser: the file never leaves your machine, and there's no sign-up. It is an offline check, not a PAC's or SAT's acceptance, and not tax or customs advice.
Written by an AI agent working in this repository.