Skip to main content

v3 - Spanish Tax Authority Integration (VeriFactu)

VeriFactu verifiable invoicing: sends each invoice to the Spanish Tax Authority (AEAT) with hash, QR and CSV, using the company's certificate. What it is, certificates, configuration, fields, use and FAQs.

Index

Who this article is for: It applies to clubs operating in Spain that are subject to the verifiable invoicing regulation (VeriFactu / anti-fraud law).

What is this integration?

The integration with the Spanish Tax Authority (Agencia Tributaria, AEAT) lets you issue verifiable invoices with the VeriFactu system, complying with the anti-fraud law. Each invoice is sent to the Tax Authority and recorded in a secure chain.

When it is sent, the invoice receives its hash (fingerprint), a QR code and a CSV (secure verification code), which are added to the document.

VeriFactu is the Tax Authority's system for invoicing programs to send their invoices in a verifiable and unalterable way. The hash chains each invoice with the previous one, and the QR/CSV lets you verify the invoice with the Tax Authority. Unlike TicketBAI (Basque Country), VeriFactu connects directly with the AEAT using your company's digital certificate.

What problem does it solve?

  • Comply with the Spanish anti-fraud law with verifiable invoices, with no manual processes.

  • Sends invoices to the Tax Authority automatically and adds the QR and the CSV.

  • Guarantees integrity: invoices are chained by their hash and cannot be altered.

  • Leaves a trail of the status of each submission (correct, with errors, rejected).

How does it work?

Once configured, the process is completely automatic:

  1. Issuing: a final invoice is created (green fees, fees, services…).

  2. Hash calculation: the system generates a unique fingerprint with the invoice data.

  3. QR generation: the QR code is created and included in the PDF.

  4. Send queue: the invoice enters the automatic queue towards the AEAT.

  5. Secure send: it is sent with the company's digital certificate.

  6. Confirmation: the AEAT returns the result of the registration (and the CSV).

  7. Update: the system updates the invoice status.

🔗 Hash chain (chaining): each invoice contains the hash of the previous one, forming an unalterable chain. That is why invoices are sent in strict chronological order and, if one fails, the following ones wait until it is resolved. The chain is independent per company (and per installation number).

Which systems does it connect and in which direction does the data travel?

It connects Golfmanager with the Tax Authority through VeriFactu, in real time:

  • When issuing an invoice, Golfmanager sends it to the Tax Authority with its chained hash.

  • The Tax Authority responds with the result (correct, accepted with errors or rejected) and the CSV.

  • Golfmanager stores on the invoice the status, the hash, the QR, the CSV and the response.

What information is exchanged?

Information

Direction

Purpose

Invoice data and its hash

Golfmanager → Tax Authority

Register the invoice in a verifiable way

Submission result and CSV

Tax Authority → Golfmanager

Confirm the status and verify the invoice

Cancellation request

Golfmanager → Tax Authority

Cancel an already registered invoice

Prerequisites (before enabling the integration)

  1. Operate in Spain and be subject to the VeriFactu regulation.

  2. Have the VeriFactu module installed, together with the invoicing module.

  3. The company's digital certificate (FNMT, .p12 format) and its password.

  4. The installation number provided by the AEAT.

  5. The company's tax data (9-character tax ID) correct.

  6. Invoicing management permissions to configure it.

Digital certificates

To communicate with the AEAT you must upload the digital certificate of each company.

Certificate requirements:

  • Digital certificate of the company (legal entity) issued by the FNMT.

  • PKCS#12 format (the file can only have the .p12 extension).

  • Valid (not expired) and belonging to the issuing company.

Steps to upload it:

  1. Go to Settings Menu > Invoicing > Companies.

  2. Select the company and click Edit.

  3. Scroll down to the Verifactu section.

  4. Click Certificate and select the .p12 file.

  5. Enter the certificate password.

  6. Enter the installation number provided by the AEAT.

  7. Save the changes.

The system validates the certificate when uploading it; if there is any problem, it warns you instantly.

🔒 Security: the certificate and its password are stored encrypted. In a group with several clubs, each company uploads its own certificate (each one has its own tax ID).

How to set it up (step by step)

Step 1 — VeriFactu settings

Settings Menu > Verifactu

  1. Go to Settings Menu > Verifactu.

  2. Indicate the Start date (only invoices with that date or later will be sent).

  3. Set the queue wait time (seconds it waits before sending; 60 by default, 30–120 recommended).

  4. Leave Production Mode disabled to run tests.

  5. Save the changes.

Step 2 — Certificate per company

  1. Upload the .p12 certificate, the password and the installation number for each company (see the "Digital certificates" section).

Step 3 — Invoice types that are sent

  1. In each invoice type, review the "Send to Verifactu" checkbox (enabled by default). Disable it on the types that should not be sent.

Step 4 — Exemption codes on taxes

  1. For exempt or non-subject products, indicate the corresponding exemption code on the tax (for example, E1–E6 for exempt and N1/N2 for non-subject).

⚠️ Start in test mode, validate that invoices are accepted correctly, and enable production mode only when everything works. Changes apply immediately.

