Facturae 3.2.2
The Spanish e-invoice format, required for invoices to the public sector through FACe.
About
Facturae is the XML format the Spanish Ministry of Finance publishes for electronic invoices. Suppliers of the public administration have to send it, signed, through FACe or a regional hub; version 3.2.2 is the current one.
One file (Facturae) holds a header with the batch totals, the seller and buyer, and one or more invoices with their taxes, totals and lines.
E-invoicing in Spain: the rules in short and how to check an invoice →
Good to know
- The schema checks structure and data types. The XAdES signature, NIF validity and arithmetic between totals are checked by FACe, not by the schema.
- The XML Signature import points at a local copy of the W3C schema; nothing else is changed.
- The example is by xmlvalid.com: one unsigned invoice with Spanish VAT at 21%.
Files
2 files · 192.3 KB-
Facturaev3_2_2.xsd main
-
xmldsig-core-schema.xsd
The validator loads all of these with their folder structure, so includes and imports resolve as published.
Example document
factura.xml · 4.1 KB · valid against this schema
In CI and from code
The same schema by its name, facturae-3.2.2, through the API.
npx @xmlvalid/cli validate "**/*.xml" --schema facturae-3.2.2
- uses: xmlvalid/validate-action@v1
with:
files: "**/*.xml"
schema: facturae-3.2.2
api-key: ${{ secrets.XMLVALID_API_KEY }}
curl https://xmlvalid.com/api/v1/validations \
-H "Authorization: Bearer $XMLVALID_API_KEY" \
-F document={{ $schema->example ?? 'document.xml' }} -F schema=facturae-3.2.2
Free accounts get 100 API validations a month. On Pro, a URL monitor can check a published document against this schema every hour and email you when it breaks. More CI setups