# Spain B2B e-invoice (SPFE, UBL 2.5)

Source: https://xmlvalid.com/schemas/es-spfe-invoice

> 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.

Real Decreto 238/2026 makes e-invoices between Spanish businesses and professionals mandatory. Orden HAC/1028/2026, in force since 6 October 2026, sets up the AEAT's public solution (Solución Pública de Facturación Electrónica, SPFE) and starts the clock: twelve months for companies with a turnover over 8 million euros, twenty-four for the rest.
Invoices sent to the SPFE are UBL invoices that follow EN 16931 with the Spanish fields of Anexo I of the Order: CustomizationID urn:cen.eu:en16931:2026#conformant#urn:aeat.es:spfe:1.0.0:extended, the regime key of each line (REGI) and the NIF with schemeID "FC".

- Type: XSD
- Version: SPFE 1.0.0 (Orden HAC/1028/2026), UBL 2.5
- Namespace: `urn:oasis:names:specification:ubl:schema:xsd:Invoice-2`
- Root element: `Invoice`
- Publisher: Agencia Tributaria (AEAT), on OASIS UBL 2.5 (OASIS copyright notice), source: https://www.agenciatributaria.es/AEAT.desarrolladores/Desarrolladores/_menu_/Documentacion/Solucion_Publica_de_Facturacion_Electronica__SPFE_/Solucion_Publica_de_Facturacion_Electronica__SPFE_.html
- Validate against it: https://xmlvalid.com/validate?schema=es-spfe-invoice

## Notes

- This entry checks the UBL 2.5 schema, the first of the three checks the AEAT lists in its validations document (version 0.1.0, October 2026). The AEAT accepts Invoice documents only, never a CreditNote or another document type in their place; it also accepts older UBL 2 versions when the invoice meets Anexo I.
- The second check, the EN 16931 rules in their 2026 edition, is not run here: CEN has not yet published the 2026 validation artefacts, and the current ones (1.3.17) reject the NIF written with schemeID "FC" that Anexo I asks for (BR-CL-11). The third, the AEAT's own business rules, will be published by the AEAT step by step.
- Anexo I gives the business process (BT-23) as urn:aeat:names:specification:ubl:schema:profile:B2B, while the AEAT's example invoice uses urn:aeat:names:specification:schema:profile:B2B. The schema accepts both.
- Anexo I uses CopyIndicator (BT-ES-1), which UBL 2.5 deprecates: the AEAT checks against the normative schemas, which still allow it, so this entry does too.
- The example is by xmlvalid.com, with made-up companies, after the AEAT's example invoice; it also passes the current EN 16931 rules, with one warning for the line's ValueQualifier.
