eliDocs
Format Reference

Spain Facturae 3.2.2

Spain's national e-invoice XML format — what Beliq generates and validates against the MINECO authority XSD, and where the VeriFactu / FACe transmission boundary sits.

Facturae is Spain’s national e-invoice XML format, governed by the Ministerio de Asuntos Económicos (MINECO) and used for the B2G mandate (mandatory since 2015) and widely in B2B. It is not EN 16931 and there are no BR-* Schematron rule IDs on Beliq’s validation path — Facturae validation is W3C XSD only, against the authority-published schema graph at facturae.gob.es.

Beliq targets the Facturae 3.2.2 namespace and the single ordinaria profile (ordinary invoices, InvoiceClass="OO"). Facturae 3.2.2 is the sole current version — there is no 4.0.

What Beliq emits

Call POST /v1/generate with standard: "facturae" and output: "xml" (PDF output is not defined for Facturae). The profile field defaults to ordinaria and can be omitted. The optional Spain-specific field set — modality, invoiceIssuerType, invoiceDocumentType, invoiceClass, taxTypeCode, languageName, batchIdentifier, plus per-party personTypeCode / residenceTypeCode overrides — is documented at POST /v1/generate — Spain (Facturae) fields.

Party tax classification is auto-derived: PersonTypeCode (J legal / F natural) from the first character of the canonical NIF/CIF, and ResidenceTypeCode (R Spain / U EU·EEA / E third country) from the party’s address.countryCode. Spanish-resident parties emit an AddressInSpain block; non-residents emit OverseasAddress. Supply seller.vatId / buyer.vatId as a Spanish NIF/CIF (9 characters, optional ES prefix) for resident parties.

Validation pipeline

For Facturae, the validation chain is XSD-only — there is no EN 16931 Schematron layer:

Input → Spain Facturae XSD graph → Result

Structural failures surface in the API response with ruleId: "XSD". Responses carry Facturae-specific metadata fields (spainFacturaeXsdBundle, spainFacturaeRuntimeVersion) instead of schematronVersion. See the validation artifacts page for the full response-field map.

The runtime XSD bundle is Facturae 3.2.2 (MINECO 2017-06-06 unified spec), pinned in the engine and listed on the validation artifacts page.

Verification

Facturae is Schema-checked: Beliq validates against the MINECO authority XSD bundle for Facturae 3.2.2. No machine-readable business rules are published for Facturae — MINECO publishes neither an authority sample XML corpus nor a negative test corpus. XSD structural validation is the highest check any client-side tool can run for this format.

Coverage details: a golden round-trip path (generate → XSD validate) against the pinned authority bundle, using a Beliq-original minimal sample. That gap is tracked as an upstream gap and reviewed each quarter.

What Beliq does NOT do

  • VeriFactu real-time invoice reporting (RD 1007/2023 and amendments, phasing in through 2027) — submission, signing, QR / cotejo flows. Out of scope; BYOC via your chosen intermediary.
  • FACe B2G submission portal — SOAP submission, directory lookup, status polling. Out of scope.
  • Document signing (XAdES). Your intermediary signs the Facturae XML before transmission.
  • Credit notes (Facturae InvoiceClass="OR" rectifying invoices) and multi-invoice batches (Modality="L") are not currently exposed on POST /v1/generate.
  • Facturae sub-versions 3.2 / 3.2.1 — the runtime targets 3.2.2 only.