Skip to main content
VeriFactu

VeriFactu error 2001: your customer's tax ID is not in the AEAT census

Error 2001 arrives when the customer's tax ID has a valid format but the AEAT, the Spanish tax agency, cannot find it in its taxpayer census. Unlike other tax ID errors, this one does not reject the invoice: it is registered and the AEAT asks you to correct it. Knowing why it happens saves you from checking your whole customer file blindly.

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
3 min

The AEAT text is El NIF del bloque Destinatarios no está identificado en el censo de la AEAT., «the NIF in the recipients block is not identified in the AEAT census». The NIF is the Spanish tax ID. The code sits in the section of errors that accept the record, the ones the AEAT calls admissible.

Why the AEAT accepts it

The AEAT validation document covers this case in its list of admissible errors: a correct recipient tax ID that is not in the census should be sent in the IDOtro block with identification type 07, «No censado» (not in the census). If it is sent as an ordinary NIF, the AEAT does not reject it; it registers it with 2001 so that it is on file and gets corrected.

Other codes with very similar texts, such as 1109, 1110 or 1193, do reject the record. They are explained, with their differences, on the customer tax ID page.

Card for VeriFactu code 2001
Code 2001 on its card: blue, the colour of the errors where the AEAT accepts the record and asks for a correction.

What Odoo sends with our module

When the invoice is posted, the module looks at the contact's country and tax ID. A customer with country Spain, or no country, always goes in the NIF field of the recipients block; if the number starts with X, Y or Z it is treated as an NIE. Type 07 is never used: for foreign customers the module sends IDOtro with types 02, 03 or 04.

Before chaining the invoice, the module checks the Spanish tax ID against the format rules: length of 9, digits and check letter, and the X, Y or Z prefix of an NIE. What it cannot check from Odoo is the census, and that is where 2001 comes in: a well-formed tax ID that the AEAT has no record of.

A mistyped tax ID
A mistyped number usually fails the check letter, which the module verifies before posting. If it still passes, the tax ID is valid in form but may not be your customer's.
An individual not in the census
This is the case the AEAT describes for type 07. Code 1131 confirms it: with type 07, the number must be the tax ID of an individual.
Invoicing records in Odoo with two accepted with errors
The list of invoicing records: two invoices in «Aceptado con errores (subsanar)», the status that 2xxx codes such as 2001 leave behind. Odoo 20 screenshot with demo data; the AEAT answers are simulated.

What to do

  1. Check the tax ID with your customer. If it was a typo, fix it on their contact for the next invoices.
  2. If the tax ID is correct, the invoice is already on file at the AEAT. What remains is the correction, which the AEAT handles with a new record carrying the same invoice identifier.
  3. The published module does not generate correction records or send type 07 on its own. Write to comercial@flexigobe.com with the affected invoices and we will tell you how to close them.

The Odoo invoicing record cannot be edited: it was created when the invoice was posted and it is what gets sent. Fixing the contact fixes what comes next, not what has already gone out. Keep that in mind before changing a customer's data in a hurry: the old invoices keep the old tax ID on purpose.

Keep reading

VeriFactu errors with the customer tax ID: census, format and nameVeriFactu errors on the customer tax ID: census (1109, 1110, 1121, 1193, 1154), format (1123, 1290) and name (1283). What causes them and what Odoo checks before sending.VeriFactu errors with foreign customers: 1239 and the IDOtro codesVeriFactu errors in the recipient block for customers outside Spain (1239, 1101, 1111, 1122, 1232…): what the AEAT requires and what Odoo sends with our module.VeriFactu error 2000: the AEAT recalculates your hash and it does not matchVeriFactu error 2000: the Spanish tax agency recalculates the SHA-256 hash and gets a different one. Why the invoice is registered anyway and what to do in Odoo 17 to 20.
Checked in the module's source code (version 20.0) and the linked sources

Sources