Your invoice to the public sector, in Facturae and signed
When you invoice a town council or a regional government department, they'll usually ask for Facturae instead of a PDF: an XML file with the body's DIR3 codes. Fube generates it from the invoice you've already issued, signs it for you if you want, and you upload it to FACe.
- From the issued invoice, in Facturae 3.2, 3.2.1 or 3.2.2
- The public body's DIR3 codes, saved once in its record
- Signed by Fube, or unsigned for you to sign yourself
DIR3 codes are saved once, in the public body's record
The public sector knows where each invoice is going from three DIR3 codes: accounting office, managing body and processing unit. If one is wrong, the body sends the invoice back.
In Fube they go in the customer record, under ‘Administrative centres’, and every Facturae takes them from there. The XML is generated when you download it: if an invoice is returned because of a code, you correct it in the record and download the Facturae for the same invoice again, without issuing a new one.
If the contract withholds a retention, the XML includes it
You enter the percentage on the invoice and the Facturae comes out with the retained amount shown separately. The net amount, the IVA and the total don't change.
On the invoice, in ‘Retention (%)’, you enter the percentage of the net amount, usually 5%. In the XML, the retained amount appears with its percentage, and the amount payable now is reduced by that sum: that's what the public body reads. In Fube, the retained amount falls due on its own date, one year after the invoice unless you set another.
Facturae works alongside Verifactu and the rest of Fube
Verifactu records every invoice with the AEAT when it's issued, whoever it's for, and Fube does it automatically. Facturae is the format in which you deliver a specific invoice to a public body. The same invoice goes through both.
Verifactu
Every invoice is recorded with the AEAT when issued, with its hash and QR code, including the one you later export to Facturae.
Customers
The public body's record stores its administrative centres, with their DIR3 code and role, for all its invoices.
Credit notes
They're issued linked to the invoice they correct, and a credit note for a standard invoice carries that invoice, the reason and the method in its Facturae.
Business to business
Facturae is for the public sector. What the law requires for invoices between businesses, and what Fube covers today.
The public sector XML, from the invoice you already have
Everything in the Facturae comes from the issued invoice and the public body's record: nothing is typed twice.
Facturae schema versions: 3.2, 3.2.1 and 3.2.2
invoice types that can be exported: full, simplified and corrective invoices for both
Facturae included in the free plan, just as in the other three
Frequently asked questions
What you ask us most about invoicing the public sector.
It's the XML e-invoice format the Spanish public sector uses with its suppliers. When the customer is a public body, it replaces the PDF: their system reads the invoice automatically, with the body's details inside.
When you invoice a public body and it asks for an e-invoice: Fube generates it in Facturae, with its DIR3 codes and the case file. If your customers are businesses or individuals, you don't need it. If you're not sure whether it's mandatory in your case, your accountant can tell you.
No. With ‘Download signed’, Fube signs it on your behalf with its own certificate, as a trusted third party, in the signature format FACe requires. If you'd rather sign it with your own certificate, download it unsigned and sign it with AutoFirma, the government's free app, or with your usual tool.
3.2, 3.2.1 and 3.2.2, which is selected by default. You choose whichever the public body or its entry point asks for.
The DIR3 codes belong to the public body: they go in its customer record, under ‘Administrative centres’, each with its code and role. The section appears when the customer is of type Company. The case file belongs to each transaction: it goes on the invoice, in the ‘E-invoice’ section, with the purchase order and contract references and the service period. The body itself gives you the codes.
No. Fube generates the XML and, if you like, signs it. You upload it to FACe or to whichever portal the public body tells you, and you track it there.
Yes. You can export invoices, simplified invoices and credit notes for both, as long as they've been issued and have a customer. Credit notes, including those for a simplified invoice, carry in the XML the invoice they correct, the reason and the correction method.
You enter the percentage in the invoice's ‘Retention (%)’ field. The net amount, the IVA and the total don't change; the XML shows the retained amount separately, with its percentage, and the amount payable now.
Your first invoice to the public sector, in Facturae
Issue the invoice as usual, save the public body's DIR3 codes in its record and download the signed XML. Facturae is on all four plans, including the free one.