What the Encadenamiento block carries
- The first record
- It carries PrimerRegistro set to S and nothing else. If the AEAT already had records of yours with the same software, it answers with 2007, which has its own page.
- Every other record
- It carries RegistroAnterior: the issuer's tax ID, the number and date of the previous invoice, and its hash.
The hash is a SHA-256 written in hexadecimal and in capitals, 64 characters long. The previous record's hash has to follow that format; if not, the AEAT returns a warning without rejection.

The ones that accept the record
| Code | AEAT text |
|---|---|
| 2002 | La longitud de huella del registro anterior no cumple con las especificaciones. |
| 2003 | El contenido de la huella del registro anterior no cumple con las especificaciones. |
| 2008 | El valor de la huella del registro anterior debe ser diferente a la huella del registro actual. |
In English: the length, or the content, of the previous record's hash does not follow the specification, and the previous hash must differ from the current one. With these three the invoice stays registered, and in Odoo it shows as «Aceptado con errores (subsanar)», accepted with errors to be corrected.
The ones that reject it
- Data of the previous record: 1174 for its date, 1175 for its number and 1269 for a badly filled RegistroAnterior.
- Blocks: 1180 is the generic chaining error and 1274 a wrong value in PrimerRegistro.
- Hashes: 1291 and 1292 when the hash, previous or current, is not alphanumeric; 1247 for a wrong hash type.
- Lengths: 1262 for the hash, 1263 for the hash type, 1264 for the first record field, 1265 for the invoice type, 1266 for the total tax and 1267 for the total amount.
How Odoo chains
The module chains each record when the invoice is posted, in order and with a consecutive record number per company. For the Encadenamiento block it looks up the record with the number right before, whether a registration or a cancellation, and copies its tax ID, number, date and hash. If it cannot find it, it sends nothing and stops with «Record … is chained to a previous record that does not exist.».
The hash and the previous hash are stored at chaining time and cannot be changed afterwards. The queue sends each company's records in chain order, and every day the Verifactu: Nightly Integrity Check cron walks the whole chain to confirm it is still intact.

What to do with one of these codes
- Open Compliance Records › Chain State and click Verify Integrity. If the local chain is broken, stop invoicing from that company and write to us.
- If the local chain is fine, the problem lies in how it reached the AEAT. Keep the submission's answer, the Raw Response field of the queue.
- Write to comercial@flexigobe.com with both. Chained records are not touched by hand: they are neither deleted nor edited.
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) |
|---|---|
| 1174 | El valor del campo FechaExpedicionFactura del bloque RegistroAnteriores incorrecto. |
| 1175 | El valor del campo NumSerieFactura del bloque RegistroAnterior es incorrecto. |
| 1180 | Error en el bloque de Encadenamiento. |
| 1247 | El valor del campo TipoHuella es incorrecto. |
| 1262 | La longitud de huella no cumple con las especificaciones. |
| 1263 | La longitud del tipo de huella no cumple con las especificaciones. |
| 1264 | La longitud del campo primer Registro no cumple con las especificaciones. |
| 1265 | La longitud del campo tipo factura no cumple con las especificaciones. |
| 1266 | La longitud del campo cuota total no cumple con las especificaciones. |
| 1267 | La longitud del campo importe total no cumple con las especificaciones. |
| 1269 | El bloque Registro Anterior no esta informado correctamente. |
| 1274 | Valor incorrecto campo primer registro |
| 1291 | El HASH del Registro anterior no es alfanumérico. |
| 1292 | El HASH no es alfanumérico. |
| 2002 | La longitud de huella del registro anterior no cumple con las especificaciones. |
| 2003 | El contenido de la huella del registro anterior no cumple con las especificaciones. |
| 2008 | El valor de la huella del registro anterior debe ser diferente a la huella del registro actual. |
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): data/verifactu_crons.xml
- Module source code: flexigo_spain_verifactu 20.0 (aa2ea3d2): models/verifactu_registro.py
- Module source code: flexigo_spain_verifactu 20.0 (aa2ea3d2): models/verifactu_cola_envio.py
- prewww2.aeat.es/static_files/common/internet/dep/aplicaciones/es/aeat/tikeV1.0/cont/ws/err
