Where your tax ID goes in each submission
- ObligadoEmision, in the header
- The company name, 120 characters at most, and its tax ID (NIF). Once per request.
- IDEmisorFactura, in each record
- The same tax ID, inside the identifier of each invoice.
In Odoo that tax ID comes from the company's NIF for Verifactu field or, if it is empty, from the company's tax ID. The AEAT validation document asks for two things: the tax ID of the obliged party has to be identified at the AEAT, and the one on each invoice has to match the header.

The header codes
If the problem is in the header, the AEAT rejects the whole request: no invoice of that submission gets in. The texts, in Spanish, say that the tax ID is not identified, not in the census, badly formatted or incorrect:
| Code | AEAT text |
|---|---|
| 4104 | Error en la cabecera: el valor del campo NIF del bloque ObligadoEmision no está identificado. |
| 4107 | El NIF no está identificado en el censo de la AEAT. |
| 4109 | El formato del NIF es incorrecto. |
| 4115 | El valor del campo NIF del bloque ObligadoEmision es incorrecto. |
| 4116 | Error en la cabecera: el campo NIF del bloque ObligadoEmision tiene un formato incorrecto. |
The codes for each record
These reject only the affected invoice. 1108 says the IDEmisorFactura tax ID must be the same as the ObligadoEmision one, and 1120, 1217, 1219 and 1240 flag an IDEmisorFactura of the wrong type, not identified or incorrect. 1172 fires when the tax ID or the obliged party arrive empty and 1215 is the generic error of the ObligadoEmision block. 1282 asks for the name when the header tax ID belongs to an individual.
With our module 1108 should not happen: header and IDEmisorFactura are filled with the same tax ID at the same moment. And the name always travels, because it is the company's.

How to fix it
- Open the company in Odoo and check NIF for Verifactu. If you leave it empty, the company's tax ID is used, so check that one too.
- The tax ID goes without spaces and with its letter. If it belongs to an individual, check that the company name in Odoo is theirs.
- Without a tax ID the module does not even send: it stops with
Company … has no NIF for Veri*Factu. - With what is already posted, take care before resending. The header and IDEmisorFactura are built on every submission with the tax ID the company has at that moment, but each invoice's hash was calculated at posting, with the tax ID of the time, and it does not change. If you resend it from AEAT Submission › AEAT Errors with Retry Selected, the AEAT recalculates the hash with the new tax ID, it does not match, and the answer is 2000, which the published module does not correct. Write to comercial@flexigobe.com before resending.
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) |
|---|---|
| 4104 | Error en la cabecera: el valor del campo NIF del bloque ObligadoEmision no está identificado. |
| 4107 | El NIF no está identificado en el censo de la AEAT. |
| 4109 | El formato del NIF es incorrecto. |
| 4115 | El valor del campo NIF del bloque ObligadoEmision es incorrecto. |
| 4116 | Error en la cabecera: el campo NIF del bloque ObligadoEmision tiene un formato incorrecto. |
| 1108 | El NIF del IDEmisorFactura debe ser el mismo que el NIF del ObligadoEmision. |
| 1120 | Valor de campo IDEmisorFactura del bloque IDFactura con tipo incorrecto. |
| 1172 | El valor del campo NIF u ObligadoEmision son nulos. |
| 1215 | Error en el bloque de ObligadoEmision. |
| 1217 | Error identificando el IDEmisorFactura. |
| 1219 | El valor del campo IDEmisorFactura es incorrecto. |
| 1240 | Error en el bloque de IdEmisorFactura. |
| 1282 | Si el NIF de la cabecera es persona fisica se debe informar tambien de su NombreRazon |
Header rejections leave submissions in Failed and they are not retried on their own. Record rejections are retried, with the same record and with the tax ID the company has at each attempt: if you fix the tax ID in the meantime, the retries also come back with 2000.
What if the error is 4107 and the tax ID is spelled right?
Then the AEAT cannot find it in its census. With your own company's tax ID that is unusual; check that the AEAT environment you send to is the right one and write to comercial@flexigobe.com with the answer.
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): data/verifactu_crons.xml
- prewww2.aeat.es/static_files/common/internet/dep/aplicaciones/es/aeat/tikeV1.0/cont/ws/err
- Module source code: flexigo_spain_verifactu 20.0 (aa2ea3d2): models/verifactu_cadena.py
