Skip to main content

Invoicing in Spain

There are three ways to correct an invoice:
  1. The recommended approach is to issue a GOBL Invoice with the type credit-note or debit-note, which in VERI*FACTU translates to a “Factura Rectificativa por Diferencias”.
  2. If the above approach does not apply, you can issue an invoice of type corrective, which in VERI*FACTU translates to a “Factura Rectificativa por Sustitución”.

VERI*FACTU

Following congress approval, the VERI*FACTU mandate has been postponed by one year. The new dates are:
  • January 1, 2027 for companies
  • July 1, 2027 for self-employed individuals.
In VERI*FACTU, you should only cancel an invoice if it hasn’t been handed to the customer nor accepted by the tax authority. Different from a credit note or a corrective, canceling an invoice doesn’t produce a second document, which means you don’t have a paper to hand to your customer to show the cancellation. That’s why, if the invoice has been handed to the customer, we recommend issuing a credit note instead.
VERI*FACTU invoices don’t necessarily need to be printed because they are issued with electronic invoicing systems such as Invopop. Source: AEAT FAQ.
The AEAT is not strict about the validation, but it’s best to keep your intentions clear. GOBL gives you alternative fields such as op_date and value_date to store details about your invoicing operation.
VERI*FACTU will be mandatory for companies from January 1st, 2027. The rest of tax payers (mainly self-employed indidividuals) from 1 July 2027. Companies reporting with SII (large companies) or TicketBAI are exempt from reporting with VERI*FACTU.
The response from VERI*FACTU should contain all the details you need to be able to decide what changes need to be made to the GOBL document in order to be processed correctly. Make the changes either via the Invopop API or console directly on the same document, and simply resend to the VERI*FACTU workflow.Invopop will ensure that the correct substitution document is generated by checking previous attempts and including the correct codes in the new request.
VERI*FACTU requires every request to be linked with a fingerprint or hash. During the “Generate VERI*FACTU” and “Cancel VERI*FACTU” actions, Invopop will automatically find the last request made for the same supplier, and incorporate the chained data into the new request.Its important to understand the VERI*FACTU focuses on requests, and not individual documents; a single invoice may have multiple entries in the chain if it has been processed multiple times due to incorrect details, cancellations, or substitutions.Invopop guarantees the chain is never broken using database transactions and retries in the case of collisions.
Yes, VERI*FACTU allows issue dates to be in the past, as long as they are after October 28, 2024. Note that the issue date can’t be set with a date in the future.
The most common errors are related to format issues or invalid extensions, which are already handled in Invopop through the es-verifactu-v1 addon validations. These prevent most of the typical problems before they reach the submission stage.Among the errors that aren’t yet validated on our side, the five most frequent ones are:
  • 4104: Error en la cabecera: el valor del campo NIF del bloque ObligadoEmision no está identificado. → The issuer’s name must match what’s registered for that NIF (tax ID).
  • 4102: El XML no cumple el esquema. Falta informar campo obligatorio. → Usually occurs when a required field is missing in the XML, often within the Desglose (taxes) section.
  • 1110: El NIF no está identificado en el censo de la AEAT. → The provided NIF (tax ID) isn’t found in the AEAT registry (often due to typos or testing data).
  • 3000: Registro de facturación duplicado. → Triggered when issuing the same invoice series/code twice.
  • 2001: El NIF del bloque Destinatarios no está identificado en el censo de la AEAT. → Similar to 1110, but applies to the NIF (tax ID) of the customer.
You can set your own description using the notes object in the invoice. The key used for the description needs to be set to general. For example:
 "notes": [
        {
            "key": "general",
            "text": "This will appear as DescripcionOperacion"
        }
    ]
We generate a default description if the note is not provided which is what you are currently seeing. This default description will neatly cut off before it reaches a length of 500 characters as that is the limit the AEAT imposes.
We do not provide the QR code image itself. The QR code is a visual representation of a URL that you need to generate on your own if you’re creating custom PDFs or need it for any other purpose.The full requirements are in the AEAT VERI*FACTU QR specification PDF document in Spanish. Here you can read that:
The “QR” code must have a size between 30x30 and 40x40 millimeters and follow the specifications of the ISO/IEC 18004:2015 standard. For the generation of the “QR” code, the M (medium) error correction level shall be used.
Generate your own QR code image as follows:
1

Obtain the VERI*FACTU URL

  • API: fetch the entry and get data -> head -> stamps -> verifactu-qr.
  • Console: in the invoice entry click on the kebab ··· menu and select View Headers.
