> ## Documentation Index
> Fetch the complete documentation index at: https://docs.invopop.com/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** 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 step for invoices">
  <img width="600" src="https://mintcdn.com/invopop/fWniCD0icTwRKXxR/assets/guides/es-lookup-config.png?fit=max&auto=format&n=fWniCD0icTwRKXxR&q=85&s=fc7194d6585fe2cdf5667d5e3cee39e7" alt="Configure the Verify Spanish Tax ID step for invoices" data-path="assets/guides/es-lookup-config.png" />
</Frame>

For companies, the "Verify Spanish Tax ID" 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/fWniCD0icTwRKXxR/assets/guides/es-lookup-verify-invoice-wf.png?fit=max&auto=format&n=fWniCD0icTwRKXxR&q=85&s=22fb32aeb868b578d232d62fdf3f1923" alt="Example of an invoice workflow using Verify Spanish Tax ID" 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/fWniCD0icTwRKXxR/assets/guides/es-lookup-verify-party-wf.png?fit=max&auto=format&n=fWniCD0icTwRKXxR&q=85&s=f61c0c8c45865f27500c131eeeca7409" alt="Example of a party workflow using Verify Spanish Tax ID" 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 tax details step">
  <img width="600" src="https://mintcdn.com/invopop/fWniCD0icTwRKXxR/assets/guides/es-lookup-verify-correct.png?fit=max&auto=format&n=fWniCD0icTwRKXxR&q=85&s=e92aacaa70f23f8e004fe7ff9fe4ae16" alt="Verify & correct tax details 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>