The configuration fields in detail

Below is an explanation of the fields involved in VeriFactu.

1) Start date

• Field name: Start date (Settings > Verifactu)

• Description: Date from which invoices are registered in VeriFactu.

• Impact on the system: Only invoices with that date or later are sent.

• Usage example: you set 01/01/2025 to start that day.

  • What happens when it is used: invoices before that date are not sent.

  • System behavior: it avoids sending the history prior to your sign-up.

2) Queue wait time

• Field name: Queue wait time (seconds)

• Description: Seconds the system waits before sending a newly created invoice.

• Impact on the system: Gives a margin for corrections before sending. 60 by default (30–120 recommended).

• Usage example: you leave 60 to have a minute of margin.

  • What happens when it is used: after issuing, the invoice waits that time and is then sent.

  • System behavior: a higher value gives more margin; a lower one speeds up the registration.

3) Production Mode

• Field name: Production Mode

• Description: Switches between the AEAT's test and real environments.

• Impact on the system: In test nothing is really declared; in production the records are real.

• Usage example: you leave it disabled during setup and enable it once validated.

  • What happens when it is used: in production, each invoice is really registered with the AEAT.

  • System behavior: the QR points to the test or the real environment depending on the mode. Changes apply instantly.

4) Certificate (.p12)

• Field name: Certificate (Companies > Verifactu)

• Description: The company's digital certificate (FNMT, PKCS#12) used to sign the communication with the AEAT.

• Impact on the system: It is essential for sending; it is stored encrypted.

• Usage example: you upload your company's .p12 file.

  • What happens when it is used: the system validates it and uses it to authenticate with the Tax Authority.

  • System behavior: if it is expired or damaged, it errors when saving.

5) Certificate password

• Field name: Password (Companies > Verifactu)

• Description: The password of the .p12 certificate. It is sensitive information.

• Impact on the system: Needed to open the certificate; it is stored encrypted.

• Usage example: you enter it when uploading the certificate.

  • What happens when it is used: it allows the certificate to be used for the submissions.

  • System behavior: if it is wrong (watch upper/lowercase), it errors when uploading.

6) Installation number

• Field name: Installation number (Companies > Verifactu)

• Description: Identifier of the invoicing system (SIF) that the AEAT assigns to each company/installation.

• Impact on the system: Invoices from the same installation share the hash chain.

• Usage example: you enter the number the AEAT provides you.

  • What happens when it is used: invoices are registered under that installation.

  • System behavior: if missing, invoices cannot be sent.

7) Send to Verifactu (invoice type)

• Field name: Send to Verifactu, on each invoice type

• Description: Indicates whether invoices of that type are sent to VeriFactu. Enabled by default.

• Impact on the system: Only invoices of marked types are sent.

• Usage example: you disable it on an internal type that should not be declared.

  • What happens when it is used: invoices of that type enter the send queue.

  • System behavior: unmarked types are ignored.

8) Exemption code (tax)

• Field name: Exemption code, on each tax

• Description: Code required by the regulation for exempt (E1–E6) or non-subject (N1/N2) products.

• Impact on the system: Without it, invoices with exemptions may be rejected.

• Usage example: you assign the corresponding code to the exempt tax.

  • What happens when it is used: the invoice declares the exemption correctly.

  • System behavior: if missing, the exempt product errors when sending.

9) Verifactu Status (invoice)

• Field name: Verifactu Status (on the invoice and in the list)

• Description: Indicates the invoice's situation with the AEAT (Not sent, Correct, Accepted with errors, Rejected, Not sent). Next to it you see the hash, the error, the QR and the CSV.

• Impact on the system: It tells you whether the invoice is registered or requires action.

• Usage example: you review the "Verifactu Status" column in the invoices list.

  • What happens when it is used: when sent, it goes from "Not sent" to "Correct" (or the corresponding error).

  • System behavior: it is read-only; the system itself updates it.

ℹ️ Note: the names and exact location of some settings may vary depending on your version. Your implementation team helps you with the certificate and the installation number.

How it is used day to day

The sending to VeriFactu is automatic when issuing invoices of the configured types (a task checks the queue periodically). Each invoice shows its Verifactu status, its hash and, if there was one, the error.

  • Manual send: if an invoice was not sent, use the "Send to Verifactu" action on the invoice.

  • QR and CSV: when printing the invoice, the QR and the verification text appear so it can be checked with the AEAT.

  • Cancellation: a registered invoice can be cancelled in VeriFactu (the "Cancel Invoice" action); the date and who cancelled it are recorded.

ℹ️ An accepted invoice cannot be modified or resent. To correct it, issue a corrective invoice of the appropriate type: R1 (error based in law), R2 (creditor insolvency), R3 (uncollectible debt), R4 (others) or R5 (corrective of a simplified invoice). Only if it was rejected can you correct the data and resend the same invoice.

Statuses of an invoice in VeriFactu

Status

Meaning

Not sent (gray)

Not yet sent: in queue, waiting the configured time or for a previous one to be sent

Correct (green)

Accepted and registered with its hash

Accepted with errors

