> ## Documentation Index
> Fetch the complete documentation index at: https://invopop-fr-pa-registration-form.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# AEAT Tax ID Lookup Guide

> Verify Spanish tax IDs (NIF/CIF) and normalize names in workflows using AEAT.

## Introduction

Validating a party’s Spanish tax ID before registering a supplier or issuing an invoice reduces rejections and data-entry errors. This guide shows how to add AEAT (Spanish Tax Agency) checks to your [workflows](/guides/features/workflows) so you can:

* Verify that a NIF/CIF exists in the AEAT census.
* Ensure an individual’s name matches the tax ID on record.
* Optionally normalize names to the official AEAT format.

## Setup

Enable the Spain app to use AEAT verification:

1. Go to **Configuration** > **Apps** in the [Console](https://console.invopop.com).
2. Find **Spain** in the app list.
3. Click **Connect** to activate the app.

After connecting, you’ll see Spain listed under Enabled Apps. Two workflow steps will become available:

* [Verify Tax IDs (NIF/CIF)](#verify-tax-ids-nif%2Fcif)
* [Verify & Correct Tax Details](#verify-%26-correct-tax-details)

## Verify Tax IDs (NIF/CIF)

You can add the **Verify Spanish Tax ID (NIF/CIF)** step to your `invoice` or `party` workflows.

In invoice workflows, it evaluates supplier and customer by default. You can configure this in the step:

<Frame caption="Configure the Verify Spanish Tax ID (NIF/CIF) step for invoices">
  <img width="600" src="https://mintcdn.com/invopop-fr-pa-registration-form/soLFrjVtGJi2T2p_/assets/guides/es-lookup-config.png?fit=max&auto=format&n=soLFrjVtGJi2T2p_&q=85&s=a1aae049976e0fec9a3abe79f789e17d" alt="Configure the Verify Spanish Tax ID (NIF/CIF) step for invoices" data-path="assets/guides/es-lookup-config.png" />
</Frame>

For companies, the "Verify Spanish Tax ID (NIF/CIF)" step confirms the tax ID exists in the AEAT census. For individuals, the step additionally confirms that the tax id matches the person’s full name.

The following outcomes are possible:

* **Validation passes**: returns `OK`.
* **Validation fails**: returns `KO`.
* **Skips validation when:**
  1. The party is empty,
  2. No tax ID is provided,
  3. The tax ID is not Spanish.

<Tabs>
  <Tab title="Invoice workflow example">
    <Frame>
      <img width="600" src="https://mintcdn.com/invopop-fr-pa-registration-form/soLFrjVtGJi2T2p_/assets/guides/es-lookup-verify-invoice-wf.png?fit=max&auto=format&n=soLFrjVtGJi2T2p_&q=85&s=faa2b7faa34719f206d998e299030f0b" alt="Example of an invoice workflow using Verify Spanish Tax ID (NIF/CIF)" data-path="assets/guides/es-lookup-verify-invoice-wf.png" />
    </Frame>
  </Tab>

  <Tab title="Party workflow example">
    <Frame>
      <img width="600" src="https://mintcdn.com/invopop-fr-pa-registration-form/soLFrjVtGJi2T2p_/assets/guides/es-lookup-verify-party-wf.png?fit=max&auto=format&n=soLFrjVtGJi2T2p_&q=85&s=879512cdb2deb3b16be93aec825e3b47" alt="Example of a party workflow using Verify Spanish Tax ID (NIF/CIF)" data-path="assets/guides/es-lookup-verify-party-wf.png" />
    </Frame>
  </Tab>
</Tabs>

## Verify & Correct Tax Details

This step both verifies the tax ID and normalizes names with AEAT data. If the party is a company, the entry will be updated with the official company name in the AEAT census. In the case of individuals, a name is still required for matching, but the step updates the name to the AEAT-returned format. Example: for “Pablo Martínez Gutiérrez,” AEAT may return `MARTINEZ GUTIERREZ PABLO`.

Use this when you want the system to automatically update the `invoice` or `party` entry with the normalized name. The workflow usage is identical to the verification-only step; the difference is that this step also writes the corrected values.

<Frame caption="Verify & Correct step">
  <img width="600" src="https://mintcdn.com/invopop-fr-pa-registration-form/soLFrjVtGJi2T2p_/assets/guides/es-lookup-verify-correct.png?fit=max&auto=format&n=soLFrjVtGJi2T2p_&q=85&s=87c7c79b9cd2ba6e2d3be8051d380b75" alt="Verify & Correct step" data-path="assets/guides/es-lookup-verify-correct.png" />
</Frame>

***

<AccordionGroup>
  <Accordion title="🇪🇸 Invopop resources for Spain">
    |            |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
    | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    | Compliance | <Icon icon="https://assets.invopop.com/flags/es.svg" /> [Invoicing compliance in Spain](/compliance/spain)<br /> <Icon icon="timeline" /> [Compliance timeline](/timelines/spain)                                                                                                                                                                                                                                                                                                                   |
    | Apps       | <Icon icon="https://assets.invopop.com/apps/gov-es/icon.svg" /> [Spain](/apps/spain)<br /> <Icon icon="https://assets.invopop.com/apps/verifactu/icon.svg" /> [VERI\*FACTU Spain](/apps/verifactu-spain)<br /><Icon icon="https://assets.invopop.com/apps/ticketbai/icon.svg" /> [TicketBAI Spain](/apps/ticketbai-spain)                                                                                                                                                                           |
    | Guides     | <Icon icon="book" /> [Facturae Guide](/guides/es-facturae)<br /><Icon icon="book" /> [VERI\*FACTU Invoicing Guide](/guides/es-verifactu)<br /><Icon icon="book" /> [VERI\*FACTU Supplier Onboarding](/guides/es-verifactu-supplier)<br /><Icon icon="book" /> [SII Invoicing Guide](/guides/es-sii)<br /><Icon icon="book" /> [SII Supplier Onboarding](/guides/es-sii-supplier)<br /><Icon icon="book" /> [TicketBAI Guide](/guides/es-ticketbai)                                                  |
    | FAQ        | <Icon icon="square-question" /> [Spain FAQ](/faq/spain)                                                                                                                                                                                                                                                                                                                                                                                                                                             |
    | GOBL       | <Icon icon="https://assets.invopop.com/icons/gobl.svg" />  [Spain Tax Regime](https://docs.gobl.org/regimes/es)<br /> <Icon icon="https://assets.invopop.com/icons/gobl.svg" /> [VERI\*FACTU Addon](https://docs.gobl.org/addons/es-verifactu-v1)<br /> <Icon icon="https://assets.invopop.com/icons/gobl.svg" /> [Facturae Addon](https://docs.gobl.org/addons/es-facturae-v3)<br /> <Icon icon="https://assets.invopop.com/icons/gobl.svg" /> [SII Addon](https://docs.gobl.org/addons/es-sii-v1) |
    | GitHub     | <Icon icon="github" /> [gobl.facturae](https://github.com/invopop/gobl.facturae)<br /><Icon icon="github" /> [gobl.verifactu](https://github.com/invopop/gobl.verifactu)<br /> <Icon icon="github" /> [gobl.ticketbai](https://github.com/invopop/gobl.ticketbai)                                                                                                                                                                                                                                   |
  </Accordion>
</AccordionGroup>

<Card title="Spain FAQ" icon="square-question" href="/faq/spain" arrow="true" horizontal>
  Find answers to frequently asked questions about invoicing in Spain →
</Card>

<Card title="Participate in our community" icon="forumbee" href="https://community.invopop.com" arrow="true" horizontal>
  Ask and answer questions about invoicing in Spain →
</Card>
