# Electronic invoicing: Facturae and FACe in Lueira

> How to set up and use Facturae 3.2.2 electronic invoicing in Lueira: invoicing profile, digital signature certificate, preparing customers for FACe and generating the XML from an invoice.

## Electronic invoicing: Facturae and FACe in Lueira

When you invoice a private customer, a PDF is enough. But if you invoice a **public body** (a city council, a university, a public hospital, etc.), Spanish regulations require the invoice to also be delivered in a specific electronic format called **Facturae**, and optionally sent through **FACe**, the Spanish State's general entry point for electronic invoices.

In Lueira you can generate the Facturae 3.2.2 file of any approved invoice, sign it digitally with your certificate, and prepare the submission to FACe when the customer is a public body.

 

[What are Facturae and FACe?](#h_fe_que_es) [Prerequisites](#h_fe_requisitos) [1. Set up your electronic invoice profile](#h_fe_perfil) [2. Upload your digital signature certificate](#h_fe_certificado) [3. Prepare a customer for FACe (optional)](#h_fe_face) [4. Generate the Facturae from an invoice](#h_fe_generar) [5. Sending to FACe](#h_fe_envio)

 

## What are Facturae and FACe?

**Facturae** is the standard XML electronic invoice format required by the Spanish Administration: it contains the same information as your PDF invoice (issuer, recipient, lines, taxes), but in a format that the administration's systems can read and process automatically.

**FACe** is the State's official "mailbox" for receiving electronic invoices. Instead of sending the Facturae by hand, if the customer is a public body registered in FACe you can deliver it directly through this system, and the delivery is recorded.

Generating the Facturae (unsigned or signed) **does not send anything**: it only creates the file.

 

## Prerequisites

- The **NIF/CIF of your center** (the Spanish tax identification number, in the company settings) must be a Spanish NIF/CIF with a **valid** format and check digit. If it is not, generating the Facturae will fail with an issuer validation error.

![](https://media.support.lueira.com/images/36944baa46ed35f9681535475ced2059.png)

- Each **product** included in the invoice must have a **VAT type** assigned in the catalog. If any invoice line has no VAT configured, generation stops with a warning instead of creating an incorrect file.
- The invoice must be **approved**, be an invoice (not a ticket or a quote), be in **EUR** and have a customer and a date assigned.
- If you are going to sign the file, you need a **digital signature certificate** in PKCS#12 format (.p12 or .pfx).

 

## 1. Set up your electronic invoice profile

Go to **Settings > Electronic invoice** and fill in:
​

![](https://media.support.lueira.com/images/f6d09141aa92bb764b3999b155ccb02e.png)

![](https://media.support.lueira.com/images/447acabe16c4a6f49e332dbd23486826.png)

- **Contact person**: it is included directly inside the generated Facturae itself (in the issuer's contact details), so it is worth filling in even if you are not going to send anything through FACe.
- **Registry details** (Commercial Registry: volume, folio, sheet): for now it is not reflected in the generated XML, neither for natural persons nor for legal entities. You can still fill it in (it is saved in the profile).
- **FACe notification email** (optional): it is only useful once sending to FACe is available and active; until then it adds nothing.
- **Sign by default**: if you enable it, when downloading the signed version will be prioritized whenever there is an active certificate. This already takes effect, regardless of whether you ever send anything through FACe.

Save the changes before continuing.

 

## 2. Upload your digital signature certificate

On the same screen, in the **Signing certificates** block:
​

![](https://media.support.lueira.com/images/9acb3423bff07ba8c996b08cfa7541cd.png)

1. Select your **PKCS#12 (.p12/.pfx)** file.
2. Enter an **alias** to identify it later in the list (for example, the certificate's name or its expiry date).
3. Enter the certificate's **password**.
4. Leave **"Use by default"** enabled if you want it to be the certificate used when signing.
5. Click **"Add certificate"**.

The private key and the certificate are stored encrypted. You can upload several certificates and mark which one is the default, as well as remove them when they expire or stop being valid.

 

## 3. Prepare a customer for FACe (optional)

This step is only necessary if you are going to invoice a **public body** and want to be able to send the invoice through FACe. In the customer's record, in the **Electronic invoice / FACe** section, enable **"Prepare this customer for FACe"** and fill in the recipient's **DIR3** codes:
​

![](https://media.support.lueira.com/images/03dfae7a0a402f919d26ca6c622a4780.png)

- **Accounting office (DIR3)**: who records the payment in the accounts.
- **Managing body (DIR3)**: who manages the file.
- **Processing unit (DIR3)**: who receives the invoice to process it.
- **Proposing body** and **Administrative reference/file number**: optional.

You can find the DIR3 code of your customer's public body in the [official DIR3 directory](https://administracionelectronica.gob.es/es/ctt/dir3). Saving this data **does not send anything**; it is only used if you later decide to send through FACe.

 

## 4. Generate the Facturae from an invoice

Open an already approved invoice and, in the order's **Invoicing** block, click the **"Facturae"** button. A window will open where you can:
​

![](https://media.support.lueira.com/images/968eef1b480429b53124baa51658607a.png)

![](https://media.support.lueira.com/images/1d3561b4447328098b024553e4af5a68.png)

- Fill in the customer's DIR3 details if you did not fill them in earlier (they are saved to the customer when generating).
- **Generate unsigned**: creates the Facturae XML without a digital signature, useful for reviewing the content.
- **Generate and sign**: creates the XML signed with your active certificate, ready to be delivered.

Both files are available to download in the "Generated files" list of the same order.

The generated Facturae is not a document meant to be read directly: it is an XML file for computer systems. If you want to see it with the same look as an invoice, upload it to the [official Facturae viewer](https://www.facturae.gob.es).

 

## 5. Sending to FACe

Direct sending of the signed invoice to FACe (with tracking of the registration, status and cancellation) is a feature independent of generating the Facturae, and is **not yet available.**

 

## Related articles

- [Verifactu and TicketBAI in Lueira](lueira-guide:67c7d72c-c920-4265-98ad-a7dabdffa92f?locale=en) — the other tax control system for your invoices and tickets, independent of Facturae/FACe.
- [Invoicing: Tickets, invoices and quotes in orders](lueira-guide:5ecb5f2c-1a22-4163-bf33-c2a79ad61477?locale=en) — how to generate and download an order's documents in general.
- [Configuring Company Settings in Lueira](lueira-guide:7480ad97-ab83-4bb8-9b48-33dcefa5d9cd?locale=en) — where to check and correct your center's NIF/CIF.
- [Add a new customer](lueira-guide:4bd22216-7e72-484e-a696-933e794b2f79?locale=en) — managing the customer record where the DIR3 data for FACe is stored.

Source: https://help.lueira.com/en/articles/facturacion-electronica-facturae-y-face-en-lueira
