The two status codes
| Code | AEAT text | What it means |
|---|---|---|
| 3001 | El registro de facturación ya ha sido dado de baja. | That invoice was already cancelled at the AEAT. |
| 3002 | No 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.

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.

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:
| Code | AEAT text (Spanish) |
|---|---|
| 3001 | El registro de facturación ya ha sido dado de baja. |
| 3002 | No existe el registro de facturación. |
| 1214 | El campo NumeroOTAlta debe ser númerico positivo de 4 posiciones. |
| 1224 | Si se informa el campo GeneradoPor deberá existir la agrupación Generador y viceversa. |
| 1225 | El valor del campo GeneradoPor es incorrecto. |
| 1227 | Si el campo GeneradoPor es igual a E debe estar relleno el campo NIF del bloque Generador. |
| 1228 | En 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. |
| 1229 | Si el valor de GeneradoPor es igual a T el valor del campo IDType del bloque Generador no debe ser No Censado (07). |
| 1230 | Si 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). |
| 1231 | El valor del campo IDType del bloque Generador es incorrecto. |
| 1258 | El valor de campo NIF del bloque Generador es incorrecto. |
| 1259 | En el bloque Generador si se identifica mediante NIF, el NIF debe estar identificado y ser distinto del NIF ObligadoEmision. |
| 1273 | Error en el bloque de Generador. |
Keep reading
Checked in the module's source code (version 20.0) and the linked sources
Sources
- www.agenciatributaria.es/static_files/AEAT_Desarrolladores/EEDD/IVA/VERI-FACTU/Validacione
- Module source code: flexigo_spain_verifactu 20.0 (aa2ea3d2): models/verifactu_aeat_client.py
- Module source code: flexigo_spain_verifactu 20.0 (aa2ea3d2): models/verifactu_cola_envio.py
- Module source code: flexigo_spain_verifactu 20.0 (aa2ea3d2): models/verifactu_registro.py
- Module source code: flexigo_spain_verifactu 20.0 (aa2ea3d2): data/verifactu_error_catalogue.xml
- prewww2.aeat.es/static_files/common/internet/dep/aplicaciones/es/aeat/tikeV1.0/cont/ws/err
