E-invoice format: UBL, CII, Facturae and EN 16931

A B2B e-invoice in Spain must be a structured message following the European semantic model EN 16931, in one of the syntaxes accepted by RD 238/2026: UBL, CII, EDIFACT or Facturae. The Spanish Tax Agency (AEAT) public solution uses UBL, and the true copy sent when issuing through a private platform is also in UBL.

What the obligation is and who it applies to: B2B e-invoicing.

The structured format is required from 6 October 2027 for businesses with a turnover over €8M and from 6 October 2028 for everyone else (dates published in the BOE). Details in Mandatory e-invoicing: deadlines.

The European EN 16931 model

EN 16931 is the European standard that defines the semantic model of an e-invoice: which data an invoice carries and what each one is called. It is not a file or a specific format: it is the common content that is then written in a syntax.

Accepted syntaxes: UBL, CII, EDIFACT and Facturae

Syntaxes accepted for B2B e-invoicing
SyntaxWhat it isAccepted in the public solution
UBLOASIS XML standard (Universal Business Language).Yes
CIICross Industry Invoice, UN/CEFACT XML syntax.No
EDIFACTUN/CEFACT electronic data interchange (EDI) standard, common in sectors that already exchange through EDI.No
FacturaeSpanish XML format, known for its use in invoicing public administrations.No

Sources: RD 238/2026 and AEAT analysis of 29 October 2026 (UBL in the public solution and the true copy).

The use of Facturae to invoice public administrations (B2G, through FACe) is a different obligation and is not covered here.

What UBL is

UBL (Universal Business Language) is an OASIS XML standard for business documents, invoices among them. It is the syntax of the AEAT public solution and of the true copy. The public solution takes UBL 2.5 as its reference and accepts earlier versions if they meet the content of annex I of the Order. The Peppol BIS Billing specification is based on it: more in Peppol.

Example of an e-invoice in XML

A UBL invoice is an XML document whose elements hold, in this general order, the data of the EN 16931 model:

  • the invoice identification: number, issue date and type;
  • the issuer and the recipient, with their NIFs and addresses;
  • the lines, with description, quantity, price and applicable tax;
  • the tax totals and the total amount;
  • the payment terms and means.

Each invoice is uniquely identified by the issuer’s NIF, the series and number, and the issue date (RD 238/2026, art. 7.5; Order HAC/1028/2026, art. 6).

This is how the official UBL invoice example the AEAT publishes on its public solution developer page begins. It is a pre-production example and the AEAT updates it often:

AEAT example (UBL, fragment)
<cbc:CustomizationID>urn:cen.eu:en16931:2026#conformant#urn:aeat.es:spfe:1.0.0:extended</cbc:CustomizationID>
<cbc:ProfileID>urn:aeat:names:specification:schema:profile:B2B</cbc:ProfileID>
<cbc:ID>CLASEA00000182</cbc:ID>
<cbc:CopyIndicator>false</cbc:CopyIndicator>
<cbc:IssueDate>2026-10-05</cbc:IssueDate>
<cbc:InvoiceTypeCode>380</cbc:InvoiceTypeCode>

Can a PDF be turned into an e-invoice?

A PDF is not an e-invoice, and an XML that does not follow the EN 16931 model in an accepted syntax does not comply either. You can generate an XML from the invoice data, but it is only an e-invoice if it follows the model and is exchanged through the system.

Formats and the API

The E-invoicing API is coming soon, with no date or price yet. If you already use the NIF management API for Verifactu, TicketBAI or SII, that integration carries over: the E-invoicing API will build on that common layer and will have a test environment in the free account, like the others. Today you can open the free account and read the documentation of the available APIs; NIF management is available with a subscription.

Test environment and test NIF included

Proven reliability

Hundreds of companies and software vendors in production with Verifacti. Data hosted in the EU and an SLA in the terms of use.

AEAT social collaborator

Specialists in Spain

Common and foral territory: Verifactu, TicketBAI and SII with one provider.

TicketBAI guarantor software in Álava, Bizkaia and Gipuzkoa

Built for developers

Public documentation with examples for every call, quick start guide, Postman collections, llms.txt and a free account with a test environment.

Typical integration: one to three developer days

Questions about the e-invoice format

Can a PDF invoice be converted to XML?

You can generate an XML, but it is only an e-invoice if it follows the EN 16931 model in an accepted syntax and is exchanged through the system.

Can I see an example of an e-invoice?

This page shows the structure of a UBL invoice and the start of the AEAT’s official example: see example in XML.

What is EDI in e-invoicing?

EDIFACT, the electronic data interchange (EDI) standard, is one of the accepted syntaxes; it is common in sectors that already exchange documents through EDI.

Is Facturae valid for e-invoicing between businesses?

Yes, it is one of the accepted syntaxes; the AEAT public solution uses UBL.

Create your free account

Try the available APIs today in the test environment, with a test NIF. The NIF management API, the common layer the E-invoicing API will build on, is available with a subscription.

Test environment and test NIF included