How Facturae .xml and signed .xsig files differ
Spanish electronic invoices use either an unsigned .xml document or a digitally signed .xsig file formatted with XAdES. Both formats carry the exact same <Facturae> business payload, including seller details, buyer tax identifiers, item lines, and payment installments.
When you open (abrir) an .xsig file in this Facturae viewer (visor Facturae), the browser extracts the inner XML payload automatically without requiring desktop Java tools. You can inspect every line item, tax code, and payment term immediately in one readable layout.
Reading enveloped and enveloping XAdES signatures locally
Spanish signing tools attach XAdES signatures in two structural patterns. Enveloped signatures place a <ds:Signature> block inside the <Facturae> root element, while enveloping signatures wrap the entire <Facturae> element inside <Signature><Object>.
This viewer handles both structures locally inside a Web Worker with 0 bytes uploaded to any server. Under the Spanish Ministry Facturae 3.2.2 Schema Specification, the underlying XML remains UTF-8 or ISO-8859-1 encoded, and our decoder supports Windows-1252, ISO-8859-2, and Windows-1250 as well.
Supported Facturae 3.2, 3.2.1, and 3.2.2 schema versions
The parser reads <SchemaVersion> from <FileHeader> and supports versions 3.2, 3.2.1, and 3.2.2 without requiring manual version selection. Country codes are normalized from 3-letter ISO 3166-1 alpha-3 codes such as ESP, DEU, or FRA into 2-letter ISO codes.
Unit codes on each <InvoiceLine> default to C62 when omitted, and <ArticleCode> values appear beneath the item name as a reference. If you also receive pan-European invoices in UBL, CII, or Factur-X formats, open them in our browser-based e-invoice viewer for unified EN 16931 inspection.
How does the viewer handle IVA, IGIC, and IRPF withholding?
Spanish freelance and professional invoices frequently combine output VAT (IVA or Canary Islands IGIC) with income tax withholding (IRPF). The viewer reads <TaxesOutputs> and <TaxesWithheld> separately, then subtracts <TotalTaxesWithheld> from the gross total so the payable amount matches <TotalExecutableAmount>.
Many generic XML readers treat withholding taxes as zero or add them to the total, triggering false arithmetic errors. Reading <TotalExecutableAmount> and <TotalOutstandingAmount> directly prevents those mismatches.
| Facturae XML element | Tax or field role | Viewer calculation behavior |
|---|---|---|
<TaxesOutputs> (TaxTypeCode 01) |
Mainland Spanish IVA (for example 21%, 10%, 4%) | Added to <TotalGrossAmountBeforeTaxes> |
<TaxesOutputs> (TaxTypeCode 03) |
Canary Islands IGIC | Displayed in VAT breakdown and added to gross total |
<TaxesWithheld> (TaxTypeCode 04) |
IRPF professional withholding | Shown in Schema details and subtracted from payable |
<TotalExecutableAmount> |
Net amount due after withholding | Matched against final payable balance |
<Installment> |
Split payment due dates | Summed when multiple payment installments exist |
Before recording a supplier or client invoice in your ledger, you can validate Spanish NIF, NIE, and CIF tax numbers offline to catch typographical errors in 9-character tax identifiers.
FACe DIR3 administrative centres and B2G routing codes
Invoices addressed to Spanish ministries, municipalities, hospitals, or universities require structured routing identifiers. Under Spanish Law 25/2013 on Electronic Invoicing, suppliers billing public bodies above statutory thresholds must submit signed Facturae files through the FACe portal.
Locating the three FACe DIR3 administrative centre codes
FACe routes each invoice using three DIR3 administrative centre codes embedded inside <BuyerParty><AdministrativeCentres>. When present, the viewer extracts all three roles (01 Oficina Contable, 02 Órgano Gestor, and 03 Unidad Tramitadora) into Schema details.
If <FileReference> is absent on the first invoice line, those DIR3 codes also populate Buyer reference in the header summary. This makes it easy to confirm that a rejected FACe submission targeted the right public department.
Checking order references, corrective invoices, and installments
Purchase order identifiers stored in <ReceiverTransactionReference> appear in the header as Order. When you need to issue formal order paperwork before invoicing, you can prepare supplier purchase orders before billing in your browser.
Corrective invoices (InvoiceClass starting with OR or OC) are mapped to UNTDID document type 384 (Corrected invoice) and display the referenced <Corrective><InvoiceNumber>. Multi-installment <PaymentDetails> schedules are also summarized with each due date and EUR amount.
Exporting readable PDFs and checking EU e-invoice rules
Once an invoice loads, the Checks panel evaluates core totals, line sums, and required party details against EN 16931 business rules. According to the European Commission eInvoicing in Spain Profile, Spain operates Facturae alongside EU EN 16931 standards for cross-border public procurement.
Saving clean PDF copies and downloading unwrapped XML
Click Save as PDF to render a clean A4 invoice PDF inside a Web Worker, or click Full preview to inspect the rendered pages before downloading. Clicking Download the XML saves the underlying XML file locally for archival or ERP import, including <LegalLiterals> and <InvoiceAdditionalInformation> notes.
Tip: Keep both the original
.xsigfile and the generated PDF in your accounting archive, because Spanish tax audits require preserving the signed electronic original alongside human-readable copies.
Privacy boundaries and formal XAdES validation scope
All XML parsing, character decoding, and PDF generation run inside your browser tab with 0 KB sent over the network. If you also inspect Italian SdI invoices in .xml or CAdES .xml.p7m envelopes, open them in the FatturaPA viewer.
Under Spanish retention rules, businesses typically preserve electronic invoices for at least 4 to 6 years for tax and commercial audits. Note that this viewer checks arithmetic consistency and displays XML fields for operational convenience rather than certified legal or tax advice; use official FACe or VALIDe services when formal XAdES certificate validation is required.