Invoicing the Spanish Public Administration with FACe step by step
If you work with a city council, a regional government or any state agency in Spain, you cannot just send a PDF and call it a day. Here is how to do it right and get paid without months of back-and-forth.
What is FACe and why does it exist?
FACe is the General Public Entry Point for Electronic Invoices of the Spanish General State Administration. It is the common gateway that almost every public body is connected to. It exists because Law 25/2013 requires invoices to public administrations to be electronic and signed, and because having a thousand separate channels was unmanageable.
Summary: to get paid by the government you need three things — correct format, valid signature, and delivery to FACe (or to the body’s authorized portal).
1. The format: Facturae 3.2.2
The standard is Facturae, version 3.2.2 (3.2.1 is still accepted by many administrations, but 3.2.2 is current). It is an XML with an official schema published by the tax agency and the Ministry.
What matters about Facturae versus a PDF:
- Structured data (not free text): the receiver processes it automatically.
- Supports multiple lines, tax rates, discounts, expenses paid on behalf, withholdings, equivalence surcharge.
- Includes administrative data a PDF doesn’t have: DIR3 codes, file/contract number, payer center information.
2. DIR3 codes: the most misunderstood piece
An invoice to a public administration must be addressed to three organizational units, not to “the city council” in the abstract:
- Accounting Office — receives and registers the invoice.
- Managing Body — approves conformity.
- Processing Unit — handles the file and proposes payment.
Each is identified by a 9-character alphanumeric DIR3 code. They are mandatory and the customer must provide them: ask in writing before issuing anything. No DIR3, no submission.
3. The signature: XAdES-BES
The Facturae XML is signed with XAdES-BES, a variant of advanced XML signature defined by ETSI. The key point: you need a qualified digital certificate in the name of your company or yourself (freelancer). FNMT, Camerfirma, ANCERT, etc. all work.
The signature is embedded into the XML itself as a <ds:Signature> node with its references and properties (QualifyingProperties). If the administration detects an invalid certificate, a revoked one or a mismatching signature, the invoice is rejected.
<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<ds:SignedInfo>...</ds:SignedInfo>
<ds:SignatureValue>...</ds:SignatureValue>
<ds:KeyInfo><ds:X509Data>...</ds:X509Data></ds:KeyInfo>
<ds:Object><xades:QualifyingProperties>...</xades:QualifyingProperties></ds:Object>
</ds:Signature>
4. The submission: SOAP to FACe
FACe exposes a SOAP 1.1 web service. The main operation is enviarFactura:
- Production endpoint:
https://webservice.face.gob.es/facturasspp2 - Pre-production endpoint:
https://se-face.redsara.es/facturasspp2
You send the signed XML in Base64 plus a contact email. The response returns a code (1200 = accepted) and a registration number. That number is your acknowledgement: with it you can query status anytime.
5. After submission: status and payment
FACe doesn’t pay; it registers and routes. The invoice can move through these states:
- Registered: FACe accepted and routed it to the body.
- Registered in RCF: the body picked it up in its Accounting Invoice Registry.
- Conformed: the managing body approved it.
- Paid: the processing unit has wired the payment.
- Rejected / Cancelled: with reason.
Common mistakes (and how to avoid them)
- Made-up or copy-pasted DIR3 codes. Get them in writing before issuing.
- Expired certificate. Your system should block submission if the cert expires within 30 days.
- Missing issuer IBAN in the XML. Without it, they don’t know where to pay you.
- Non-commercial rounding. If you don’t use away from zero, the total won’t match the line sum.
- Resubmitting after error without changing the number. If rejected, rectify the invoice — don’t resend the same.
Special cases
Invoices to public-owned companies or local entities with their own portal
Some big ones (Adif, Renfe, several regional ones) have their own Public Entry Point. If they’re connected to FACe, FACe works. If not, submission goes to their specific portal with the same signed Facturae format.
Invoices below €5,000
Law 25/2013 allows some administrations to exempt invoices below €5,000 from electronic invoicing. Ask the body: in many cases they still require Facturae.
FacturaOk implements the full pipeline: Facturae 3.2.2 generation, XAdES-BES signature with your real certificate (loaded securely from AWS Secrets Manager), SOAP submission to FACe in production and sandbox, and full status tracking. If a sandbox delivery fails, we mark it honestly as sandbox unreachable instead of faking success.
Start invoicing the public sector
Real sandbox against FACe pre-production. Switch to live in one click when you’re ready.
Try it free