XSD+SCH Agencia Tributaria (AEAT) · 1.0

VERI*FACTU invoice records

VERI*FACTU invoice records (Spain, RegFactuSistemaFacturacion)

The invoice records a Spanish invoicing system sends to the AEAT under VERI*FACTU: one record per invoice issued (alta) or cancelled (anulación), chained by their SHA-256 fingerprints

About

Real Decreto 1007/2023 (the Reglamento VERI*FACTU) sets what invoicing software in Spain must do: keep a record of every invoice, chain the records with a fingerprint (huella) and print a QR code on the invoice. Under Real Decreto-ley 15/2025, companies paying corporate tax must use such software from 1 January 2027 and everyone else from 1 July 2027.

RegFactuSistemaFacturacion is the message a VERI*FACTU system sends: a header with the taxpayer and up to 1000 records, each a RegistroAlta for an invoice issued or a RegistroAnulacion for one cancelled, with its breakdown by tax, the totals, the link to the previous record and the software that made it.

E-invoicing in Spain: the rules in short and how to check an invoice →

Good to know

  • After the schema, xmlvalid's rules run the AEAT's checks from its validations and errors document that can be made on the file, with its error codes: the issuer, dates, corrective invoices, the breakdown's rates and amounts, the totals, the chaining fields and the system's details. The codes the AEAT accepts with errors (2xxx) are warnings.
  • Each record's fingerprint (Huella) is recomputed from its fields as the AEAT's specification describes; a different one is accepted with errors (VF-2000), a warning here.
  • Not checked: the NIF census and other registry lookups, records sent before (whether the previous fingerprint is that record's), and checks that depend on the day of sending.
  • The schemas are the AEAT's SuministroLR.xsd and SuministroInformacion.xsd. The XML Signature import points at a local copy of the W3C schema; nothing else is changed.
  • Records sent to the AEAT travel inside a SOAP envelope; validate the RegFactuSistemaFacturacion element on its own.
  • The example is by xmlvalid.com, with made-up companies: the first record of a chain for one invoice at 10% VAT, with its fingerprint computed as the AEAT's specification describes.

Files

3 files · 60.1 KB · Download all (.zip)

The validator loads all of these with their folder structure, so includes and imports resolve as published

Business rules

Schematron · run in this order

The rules run after the schema check, only when the document matches the schema, and in your browser like the schema check (with SaxonJS by Saxonica). Each finding names its rule, such as BR-CO-15, and the line it points at; each rule has a page with what it checks.

Example document

verifactu-alta.xml · 3 KB · passes the schema and the rules

In CI and from code

The same schema by its name, verifactu-1.0, through the API.

npx @xmlvalid/cli validate "**/*.xml" --schema verifactu-1.0
- uses: xmlvalid/validate-action@v1
  with:
    files: "**/*.xml"
    schema: verifactu-1.0
    api-key: ${{ secrets.XMLVALID_API_KEY }}
curl https://xmlvalid.com/api/v1/validations \
  -H "Authorization: Bearer $XMLVALID_API_KEY" \
  -F document=@verifactu-alta.xml \
  -F schema=verifactu-1.0

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