# NIF_NOT_IN_CENSUS

The NIF '‹nif›' does not exist in the AEAT census or the fiscal name does not match

<Callout type="info">
**Category:** [Customers](/errors/category/cliente)
</Callout>

| | |
|---|---|
| HTTP status | `422` Unprocessable Content |
| Retry | After fixing the cause |

## When it happens

The tax authority's census has no taxpayer with that NIF, or the name registered for it does not match the fiscal name you sent. Typos in either the NIF or the legal name are the usual cause.

## How to fix it

Check the NIF and the exact legal name with your customer. You can test the pair with `POST /v1/nif/validate` before creating the customer or the invoice.

## Retry

Not as is: the same request fails the same way. Fix the cause described above, then send the request again, under a new `Idempotency-Key` if the body changed.

## Returned by

The operations where this code is most likely. The list is not exhaustive.

- [`POST /v1/companies/{company_id}/customers`](/customers/createCompanyCustomer)
- [`POST /v1/companies/{company_id}/invoices`](/invoices/createCompanyInvoice)
- [`PATCH /v1/companies/{company_id}/invoices/{invoice_id}`](/invoices/patchCompanyInvoice)
- [`POST /v1/companies/{company_id}/invoices/{invoice_id}/issue`](/invoices/issueCompanyInvoice)

## Rules that cite this code

- [CNT-020 · A Spanish recipient's NIF is in the AEAT census](/rules/contents#cnt-020)

## Example response

When this error occurs, the API answers `422` Unprocessable Content with a JSON body of this shape:

```json
{
  "type": "https://docs.beel.es/errors/NIF_NOT_IN_CENSUS",
  "title": "NIF_NOT_IN_CENSUS",
  "detail": "The NIF '‹nif›' does not exist in the AEAT census or the fiscal name does not match",
  "instance": "/v1/<resource>",
  "errors": [],
  "success": false,
  "error": {
    "code": "NIF_NOT_IN_CENSUS",
    "message": "The NIF '‹nif›' does not exist in the AEAT census or the fiscal name does not match",
    "details": {}
  },
  "meta": {
    "timestamp": "2026-05-21T10:00:00Z",
    "request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
  }
}
```

The `type` URI is stable and always resolves to this page.

## Message

<Tabs items={["English", "Spanish", "Catalan"]}>
  <Tab value="English">{"The NIF '‹nif›' does not exist in the AEAT census or the fiscal name does not match"}</Tab>
  <Tab value="Spanish">{"El NIF '‹nif›' no existe en el censo de AEAT o el nombre fiscal no coincide"}</Tab>
  <Tab value="Catalan">{"El NIF '‹nif›' no existeix al cens de l'AEAT o el nom fiscal no coincideix"}</Tab>
</Tabs>

Send the request with `Accept-Language: <es|en|ca>` to receive the message in your preferred language.

Placeholders are filled in at runtime:

- `‹nif›` — the NIF that was checked.

## Other errors in this category

<div className="grid grid-cols-2 gap-3 not-prose">
  <Card title="ALTERNATIVE_ID_ACTUALLY_IN_CENSUS" description="The identifier '‹value›' is registered in the AEAT census, so it cannot be declared as not registered (07). Enter it as a NIF instead." href="/errors/ALTERNATIVE_ID_ACTUALLY_IN_CENSUS" />
  <Card title="ALTERNATIVE_ID_AND_NIF_EXCLUSIVE" description="The customer cannot carry both a NIF and an alternative identifier. Use only one" href="/errors/ALTERNATIVE_ID_AND_NIF_EXCLUSIVE" />
  <Card title="ALTERNATIVE_ID_COUNTRY_REQUIRED" description="The country of the alternative identifier is missing (alternative_id.country_code). It is required except for the PASSPORT and NOT_REGISTERED types, which are taken as Spanish when it is omitted." href="/errors/ALTERNATIVE_ID_COUNTRY_REQUIRED" />
  <Card title="ALTERNATIVE_ID_INVALID" description="The alternative identifier is not valid" href="/errors/ALTERNATIVE_ID_INVALID" />
  <Card title="ALTERNATIVE_ID_REQUIRES_SPAIN" description="Type NOT_REGISTERED (07) is only valid for Spain; received country: '‹value›'" href="/errors/ALTERNATIVE_ID_REQUIRES_SPAIN" />
</div>

## Keep exploring

<div className="grid grid-cols-2 gap-3 not-prose">
  <Card title="All Customers errors" description="Every code in this category in one table." href="/errors/category/cliente" />
  <Card title="Error reference home" description="Browse every category or jump to the handling guide." href="/errors" />
</div>

---

Full OpenAPI spec: https://docs.beel.es/api/openapi