Facturae 3.2.x — Spain's official XML invoice format
Facturae is Spain's official electronic-invoice XML format, published by the Ministerio para la Transformacion Digital y de la Funcion Publica. Historical companion of B2G through FACe since 2015, it remains the pivot syntax of the upcoming Crea y Crece B2B mandate and coexists with UBL and CII through the Spanish EN 16931 CIUS.
History of Facturae versions
Facturae was created in 2007 by Spain's Ministry of Industry in cooperation with AEAT, to formalise the XML format already in use by some large groups (Telefonica, Iberdrola). Successive versions track the perimeter expansion and the gradual alignment with EN 16931:
- 1.0 (2003) and 2.x (2005-2007) — deprecated historical versions, no longer used after 2015.
- 3.0 (2008) — first modular XSD, adopted for B2G pilot tests.
- 3.1 (2009) — added detailed Items block (description, quantity, unit price), opened up to consumer B2C invoices.
- 3.2 (2010) — XAdES signature overhaul, AdministrativeCentres added to identify Directorios Comunes (DIR3) on the public buyer side. First FACe deployment.
- 3.2.1 (2012) — XSD fixes, RoleTypeCode codes added (01 Accounting office, 02 Management office, 03 Closure office, ...).
- 3.2.2 (2014) — current version. PaymentInKind block added, extended tax list (IGIC, IPSI, Recargo de equivalencia), conditional CEN PC 434 EN 16931 alignment.
XSD structure
The Facturae 3.2.2 XSD organises an invoice into four main blocks:
- FileHeader — file header: schema version, modality (I individual, B batch), issuer type (EM issuer, RE receptor for self-billing), batch (BatchIdentifier, total amounts).
- Parties — SellerParty and BuyerParty, with TaxIdentification (NIF), LegalEntity (corporate name) or Individual, and AddressInSpain or OverseasAddress. The AdministrativeCentres block carries the DIR3 codes of the B2G administrative circuit.
- Invoices — one or more invoices (Invoice), each with InvoiceHeader (number, series, type, class), InvoiceIssueData (date, currency, language), TaxesOutputs (VAT charged), InvoiceTotals (totals), Items (lines).
- ds:Signature — XAdES-Bes-Long block enveloped in the XML, signing the entire document except itself (via the enveloped-signature transform).
<?xml version="1.0" encoding="UTF-8"?>
<fe:Facturae xmlns:fe="http://www.facturae.es/Facturae/2014/v3.2.2/Facturae"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<FileHeader>
<SchemaVersion>3.2.2</SchemaVersion>
<Modality>I</Modality>
<InvoiceIssuerType>EM</InvoiceIssuerType>
<Batch>
<BatchIdentifier>B12345678F-2026-0042</BatchIdentifier>
<InvoicesCount>1</InvoicesCount>
<TotalInvoicesAmount>
<TotalAmount>1210.00</TotalAmount>
</TotalInvoicesAmount>
<TotalOutstandingAmount>
<TotalAmount>1210.00</TotalAmount>
</TotalOutstandingAmount>
<TotalExecutableAmount>
<TotalAmount>1210.00</TotalAmount>
</TotalExecutableAmount>
<InvoiceCurrencyCode>EUR</InvoiceCurrencyCode>
</Batch>
</FileHeader>
<Parties>
<SellerParty>
<TaxIdentification>
<PersonTypeCode>J</PersonTypeCode>
<ResidenceTypeCode>R</ResidenceTypeCode>
<TaxIdentificationNumber>B12345678</TaxIdentificationNumber>
</TaxIdentification>
<LegalEntity>
<CorporateName>Atelier Iberica SL</CorporateName>
<AddressInSpain>
<Address>Calle Mayor 12</Address>
<PostCode>28013</PostCode>
<Town>Madrid</Town>
<Province>Madrid</Province>
<CountryCode>ESP</CountryCode>
</AddressInSpain>
</LegalEntity>
</SellerParty>
<BuyerParty>
<TaxIdentification>
<PersonTypeCode>J</PersonTypeCode>
<ResidenceTypeCode>R</ResidenceTypeCode>
<TaxIdentificationNumber>B87654321</TaxIdentificationNumber>
</TaxIdentification>
<AdministrativeCentres>
<AdministrativeCentre>
<CentreCode>L01280796</CentreCode>
<RoleTypeCode>01</RoleTypeCode>
<Name>Madrid City Hall - Accounting Office</Name>
</AdministrativeCentre>
</AdministrativeCentres>
<LegalEntity>
<CorporateName>Ayuntamiento de Madrid</CorporateName>
<AddressInSpain>
<Address>Plaza de la Villa 5</Address>
<PostCode>28005</PostCode>
<Town>Madrid</Town>
<Province>Madrid</Province>
<CountryCode>ESP</CountryCode>
</AddressInSpain>
</LegalEntity>
</BuyerParty>
</Parties>
<Invoices>
<Invoice>
<InvoiceHeader>
<InvoiceNumber>F-2026-0042</InvoiceNumber>
<InvoiceSeriesCode>2026</InvoiceSeriesCode>
<InvoiceDocumentType>FC</InvoiceDocumentType>
<InvoiceClass>OO</InvoiceClass>
</InvoiceHeader>
<InvoiceIssueData>
<IssueDate>2026-04-15</IssueDate>
<InvoiceCurrencyCode>EUR</InvoiceCurrencyCode>
<TaxCurrencyCode>EUR</TaxCurrencyCode>
<LanguageName>es</LanguageName>
</InvoiceIssueData>
<TaxesOutputs>
<Tax>
<TaxTypeCode>01</TaxTypeCode>
<TaxRate>21.00</TaxRate>
<TaxableBase>
<TotalAmount>1000.00</TotalAmount>
</TaxableBase>
<TaxAmount>
<TotalAmount>210.00</TotalAmount>
</TaxAmount>
</Tax>
</TaxesOutputs>
<InvoiceTotals>
<TotalGrossAmount>1000.00</TotalGrossAmount>
<TotalGeneralDiscounts>0.00</TotalGeneralDiscounts>
<TotalGrossAmountBeforeTaxes>1000.00</TotalGrossAmountBeforeTaxes>
<TotalTaxOutputs>210.00</TotalTaxOutputs>
<InvoiceTotal>1210.00</InvoiceTotal>
<TotalOutstandingAmount>1210.00</TotalOutstandingAmount>
<TotalExecutableAmount>1210.00</TotalExecutableAmount>
</InvoiceTotals>
<Items>
<InvoiceLine>
<ItemDescription>Consulting service 2026 Q1</ItemDescription>
<Quantity>1</Quantity>
<UnitPriceWithoutTax>1000.00</UnitPriceWithoutTax>
<TotalCost>1000.00</TotalCost>
<GrossAmount>1000.00</GrossAmount>
</InvoiceLine>
</Items>
</Invoice>
</Invoices>
<ds:Signature Id="Signature1">
<!-- XAdES-Bes-Long: KeyInfo + SignedProperties + Timestamp + RevocationValues -->
</ds:Signature>
</fe:Facturae> Mandatory XAdES-Bes-Long signature
The electronic signature is mandatory for every Facturae transmitted through FACe. The default profile is XAdES-Bes-Long (XML Advanced Electronic Signature - Basic Electronic Signature - Long), defined by ETSI TS 101 903 v1.4.2:
- Certificate reference: X509Data with full base64 X509Certificate + SigningCertificate (SHA-256 digest of the certificate).
- Qualified timestamp: SignatureTimeStamp issued by an eIDAS-qualified TSA (Time-Stamping Authority) — typically: FNMT-RCM, Camerfirma, ANCERT.
- Validated certificate chain: CertificateValues and RevocationValues including CRLs or OCSP responses of root authorities.
- Implicit signature policy: empty Policy Identifier (XAdES-EPES not required for Facturae).
<!-- XAdES-Bes-Long skeleton enveloped in the Facturae -->
<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Id="Signature1">
<ds:SignedInfo>
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
<ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/>
<ds:Reference Id="ref-1" URI="">
<ds:Transforms>
<ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
<ds:Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
</ds:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
<ds:DigestValue>9C1185A5C5E9FC54...</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
<ds:SignatureValue>...</ds:SignatureValue>
<ds:KeyInfo>
<ds:X509Data>
<ds:X509Certificate>MIIDXTCCAkWgAwI...</ds:X509Certificate>
</ds:X509Data>
</ds:KeyInfo>
<ds:Object>
<xades:QualifyingProperties xmlns:xades="http://uri.etsi.org/01903/v1.3.2#">
<xades:SignedProperties>
<xades:SignedSignatureProperties>
<xades:SigningTime>2026-04-15T09:32:14+02:00</xades:SigningTime>
<xades:SigningCertificate>
<xades:Cert>
<xades:CertDigest>
<ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
<ds:DigestValue>D85AB6...</ds:DigestValue>
</xades:CertDigest>
</xades:Cert>
</xades:SigningCertificate>
</xades:SignedSignatureProperties>
</xades:SignedProperties>
<xades:UnsignedProperties>
<xades:UnsignedSignatureProperties>
<xades:SignatureTimeStamp>
<xades:EncapsulatedTimeStamp>MIIH...</xades:EncapsulatedTimeStamp>
</xades:SignatureTimeStamp>
<xades:CertificateValues>
<xades:EncapsulatedX509Certificate>MIIDXT...</xades:EncapsulatedX509Certificate>
</xades:CertificateValues>
<xades:RevocationValues>
<xades:CRLValues>
<xades:EncapsulatedCRLValue>MIIBvjCB...</xades:EncapsulatedCRLValue>
</xades:CRLValues>
</xades:RevocationValues>
</xades:UnsignedSignatureProperties>
</xades:UnsignedProperties>
</xades:QualifyingProperties>
</ds:Object>
</ds:Signature> Spanish CIUS and EN 16931 alignment
Native Facturae is not EN 16931-compliant: it predates the European standard. For intra-EU exchanges and for the upcoming Crea y Crece B2B mandate, a Spanish CIUS (Core Invoice Usage Specification) was developed by AENOR in coordination with PEPPOL.
The CIUS specifies two things:
- How to express a Spanish invoice in UBL 2.1 or in CII D16B compliant with EN 16931. This lets taxpayers who prefer UBL or CII (notably those exchanging with PEPPOL partners) stay compliant.
- How to project each EN 16931 BG/BT to Facturae XPaths — official correspondence table between the 150 EN 16931 semantic elements and the Facturae 3.2.2 XML paths. Allows Facturae 3.2.2 to be used in "EN 16931 compatible" mode.
Usage: FACe, FACeB2B, factoring
Facturae is used in three major contexts:
- FACe (national B2G) — single entry point for invoicing any Spanish public administration above EUR 5,000. Facturae 3.2.2 format mandatory since 15 January 2015 (Ley 25/2013).
- FACeB2B (optional B2B) — operational B2B hub since July 2018, on a voluntary basis. Same Facturae 3.2.2 plus DIR3 codes simulating a private buyer.
- Factoring and receivables assignment — financial institutions accept a signed Facturae as legal proof of receivable, enforceable against the debtor (articles 1526 onwards of the Spanish Civil Code).
Validation and tooling
The administracionelectronica.gob.es portal provides two main free tools:
- Validador Facturae — XSD + Schematron +
signature validation. URL:
face.gob.es/es/factura/validar. Accepts files up to 15 MB, responds within 10 seconds. - Generador Facturae — Java desktop application to create a signed Facturae from a form. Target: small businesses without accounting software. Downloaded from face.gob.es/es/factura/programa-facturae.
Cross-links
- Spain hub — full e-invoicing mandate overview
- FACe — Spain's B2G hub using Facturae
- Law 18/2022 Crea y Crece — B2B mandate
- Verifactu — billing-software chaining
- TicketBAI — Basque foral equivalent
- Standards — Factur-X / ZUGFeRD
- Standards — PEPPOL BIS Billing 3.0
- Official Facturae 3.2.2 specification
- FACe — B2G portal