Skip to content

Facturae: what it is, how to generate it and how to check your invoice is valid

Published on 23 November 2026

By Vicente Bonillo Alejos

Mesa de despacho con un sobre, una cinta de papel sellada, una lupa y un lector de tarjetas; al fondo, en silueta, una persona de espaldas ante una ventanilla cerrada.

Facturae is Spain's official electronic invoicing format: an XML file with a fixed structure, signed with a digital certificate, and it is what the public administration actually accepts when you invoice it. A PDF, however neatly laid out, is not Facturae — not even with your signature scanned into it. If you work for a town council, a provincial authority, a ministry or a public university, what you have to deliver is that signed XML, usually with a .xsig extension, through whichever entry point they tell you, which is almost always FACe.

What is Facturae and why won't a PDF do?

Facturae is an XML schema: a structured text document where every piece of data has a fixed place and a fixed name. The issuer's tax number goes in its field, each invoice line in its own, the VAT breakdown in its own. That lets the organisation's accounting system read it without anybody typing anything.

Two pieces make it valid:

  • The schema. The versions in circulation today are 3.2, 3.2.1 and 3.2.2. Which one each recipient accepts is published on the official Facturae portal.
  • The signature. The invoice is signed with a digital certificate in XAdES format, meaning the signature lives inside the XML itself. Without a valid signature, the file is just another XML.

The PDF is still useful as a readable copy for the client, but as far as the administration is concerned the original is the signed XML. Keep that one.

Am I required to invoice in Facturae?

If you invoice the public sector, yes: the obligation to issue electronic invoices to public bodies comes from Law 25/2013, available on the BOE. Each administration may exclude low-value invoices according to the threshold set in that same law, so check the text before assuming you are off the hook.

Between private companies it is a different story: Law 18/2022 ("Crea y Crece") provides for mandatory B2B electronic invoicing, but it depends on a regulation that sets the deadlines. Don't trust dates you read on a blog — this one included: check the BOE. And watch out for a very common mix-up: Facturae and Verifactu are not the same thing. I go into it in what is law today about Verifactu and what has only been announced.

How is a Facturae file generated?

Three routes, from least to most automated:

  1. By hand, with the free tools on the official portal. Fine for one invoice a month. Not for twenty a day.
  2. With your invoicing software. Most Spanish ERPs and business management packages export Facturae. The question isn't whether the button exists, it's whether it fills in every field properly.
  3. Generating it from your own system. If you invoice from an in-house application, you produce the XML and sign it with the company certificate.

For an invoice addressed to the administration you also need the DIR3 codes: accounting office, managing body and processing unit. Three codes identifying who receives, who approves and who processes. Your public-sector client has to give them to you, and some bodies require a fourth one, the proposing body. A wrong DIR3 is the number one cause of rejection.

How do I validate an electronic invoice before sending it?

Validating beforehand takes five minutes; fixing it afterwards costs weeks of payment delay. The order I follow:

  1. Check the schema version the recipient accepts and that your file uses it.
  2. Run the official validator on the Facturae portal: it tells you whether the XML meets the schema and whether the signature is correct.
  3. Check the certificate: that it was valid at the moment of signing and that it belongs to the issuing company, not another one in the group.
  4. Make sure you signed last. If someone opens the XML and changes an amount after signing, the signature no longer matches and the file falls over.
  5. Cross-check the DIR3 codes against the ones the body gave you, character by character.
  6. Reconcile the totals: line sums, taxable bases, tax amounts and grand total. Two-decimal rounding is a classic source of errors.
  7. Check the attachments: accepted format and sensible size.

How do I send the electronic invoice to FACe, and what happens next?

FACe is the general entry point for electronic invoices of the Spanish central government, and many regions and councils use it as their door too. You can send the invoice through the web portal with a certificate, or automatically through its web services if your software supports them.

On submission you get a registration number: that is your proof the invoice went in and on what date. Keep it with the invoice. From there the invoice moves through states — registered, recorded in the accounting register, payment obligation booked, paid — and you can check them with the issuer's tax number and the invoice number. If something fails, the state will be rejected with a reason, and that reason is your script for fixing it.

Which errors get an invoice bounced by FACe?

ErrorWhat happensHow to avoid it
Wrong or incomplete DIR3The invoice never reaches the department and gets rejectedAsk for them in writing and paste them as given
Expired or revoked certificateThe signature fails validationCheck expiry dates before month-end
File modified after signingThe signature no longer matchesAlways sign as the very last step
Totals that don't add upRejected for inconsistent amountsValidate first with the official tool
Duplicate invoice numberDetected as a duplicateUnique series and numbering per issuer
Unsupported schema versionIt isn't even registeredConfirm the version the recipient accepts

Frequently asked questions

Is Facturae the same as Verifactu?

No. Facturae is a file format for delivering the invoice; Verifactu is a system for recording invoicing entries and sending them to the tax authority. You may be affected by one, the other or both.

Can I generate a Facturae invoice for free?

Yes. The official portal offers free tools to create, sign and validate invoices. They are perfectly valid for low volumes; once you invoice daily, what you want is your business software doing it.

My invoice was rejected — do I just send it again?

No: fix the reason stated in the rejection and resubmit. If the error was in the tax details or the amounts, the clean route is usually a corrective invoice rather than resending the same one.

Do I have to keep the XML, or is the PDF enough?

Keep the signed XML. It is the original document; the PDF is a courtesy rendering and proves nothing on its own.

Where do I start if I don't know whether my software does it right?

The quickest way out of doubt is to take a real invoice you have already issued, run it through the official validator and check the DIR3 codes one by one. If it comes back clean, your process is fine and you only have to turn it into a routine. If it comes back with errors, it is usually the same two or three fields every time, and they get fixed once. That is part of what we do when we set up invoice automation for a company: check what your current software produces before touching anything. Send us a sample invoice and we'll tell you whether your software generates it correctly.

Best regards, Vicente.

Send us a sample invoice and we'll tell you whether your software generates it correctly

Ask us. We answer even if you never become a client.