# Automatic invoicing in the online store

> How to set up the automatic generation of invoices and receipts when a payment is completed in the online store, including numbering series and compatibility with Verifactu and TicketBAI.

## Automatic invoicing in the online store

The **Automatic invoicing** section (in Settings > Online store, **General** tab) lets Lueira automatically generate the tax document and attach it to the confirmation email every time a payment is completed in the online store.

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

This way, the customer receives the invoice or receipt in the same order confirmation email, without you having to generate or send it manually.

## How it works

When a payment is completed in the online store, Lueira decides which type of document to issue based on the data the customer entered at checkout:

- **Full invoice** if the customer has provided their NIF/CIF (Spanish tax identification number).
- **Simplified receipt** if the customer has not provided any tax details.

The document is automatically attached to the order confirmation email the customer receives.

💡 So that customers can request an invoice directly at checkout, enable the **NIF/CIF** field in the purchase form fields (Settings > Online store > Customization > Purchase form fields).

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

## Compatibility with Verifactu and TicketBAI

If your business has **Verifactu or TicketBAI** enabled, the document is electronically signed and sent to the corresponding tax system **before** it is attached to the email. The process is fully automatic.

👉 [Verifactu and TicketBAI in Lueira](lueira-guide:67c7d72c-c920-4265-98ad-a7dabdffa92f?locale=en)

## Enabling automatic invoicing

Go to **Settings > Online store > General** and find the **Automatic invoicing** section. Turn on the **Generate documents automatically** switch.

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

When you turn it on, two numbering series selectors appear, which you must configure before invoicing starts to work.

## Numbering series

Lueira needs to know which series to use to number each type of document. When you turn on the switch, two selectors appear:

- **Invoice series:** the series used to number automatically generated invoices.
- **Receipt series:** the series used to number simplified receipts.

If you don't have any series yet, you can create them directly from this screen with the **Create series** button.

Click **Save changes** once you have selected both series.

## Important notices

⚠️ If either series is not configured, Lueira will show a warning on screen and automatic invoicing will not work properly until you fix it.

⚠️ If the selected series does not have an associated **corrective series** (needed to issue corrective invoices or receipts / credit notes), Lueira will also warn you and offer to create a corrective series from the same screen.

👉 To manage all your numbering series, go to **Settings > Document numbering**.

## Related articles

- [Online store settings](lueira-guide:b6cf255e-c386-4155-baf9-e56b38282676?locale=en)
- [Invoicing: Receipts, invoices and quotes in orders](lueira-guide:5ecb5f2c-1a22-4163-bf33-c2a79ad61477?locale=en)
- [Verifactu and TicketBAI in Lueira](lueira-guide:67c7d72c-c920-4265-98ad-a7dabdffa92f?locale=en)

Source: https://help.lueira.com/en/articles/facturacion-automatica-en-la-tienda-online