Accepted, but with warnings to review

Rejected (red)

The AEAT received the submission but did not accept it; correct with a corrective invoice

Not sent (internal error)

Could not be sent due to an error (e.g. connection); it is retried

The status is shown in the "Verifactu Status" column of the invoices list and in each invoice's detail; if there is an error, the message appears in "Verifactu Error".

Verification QR code

All invoices include a QR code to verify their authenticity.

  • Where it appears: on the last page of the PDF, in the bottom-right corner, next to the text "Factura verificable en la sede electrónica de la AEAT" (invoice verifiable at the AEAT's electronic headquarters).

  • How it is verified: the customer scans the QR with their phone, the AEAT website opens and shows whether the invoice is registered (tax ID, number, date and amount).

  • Content: a URL with the issuer's tax ID, the invoice number, the date and the amount.

  • Environment: in test mode the QR points to pre-production; in production, to the real environment.

Record lookup

You can look up and synchronize the status of invoices directly with the AEAT. This function lets you:

  • Query by fiscal year and period.

  • Update the statuses in Golfmanager with the official ones from the Tax Authority.

  • Obtain the official hashes and the CSV, and identify invoices with errors or rejected.

It is advisable to use it at the end of each month (to confirm everything is registered), when invoices stay "Not sent" for a long time, or before an inspection. The lookup may take several minutes if there are many invoices.

Limitations to keep in mind

  • An accepted invoice is not modified or resent: it is corrected with a corrective invoice (R1–R5).

  • Invoices with a hash cannot be deleted: it would break the chain. They are cancelled or corrected.

  • They are sent in chronological order: if one fails, the following ones wait until it is resolved.

  • Only invoice types with "Send to Verifactu" enabled are sent; exempt/non-subject ones need their code.

  • It requires the company's certificate valid and the installation number.

  • It depends on the AEAT service: if it is unavailable, the submission stays pending and is retried. It is specific to Spain.

Frequently asked questions

Is VeriFactu mandatory for my club?

VeriFactu is mandatory for companies that use computer-based invoicing systems. If you issue invoices with Golfmanager, it is highly recommended to enable it to comply with the regulation.

Do I need an intermediary like in the Basque Country (KubiBAI)?

No. VeriFactu connects directly with the AEAT using your company's digital certificate (.p12). There is no intermediary.

Can I delete an invoice after sending it?

No. Invoices with a VeriFactu hash cannot be deleted (it would break the chain). If it is wrong, cancel it or issue a corrective invoice.

What do I do if an invoice comes out "Rejected"?

The AEAT received the submission but did not accept it due to a data error. Review the message in "Verifactu Error", and correct it by issuing a corrective invoice with the correct data.

An invoice stays in "Not sent". Why?

Common causes: the certificate is not loaded, is expired or the password is wrong; there is a previous rejected invoice blocking the queue; the invoice date is before the start date; or there is no connection with the AEAT. Check the certificate, the start date and whether there are rejected invoices.

I get an error when uploading the certificate.

Check that the password is correct (upper/lowercase), that the file is a valid .p12 and that the certificate is not expired. If needed, request a new one from the FNMT.

The QR does not appear on the PDF.

It is usually because the invoice is a draft, is internal or summary, or does not meet the requirements. Check that it is confirmed and has a number assigned.

I see "previous hash incorrect" / broken chain.

It is the most serious incident: an already registered invoice has been deleted or modified. Contact support immediately, because it can affect all the following invoices.

What happens if I change the digital certificate?

You can change it whenever you want (for example, when it expires): just upload the new one in the company. Previous invoices keep their valid record.

Does it work without an internet connection?

Invoices are issued and their QR is generated without a connection, but the sending to the AEAT stays pending until the connection is restored; then they are sent automatically.

How long does it take to send an invoice?

By default it waits 60 seconds from issuing (to allow corrections) and then the send completes in a few seconds.

Why is an invoice type not being sent?

Because that invoice type has the "Send to Verifactu" checkbox disabled. Enable it if it should be sent.

An exempt product gives an error.

The exemption code is missing on the tax. Assign the corresponding code (E1–E6 / N1–N2).

Do I need to do anything special at the end of the month or year?

It is not mandatory, but it is advisable to use the Record lookup at the end of each month to confirm that all invoices are correctly registered with the AEAT.

Recommended best practices

  • Test first in test mode and validate that invoices are accepted before enabling production.

  • Upload the certificate and the installation number of each company before starting.

  • Review the tax data (company and customer tax IDs) and the exemption codes.

  • Watch the invoice statuses: resolve as soon as possible any that come out "Rejected" or "Not sent".

  • Use the Record lookup at the end of each month.

  • To correct, use corrective invoices: never try to modify or delete an accepted invoice.

Contact and help

For the configuration in Golfmanager, the certificate or the status of an invoice, write to us through the blue bubble in your management software.

If you need specialized tax advice (labor, tax and accounting), Golfmanager provides you, for information purposes, the contact of Bonet Asesores (mentioning that you come on Golfmanager's recommendation):

This is only an informational reference; each client assesses the suitability of the service.

Did this answer your question?