Skip to main content
VeriFactu

VeriFactu errors 3001 and 3002: cancelling an invoice the AEAT does not have, or already cancelled

Cancelling an invoice in Odoo, once it has its VERI*FACTU record, creates a cancellation record that also travels to the AEAT, the Spanish tax agency. The AEAT looks for the invoice you want to cancel and answers with a code if it cannot find it or if it was already cancelled. On top of that, the cancellation record has its own block, Generador, with about ten more codes.

FlexigoTech · Editor in charge: Víctor Gómez · Updated 4 November 2026

Key facts

Module
VeriFactu
Versions
Odoo 17, 18, 19 and 20
Checked
in the module's source code, version 20.0 · against the sources linked at the end
Reading time
4 min

The two status codes

CodeAEAT textWhat it means
3001El registro de facturación ya ha sido dado de baja.That invoice was already cancelled at the AEAT.
3002No existe el registro de facturación.The AEAT has no invoice with that identifier.

Both are in the section of the list that rejects the record: the cancellation does not get in, the rest of the submission does.

Card for the VeriFactu cancellation codes
3001, 3002 and the codes of the Generador block, all of the kind that rejects the record.

What Odoo does when you cancel an invoice

When you cancel an invoice that has a registration record, the module creates a cancellation record and chains it like any other. That record carries the identifier of the invoice being cancelled, with your tax ID, its number and its issue date, plus its chaining, the software data, the timestamp and the hash. The queue sends it like any other record.

Note one condition: the module creates the cancellation when the invoice has a registration record, whatever the status of that record. That is where the most common 3002 comes from.

When each one appears

3002 after a rejection. If an invoice's registration was rejected and ended up in Dead Letter, the AEAT never registered it. If you then cancel that invoice in Odoo, the cancellation looks for a record that does not exist, and the answer is 3002.

3001, cancelled twice. If an invoice is already on file as cancelled at the AEAT and another cancellation arrives with the same identifier, the answer is 3001. It can happen if the invoice was cancelled some other way before it was cancelled in Odoo.

In both cases the rejected cancellation is retried with the same data, with waits from 2 minutes to 12 hours, and ends in Dead Letter on the sixth attempt.

AEAT submission queue grouped by status
The queue grouped by status: cancellation records go through the same states as registrations. Odoo 20 screenshot with demo data; the AEAT answers are simulated.

The Generador block

According to the AEAT validation document, a cancellation can state who generated it with the GeneradoPor field and the Generador block, which always go together. If the generator is identified with a Spanish tax ID, it has to be on record and different from the obliged party. That is where 1224, 1225, 1227, 1228, 1229, 1230, 1231, 1258, 1259 and 1273 come from, together with 1214, which asks for the NumeroOTAlta field to be a positive four-digit number.

The module's cancellation record carries neither GeneradoPor nor Generador, so none of those codes can come from one of its submissions.

What to do

  • Before cancelling an invoice whose registration is in Dead Letter, write to us: cancelling does not fix it and leaves a cancellation with nothing to cancel.
  • With a 3001, check whether the invoice was cancelled earlier by other means.
  • Either way, send us the invoice number at comercial@flexigobe.com and we will review it with you.

The codes on this page, with the AEAT's text

Each code with its literal text, in Spanish, as the AEAT's error list gives it:

CodeAEAT text (Spanish)
3001El registro de facturación ya ha sido dado de baja.
3002No existe el registro de facturación.
1214El campo NumeroOTAlta debe ser númerico positivo de 4 posiciones.
1224Si se informa el campo GeneradoPor deberá existir la agrupación Generador y viceversa.
1225El valor del campo GeneradoPor es incorrecto.
1227Si el campo GeneradoPor es igual a E debe estar relleno el campo NIF del bloque Generador.
1228En el bloque Generador si se cumplimenta NIF, no deberá existir la agrupación IDOtro y viceversa, pero es obligatorio que se cumplimente uno de los dos.
1229Si el valor de GeneradoPor es igual a T el valor del campo IDType del bloque Generador no debe ser No Censado (07).
1230Si el valor de GeneradoPor es igual a D y el CodigoPais tiene valor ES (España), el valor del campo IDType del bloque Generador debe ser Pasaporte (03) o No Censado (07).
1231El valor del campo IDType del bloque Generador es incorrecto.
1258El valor de campo NIF del bloque Generador es incorrecto.
1259En el bloque Generador si se identifica mediante NIF, el NIF debe estar identificado y ser distinto del NIF ObligadoEmision.
1273Error en el bloque de Generador.

Keep reading

VeriFactu error 3000: the AEAT already has that invoice on recordVeriFactu error 3000 means the Spanish tax agency already has that invoice. When it happens, which status comes back and why Odoo 17, 18, 19 and 20 does not resend it.VeriFactu errors with corrective invoices: TipoRectificativa, corrected and replaced invoicesVeriFactu errors on corrective and replacement invoices (1107, 1114 to 1119): when TipoRectificativa and ImporteRectificacion apply and how Odoo sends a credit note.Correcting a VeriFactu record: how it works and the Subsanacion and RechazoPrevio errorsHow a rejected or accepted-with-errors VeriFactu record is corrected: Subsanacion, RechazoPrevio, codes 1153 to 1276, 3003 and 3004, and what Odoo does today.
Checked in the module's source code (version 20.0) and the linked sources

Sources