2

Generate the QR image

Use the VERI*FACTU URL in a library capable of generating ISO/IEC 18004:2015 QR images (Invopop uses go-qr)
3

Store or use the image

Store or embed the image in your PDF. You can see how we generate QR images in our open source gobl.html library.
  • Bizkaia: by the end of each quarter, except for companies under SII (turnover above 6 million euros), which must report within 4 days.
  • Gipuzkoa and Álava: The submission must be done immediately after generating the invoice.
KeyText
reverse-chargeReverse Charge / Inversión del sujeto pasivo.
simplified-schemeFactura expedida por contribuyente en régimen simplificado.
self-billedFacturación por el destinatario.
travel-agencyRégimen especial de las agencias de viajes.
second-hand-goodsRégimen especial de los bienes usados.
artRégimen especial de los objetos de arte.
antiquesRégimen especial de las antigüedades y objetos de colección.
cash-basisRégimen especial del criterio de caja.

TicketBAI

No, you don’t need to register with TicketBAI, or upload any digital certificates to Invopop. As a certified billing provider, Invopop will sign all invoices with our own digital certificate.TicketBAI allows three types of certificates; Invopop uses the certificado sello de empresa which allows us to sign e-invoices on behalf of our customers, saving you the burden of registering and uploading certificates yourself.

Suppliers

We reject agreements when:
  • The uploaded document is not signed (they upload the unsigned template).
  • Users upload a handwritten signature without and ID.
  • The electronic signature is made with an FNMT certificate.
  • The agreement is missing a date or location.
  • The name is entered as an email address.
The job will state the reason for rejection.
A KO will be triggered and the supplier will be labelled with the Error state. We currently recommend sending a reminder to the supplier through a webhook.The registration link will not expire and the entity will still be able to upload their registration documents which will be validated. Should you choose to run this workflow again using this supplier, the supplier will be accepted or rejected immediately because the required documentation has already been provided and validated.
If the uploaded agreement documents were rejected, a KO will be triggered and the supplier will be labelled with the Error state. We currently recommend sending a notification to the supplier through a webhook within the Error Handling section.Afterwards, if you wish to re-register the supplier with new documents, you must:
  1. Unregister the supplier using the Unregister Supplier workflow.
  2. Re-run the Register supplier workflow.
This will restart the entire registration process. When uploading documents, the previously submitted agreement will appear selected by default. Simply choose a new file and click Continue to override the old one. See the image below for reference:
Overriding the previously submitted agreement

Overriding the previously submitted agreement

In order to complete the representation agreement you will need to provide the following information:Company
  1. Name
  2. NIF
  3. Address
Legal representative
  1. Full name
  2. Government ID type and number
  3. Address
Supplier example for Spain
{
  "$schema": "https://gobl.org/draft-0/org/party",
  "name": "Invopop S.L.",
  "tax_id": {
    "country": "ES",
    "code": "B85905495"
  },
    "people": [
        {
            "name": {
                "given": "Juan",
                "surname": "Pérez González"
            },
            "identities": [
                {
                    "key": "national",
                    "code": "123456789A"
                }
            ],
            "addresses": [
                {
                    "num": "10",
                    "street": "Calle Ejemplo",
                    "locality": "Madrid",
                    "region": "Madrid",
                    "code": "28020"
                }
            ]
        }
    ],
  "addresses": [
    {
      "num": "42",
      "street": "Calle Pradillo",
      "locality": "Madrid",
      "region": "Madrid",
      "code": "28002",
      "country": "ES"
    }
  ],
  "emails": [
    {
      "addr": "[email protected]"
    }
  ]
}
If the entity is an self-employed individual (autónomo), only the information requested in in the Legal representative section is required.
Autónomo example for Spain
{
  "$schema": "https://gobl.org/draft-0/org/party",
  "name": "Juan Pérez González",
  "tax_id": {
    "country": "ES",
    "code": "B85905495"
  },
  "addresses": [
    {
      "num": "42",
      "street": "Calle Pradillo",
      "locality": "Madrid",
      "region": "Madrid",
      "code": "28002",
      "country": "ES"
    }
  ],
  "emails": [
    {
      "addr": "[email protected]"
    }
  ]
}
The supplier can add their electronic signature to the PDF document (instructions), or sign with a handwritten signature (we recommend using Adobe’s online service.
Individual documents are limited to a maximum size of 10MB. Uploads exceeding this size will result in an error.

Participate in our community

Ask and answer questions about Spain’s regulation →