Spanish e-invoice validator

Check the XML Spain's e-invoicing rules ask for: the invoice records of a VERI*FACTU system with the checks the AEAT runs on them, a Facturae invoice with the public sector's validation rules, or a B2B invoice for the AEAT's public solution (SPFE) against UBL 2.5. Nothing is uploaded

B2B e-invoicing in Spain in short

Real Decreto 238/2026 of 25 March makes invoices between Spanish businesses and professionals electronic, except simplified invoices. It applies from a date counted from the ministerial order on the public solution: Orden HAC/1028/2026, in force since 6 October 2026. From then, companies with a turnover over 8 million euros in the previous year have twelve months, until October 2027, and everyone else twenty-four, until October 2028. During their first twelve months, the larger companies also send a PDF of each e-invoice unless the buyer agrees to the XML alone.

An invoice follows the EN 16931 data model in one of four syntaxes: UBL, CII, EDIFACT or Facturae. Businesses can send it through a private platform or through the AEAT's public solution (Solución Pública de Facturación Electrónica, SPFE), which takes UBL only and is free; a private platform sends the SPFE a faithful copy (copia fiel) of each invoice in UBL. Buyers report the status of invoices, including when they are paid in full.

The SPFE format is set by Anexo I of the Order: UBL invoices with the specification identifier (BT-24) urn:cen.eu:en16931:2026#conformant#urn:aeat.es:spfe:1.0.0:extended and Spanish fields such as the regime key of each line.

Two other formats are in force already. Suppliers of the public administration send Facturae invoices through FACe. And under the Reglamento VERI*FACTU, invoicing software keeps chained invoice records, which a VERI*FACTU system sends to the AEAT: from 1 January 2027 for companies paying corporate tax and from 1 July 2027 for everyone else (Real Decreto-ley 15/2025).

How to check a Spanish invoice

  1. Open the validator with the SPFE invoice profile, or the Facturae or VERI*FACTU one. A file opened or pasted picks the right one from its identifier or document element.
  2. Paste the XML or drop the file, then press Validate.
  3. Every finding shows its line; click it to jump there in the editor.

What is checked

For the SPFE, the UBL 2.5 schema: the first of the three checks the AEAT describes in its validations document (version 0.1.0, October 2026), with the normative schemas of the OASIS release that the AEAT names. The AEAT takes Invoice documents only, no credit notes.

The second check is the EN 16931 rules in their 2026 edition, which CEN has not yet published as validation artefacts. The current ones (1.3.17) reject the NIF written with schemeID "FC" that Anexo I asks for, so running them would fail correct invoices; we will add the rules when the 2026 edition is out. The third check is the AEAT's own business rules, which it will publish step by step.

For VERI*FACTU, the AEAT's schema, then the checks the AEAT lists in its validations document (version 1.2.2) that need only the file, with its own error codes: the tax amount within 10 euros of base times rate (VF-1142), the totals of the record (VF-2005, accepted with errors), the regime key (VF-1245), recipients for a full invoice (VF-1189), the rates and surcharges allowed on each date, the form of the chain's fingerprints, and the record's own fingerprint, recomputed from its fields as the AEAT does (VF-2000, accepted with errors). A Spanish NIF with a wrong check character and an EU VAT number of the wrong form are our checks. The AEAT's census lookups and the records sent before are not checked here.

For Facturae, the Ministry of Finance's schema, then the validation rules every public administration's invoice register and FACe apply (Orden HAP/1650/2015): the seller's NIF, line totals as quantity times price rounded to cents (HAP1650-6a), the invoice totals, the corrected invoice of a corrective one, and the three DIR3 codes for a buyer that is a public administration (HAP1650-8a). The signature and whether the DIR3 codes exist are checked by FACe.

The AEAT runs a validation service for SPFE invoices only in its test environment, with a certificate, one invoice at a time, and asks developers to validate locally. This page does that in your browser.

Profiles to check with

  • Spain B2B e-invoice (SPFE, UBL 2.5): A Spanish B2B e-invoice in the format of the AEAT's public e-invoicing solution (SPFE), checked against the UBL 2.5 schema the AEAT validates with. Validate
  • Facturae 3.2.2: The Spanish e-invoice format, required for invoices to the public sector through FACe. Validate
  • VERI*FACTU invoice records: 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. Validate
  • UBL 2.5 Invoice: The UBL invoice in its latest version, 2.5 (August 2026), the version Spain's public e-invoicing solution checks against. Validate

Rules invoices break most

Each one has a page with what it checks, its test and, for many, how to fix it

  • VF-1142: CuotaRepercutida is more than 10 euros away from the base (BaseImponibleOimporteNoSujeto) times the rate (TipoImpositivo).
  • VF-2005: ImporteTotal is more than 10 euros away from the sum of the breakdown's bases, tax amounts and equivalence surcharges. The record is accepted with errors to cor...
  • VF-1245: ClaveRegimen (the VAT regime) is required when the tax is VAT (01), IGIC (03) or left out.
  • VF-1189: An invoice of type F1, F3, R1, R2, R3 or R4 needs at least one recipient (Destinatarios).
  • HAP1650-6a: In an invoice in euros, a line's TotalCost (…) must be Quantity × UnitPriceWithoutTax rounded to cents (…), its GrossAmount (…) TotalCost - discounts + charges...
  • HAP1650-8a: The buyer is a public administration (NIF …), so its administrative centres must give all three DIR3 codes: the accounting office (01), the managing body (02) a...

Questions

Is the invoice uploaded?

No. The schema check runs in your browser. Only the API and URL monitors validate on our servers.

Does a valid result mean the SPFE will accept the invoice?

Not yet: it means the invoice passes the UBL 2.5 schema. The SPFE also runs the EN 16931 rules (2026 edition) and the AEAT's business rules, which are not published as artefacts yet.

Does a valid VERI*FACTU record mean the AEAT will accept it?

It passes the schema and the AEAT's checks that need only the file, with the AEAT's own error codes (VF-1108 is the AEAT's 1108). The fingerprint (Huella) is recomputed here as the AEAT does. The AEAT also looks NIFs up in its census and compares the record with the ones sent before, which this check does not do.

Why does the AEAT's example use a different business process (BT-23)?

Anexo I of the Order gives urn:aeat:names:specification:ubl:schema:profile:B2B, while the AEAT's example invoice has urn:aeat:names:specification:schema:profile:B2B. The schema accepts both; our example follows the Order.

Can I check invoices from code?

Yes: the API and the command-line client with --schema es-spfe-invoice, facturae-3.2.2 or verifactu-1.0, or --schema auto for a folder of mixed files.

Official sources

Other countries