FatturaPA (Italy / SdI)
00200
File non conforme al formato (schema XSD)
What it means
The FatturaPA XML does not conform to the official AgID schema (Schema_del_file_xml_FatturaPA v1.2.x): a required element is missing, an element is in the wrong order, or a value does not match the type/pattern/enumeration the schema allows.
How to fix it
Read the schema-violation message that follows: it names the offending element. Fix the element order (the FatturaPA schema sequences are strict), add the missing mandatory element, or correct the value to match the allowed type/codelist. Re-validate against Schema_del_file_xml_FatturaPA_v1.2.2.xsd before re-submitting to the SdI.
Example
<!-- WRONG: PECDestinatario before ContattiTrasmittente --> ... <CodiceDestinatario>0000000</CodiceDestinatario><PECDestinatario>x@pec.it</PECDestinatario><ContattiTrasmittente/> <!-- RIGHT --> <CodiceDestinatario>0000000</CodiceDestinatario><ContattiTrasmittente/><PECDestinatario>x@pec.it</PECDestinatario>
Catch this before it reaches the SdI:
# CLI
npx @eleata/validate-einvoice validate invoice.xml --format fatturapa
# GitHub Action — fail the build on any invalid invoice
- uses: hernaninverso/validate-einvoice-action@v1
with:
files: invoices/**/*.xml
api-key: ${{ secrets.EINVOICE_API_KEY }}