> ## Documentation Index
> Fetch the complete documentation index at: https://docs.topograph.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Spain

> Country-specific identifiers, data sources, and integration details

## Start here

This guide contains public integration notes for Spain. Use it for identifier formats, search behavior, and country-specific caveats. The live source of truth for coverage, pricing, data sources, documents, legal forms, roles, and status values is the pricing page.

<Card title="Spain coverage, pricing, and sources" icon="arrow-up-right-from-square" href="https://topograph.co/pricing/es">
  Open the current catalog for supported datapoints, documents, sources, identifiers, and availability.
</Card>

<Note>
  Country details below are preserved as integration notes. If a table or example conflicts with the live pricing page, use the pricing page as the source of truth and contact support.
</Note>

## Data Sources

Spain uses four data sources for company information. Structured profile data comes from a public registry portal, document retrieves from an authenticated electronic portal, supplementary data from the BORME (official commercial gazette), and foundations from the Registro de Fundaciones.

### Structured Profile Data

* **OpenData Registradores** (opendata.registradores.org). Operated by the Colegio de Registradores de la Propiedad y Mercantiles de Espana. This is the **primary source for structured company profile data**: company name (denominacion social), legal form (forma social), status (estado), NIF, IRUS, EUID, registered address (domicilio social), share capital, CNAE/NACE activity codes, legal representatives (administradores/cargos), and incorporation date (constitucion). Data is extracted from the registry.

### Document Retrieval

* **SEDE Electronica del Colegio de Registradores** (sede.registradores.org). The official electronic portal of the Colegio de Registradores. Used for **search/NIF resolution** (to obtain the IRUS identifier) and **document retrieval**: trade register extracts (Nota Informativa Mercantil) and financial statements (Deposito de Cuentas). Documents are retrieved with real-time pricing and delivered as PDFs.

### BORME (Supplementary)

* **BORME** (Boletin Oficial del Registro Mercantil). Spain's official commercial gazette, published daily. Used as a **supplementary enrichment source** for company profiles: activity descriptions, director appointment dates, and sole shareholder information.

### Registro de Fundaciones (Foundations)

* **Registro de Fundaciones de Competencia Estatal** (Ministerio de Justicia). Spain's national register of state-level foundations. Companies whose NIF begins with **G** are foundations and resolve through this register instead of the mercantile sources above. It returns the legal name, NIF, registration number, constitution and registration dates, registered seat, purposes (fines), and the governing board (patronato) plus senior management as legal representatives. The legal form is **Fundación**. A printable **Foundation Register Extract** of the public profile is available under `documents.tradeRegisterExtract`.

<Note>
  **Foundations have no shareholders or beneficial owners.** The patronato is the governing body, not an ownership structure, so `shareholders` and `ultimateBeneficialOwners` are empty for foundations. Coverage is limited to foundations of state competence (those operating across more than one autonomous community). Foundations registered only in a regional (autonomous-community) register are not covered.
</Note>

<Note>
  **Search uses SEDE for NIF resolution.** Name and NIF searches query SEDE to resolve the company's IRUS identifier, then OpenData is queried for structured profile data using that IRUS.
</Note>

## Company Identifiers

### Query Identifiers

| Identifier Type                    | Format                           | Example       | Notes                                                                                                                                     |
| ---------------------------------- | -------------------------------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| **NIF/CIF**                        | Letter + 7 digits + control char | `A82511361`   | Primary company identifier for all API operations                                                                                         |
| **DNI** (individual entrepreneurs) | 8 digits + letter                | `12345678A`   | For autonomous workers / sole proprietors                                                                                                 |
| **VAT**                            | ES + NIF                         | `ESA82511361` | Automatically stripped to NIF for search                                                                                                  |
| **Hoja registral**                 | Province code + sheet number     | `M-213521`    | Mercantile Register sheet reference. A trailing control digit, as published in LEI/GLEIF records (`M-213521-8`), is accepted and stripped |

<Info>
  **Primary Identifier**: We use **NIF** (Numero de Identificacion Fiscal) as the company ID for all Spanish entities.

  NIF is the standard Spanish tax identification number. The first letter indicates the entity type:

  * **A**: Sociedad Anonima (SA)
  * **B**: Sociedad Limitada (SL)
  * **C-H**: Other entity types (cooperatives, partnerships, etc.)
  * **G**: Associations and foundations (foundations resolve through the Registro de Fundaciones)
  * **J**: Sociedad Civil
  * **N**: Foreign entities
  * **P**: Local government bodies
  * **Q**: Public entities
  * **R**: Religious congregations
  * **S**: Government bodies
  * **U**: Temporary business associations (UTE)
  * **V**: Other unclassified entities
  * **W**: Permanent establishments of non-resident entities
</Info>

### Identifiers in API Response

Once you retrieve company data, the `identifiers` object contains all available identifiers for that entity:

| Identifier Type | Format                           | Example              | Found In                                         |
| --------------- | -------------------------------- | -------------------- | ------------------------------------------------ |
| `NIF`           | Letter + 7 digits + control char | `A82511361`          | All companies                                    |
| `VAT`           | NIF value (without ES prefix)    | `A82511361`          | All companies                                    |
| `IRUS`          | 13 digits                        | `1000263762669`      | All companies (resolved via SEDE)                |
| `EUID`          | ESRM. + IRUS                     | `ESRM.1000263762669` | When available from OpenData                     |
| `hoja`          | Province code + sheet number     | `M-247571`           | When the company is matched in the BORME gazette |

<Warning>
  **VAT value in the API response does NOT include the ES prefix.** The `identifiers.VAT` field contains only the NIF value itself (e.g., `A82511361`). The country prefix `ES` is stored separately in `taxId.country`. This is consistent with how other EU countries handle VAT numbers.
</Warning>

## Search Capabilities

Search automatically detects the identifier type and routes to the appropriate handler:

| Search Type       | Pattern                                              | Example         | Match Type | Expected Results                                                                                                                                             |
| ----------------- | ---------------------------------------------------- | --------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| By NIF/CIF        | Letter + 7 digits + control char                     | `A82511361`     | Exact      | Exact match returned first (matchType: id); other results may follow                                                                                         |
| By DNI            | 8 digits + letter                                    | `12345678A`     | Exact      | Exact match returned first (matchType: id); other results may follow                                                                                         |
| By VAT Number     | ES + NIF                                             | `ESA82511361`   | Exact      | Exact match returned first (matchType: id, ES prefix stripped); other results may follow                                                                     |
| By IRUS           | 13 digits                                            | `1000263762669` | Exact      | Exact match returned first (matchType: id); other results may follow                                                                                         |
| By hoja registral | Province code + sheet number, optional control digit | `M-213521-8`    | Exact      | The company holding that Mercantile Register sheet (matchType: id). Useful for resolving the Spanish "Registration Authority Entity ID" found in LEI records |
| By Name           | Text string                                          | `"Telefonica"`  | Fuzzy      | Multiple results (deduplicated by NIF)                                                                                                                       |

<Tip>
  **Search Performance:** Use identifier-based searches (NIF, VAT) for best performance and exact matching. Name searches query SEDE which returns paginated results that are deduplicated by NIF using a scoring algorithm that filters out branches and selects the main entity.
</Tip>

<Note>
  **Branch filtering:** When multiple IRUS entries exist for the same NIF (e.g., branches, offices, agencies), the system uses a scoring algorithm to select the main entity. Branch keywords such as SUCURSAL, URBANA, AGENCIA, OFICINA, and DELEGACION receive a heavy penalty. Current (active) status and shorter names (likely parent entities) receive a bonus.
</Note>

## Quirks & Gotchas

| Quirk                                 | Details                                                                                                                                                                                                                                                                               |
| ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **NIF is the primary ID**             | Unlike some countries that use a separate registry number, Spain uses the NIF (tax ID) as the company identifier for all API operations.                                                                                                                                              |
| **IRUS is internal only**             | The IRUS (Identificador Unico del Registro de Sociedades) is a 13-digit internal registry identifier used for OpenData lookups and document retrieval. It should not be used as a query identifier by API consumers.                                                                  |
| **VAT = ES + NIF**                    | Spanish VAT numbers are simply the NIF prefixed with "ES". Having a NIF does **not** guarantee the company is VAT-registered -- companies must be in the ROI (Registro de Operadores Intracomunitarios) for EU cross-border trade. VIES will return invalid for companies not in ROI. |
| **Document prices are dynamic**       | Trade register extract and financial statement prices are fetched in real-time from SEDE and may vary. Prices appear in the `price` field before purchase.                                                                                                                            |
| **No shareholder data**               | The Spanish public registry does not expose ownership information. Shareholder data is only available through private filings.                                                                                                                                                        |
| **No UBO data**                       | Ultimate Beneficial Owner data is not publicly available through the commercial registry.                                                                                                                                                                                             |
| **SEDE document retrieves**           | Document retrieves are processed through the official SEDE portal of the Colegio de Registradores.                                                                                                                                                                                    |
| **ISIC is always AI-inferred**        | CNAE and NACE codes come directly from OpenData Registradores. ISIC is always derived via AI enrichment. Check the `isAIInferred` flag.                                                                                                                                               |
| **Status is free-text**               | OpenData provides status as a free-text string (e.g., "Vigente") rather than a fixed codelist. Status standardization is AI-enriched.                                                                                                                                                 |
| **OpenData data extraction**          | Company data is extracted from the OpenData Registradores portal.                                                                                                                                                                                                                     |
| **Multiple IRUS per NIF**             | Large companies (e.g., banks) can have dozens of IRUS entries for the same NIF, representing branches and offices in different provinces. The NIF resolver scoring algorithm selects the main entity.                                                                                 |
| **Document delivery is asynchronous** | After retrieving a document from SEDE, there may be a short delay before the PDF is available for download.                                                                                                                                                                           |
| **BORME as supplementary source**     | BORME gazette data enriches company profiles with activity descriptions, director appointment dates, and sole shareholder information.                                                                                                                                                |

## Company Status

Company status is determined from the OpenData Registradores `estado` field. The mapping is **AI-enriched** -- no static codelist exists. The AI analyzes the local Spanish status string to produce a standardized status.

### Status Mapping

| Local Status (Spanish) | English Translation        | Standardized Status | Notes                                                |
| ---------------------- | -------------------------- | ------------------- | ---------------------------------------------------- |
| Vigente                | Active / In force          | Active              | Company is currently registered and operating        |
| Activa                 | Active                     | Active              | Alternative active status label                      |
| Extinguida             | Extinguished               | Closed              | Company has been dissolved and removed from registry |
| En liquidacion         | In Liquidation             | Closed              | Company is undergoing liquidation proceedings        |
| Baja provisional       | Provisional Deregistration | Closed              | Temporarily removed from active registry             |

<Note>
  The `active` boolean is `true` for statuses like "Vigente" and "Activa", and `false` for all other status values. The standardized status classification is produced by AI enrichment.
</Note>

## Legal Forms

Legal form standardization is **AI-enriched**. OpenData Registradores provides a free-text `forma social` field. The AI produces a standardized company type and an **ISO 20275 (ELF)** code.

### Limited Companies (Sociedades Limitadas)

| Spanish Legal Form                               | Abbreviation | Standardized              | Notes                                  |
| ------------------------------------------------ | ------------ | ------------------------- | -------------------------------------- |
| Sociedad de Responsabilidad Limitada             | SL / SRL     | Limited Liability Company | Private limited company                |
| Sociedad Limitada Unipersonal                    | SLU          | Limited Liability Company | Single-shareholder SL                  |
| Sociedad Limitada Nueva Empresa                  | SLNE         | Limited Liability Company | Simplified SL for new businesses       |
| Sociedad Limitada de Formacion Sucesiva          | SLFS         | Limited Liability Company | SL with no minimum capital requirement |
| Sociedad Limitada Profesional                    | SLP          | Limited Liability Company | SL for regulated professional services |
| Sociedad Limitada Laboral                        | SLL          | Limited Liability Company | Majority employee-owned SL             |
| Sociedad de Responsabilidad Limitada Laboral     | SRLL         | Limited Liability Company | Employee-owned SRL variant             |
| Sociedad de Responsabilidad Limitada Profesional | SRLP         | Limited Liability Company | Professional SRL variant               |
| Sociedad Limitada Laboral Profesional            | SLLP         | Limited Liability Company | Combined laboral + professional SL     |

### Corporations (Sociedades Anonimas)

| Spanish Legal Form                 | Abbreviation | Standardized | Notes                                        |
| ---------------------------------- | ------------ | ------------ | -------------------------------------------- |
| Sociedad Anonima                   | SA           | Corporation  | Public limited company                       |
| Sociedad Anonima Unipersonal       | SAU          | Corporation  | Single-shareholder SA                        |
| Sociedad Anonima Laboral           | SAL          | Corporation  | Majority employee-owned SA                   |
| Sociedad Anonima Profesional       | SAP          | Corporation  | SA for regulated professional services       |
| Sociedad Anonima Deportiva         | SAD          | Corporation  | Mandatory form for professional sports clubs |
| Sociedad por Acciones Simplificada | SAS          | Corporation  | Simplified joint-stock company               |

### Partnerships (Sociedades Personalistas)

| Spanish Legal Form                 | Abbreviation | Standardized |
| ---------------------------------- | ------------ | ------------ |
| Sociedad Comanditaria Simple       | S.Com.       | Partnership  |
| Sociedad Comanditaria por Acciones | S.Com.p.A.   | Partnership  |
| Sociedad Colectiva                 | S.C.         | Partnership  |
| Sociedad Regular Colectiva         | SRC          | Partnership  |
| Sociedad Civil                     | S.Civ.       | Partnership  |
| Sociedad Civil Profesional         | SCP          | Partnership  |

### Cooperatives & Special Forms

| Spanish Legal Form                      | Abbreviation | Standardized            |
| --------------------------------------- | ------------ | ----------------------- |
| Sociedad Cooperativa                    | S.Coop.      | Cooperative             |
| Sociedad Cooperativa Europea            | SCE          | Cooperative             |
| Sociedad Agraria de Transformacion      | SAT          | Cooperative             |
| Agrupacion de Interes Economico         | AIE          | Partnership             |
| Agrupacion Europea de Interes Economico | AEIE         | Partnership             |
| Sociedad de Garantia Reciproca          | SGR          | Other                   |
| Societas Europaea                       | SE           | Corporation             |
| Sociedad Mercantil Estatal              | SME          | Government-Owned Entity |

### Investment & Financial Vehicles

| Spanish Legal Form                             | Abbreviation | Standardized |
| ---------------------------------------------- | ------------ | ------------ |
| Sociedad de Inversion de Capital Variable      | SICAV        | Corporation  |
| Sociedades Cotizadas de Inversion Inmobiliaria | SOCIMI       | Corporation  |
| Fondo de Inversion                             | FI           | Other        |
| Fondo de Pensiones                             | FP           | Other        |

### Other Entity Types

| Spanish Legal Form                     | Abbreviation | Standardized                    |
| -------------------------------------- | ------------ | ------------------------------- |
| Empresario Individual / Autonomo       | EI           | Sole Proprietorship             |
| Empresario de Responsabilidad Limitada | ERL          | Sole Proprietorship             |
| Union Temporal de Empresas             | UTE          | Partnership                     |
| Sucursal en Espana                     | --           | Branch or Representative Office |
| Establecimiento Permanente             | --           | Branch or Representative Office |

### Foreign Company Forms (registered in Spain)

| Legal Form            | Abbreviation | Origin                |
| --------------------- | ------------ | --------------------- |
| Besloten Vennootschap | BV           | Netherlands / Belgium |
| Naamloze Vennootschap | NV           | Netherlands / Belgium |
| Limited Company       | LTD          | United Kingdom        |

<Tip>
  The AI enrichment maps any `forma social` string from OpenData Registradores to a standardized type and ISO 20275 code. The local Spanish legal form name is always preserved verbatim.
</Tip>

## Legal Representatives

Legal representatives are extracted from the OpenData Registradores `administradores/cargos` section. Role classification as **legal representative vs. other key person** is **AI-enriched** based on the role string and the company's legal form context.

### Role Types from OpenData

<AccordionGroup>
  <Accordion title="Executive & Management Roles">
    | Spanish Role              | English Translation        | Typical Classification |
    | ------------------------- | -------------------------- | ---------------------- |
    | Administrador unico       | Sole Director              | Legal Representative   |
    | Administrador solidario   | Joint and Several Director | Legal Representative   |
    | Administrador mancomunado | Joint Director             | Legal Representative   |
    | Presidente                | Chairman                   | Legal Representative   |
    | Director                  | Director                   | Legal Representative   |
    | Gerente                   | General Manager            | Legal Representative   |
    | Consejero Delegado        | Managing Director / CEO    | Legal Representative   |
  </Accordion>

  <Accordion title="Board & Governance Roles">
    | Spanish Role            | English Translation          | Typical Classification |
    | ----------------------- | ---------------------------- | ---------------------- |
    | Consejero               | Board Member                 | Other Key Person       |
    | Vicepresidente          | Vice Chairman                | Other Key Person       |
    | Secretario              | Secretary                    | Other Key Person       |
    | Vocal                   | Board Member (non-executive) | Other Key Person       |
    | Secretario no consejero | Non-Director Secretary       | Other Key Person       |
    | Vicesecretario          | Vice Secretary               | Other Key Person       |
  </Accordion>

  <Accordion title="Representative & Special Roles">
    | Spanish Role      | English Translation       | Typical Classification |
    | ----------------- | ------------------------- | ---------------------- |
    | Apoderado         | Attorney-in-fact / Proxy  | Other Key Person       |
    | Apoderado general | General Power of Attorney | Other Key Person       |
    | Liquidador        | Liquidator                | Other Key Person       |
    | Auditor           | Auditor                   | Other Key Person       |
    | Representante     | Representative            | Other Key Person       |
  </Accordion>
</AccordionGroup>

<Note>
  The classification of each role as **legal representative** or **other key person** is AI-enriched and depends on the company's legal form context. For example, an "Administrador unico" is always a legal representative, while an "Apoderado" (attorney-in-fact) is typically classified as an other key person despite having signing authority. The AI uses the ISO 20275 (ELF) code of the company's legal form to determine the appropriate classification.
</Note>

## Other Key Persons

Other key persons are extracted from the same OpenData `cargos` section as legal representatives. The AI enrichment determines which roles fall into this category based on the legal form context. Typical roles include board members (Consejero), secretaries (Secretario), attorneys-in-fact (Apoderado), and auditors (Auditor).

## Shareholders

Shareholder data is **not available** for Spanish companies. The Spanish Registro Mercantil does not expose shareholder information through its public registry portals (OpenData or SEDE). Ownership data is only accessible through private filings and is not part of the publicly available dataset.

## Activity Code Mapping

Spain uses the **CNAE** (Clasificacion Nacional de Actividades Economicas) classification, which is the Spanish national adaptation of the European NACE standard. The system maps activity codes across three levels:

```
CNAE (Spanish) -> NACE Rev. 2 (European) -> ISIC Rev. 4 (International)
```

| Classification | Source                        | Example | AI Inferred?  |
| -------------- | ----------------------------- | ------- | ------------- |
| **CNAE**       | OpenData Registradores        | `6201`  | No (official) |
| **NACE**       | OpenData Registradores        | `62.01` | No (official) |
| **ISIC**       | Derived from CNAE/NACE via AI | `6201`  | Yes (always)  |

<Note>
  Both CNAE and NACE codes are provided directly by OpenData Registradores and are **never** AI-inferred. ISIC codes are **always** AI-inferred from the CNAE/NACE codes. Each activity item includes an `isAIInferred` flag to distinguish official vs. AI-derived codes.
</Note>

### Activity Code Fields

Activity codes are provided as two separate fields from OpenData Registradores:

| Field | Classification | Example Value                                  |
| ----- | -------------- | ---------------------------------------------- |
| CNAE  | CNAE           | `6201 Actividades de programacion informatica` |
| NACE  | NACE           | `62.01 Computer programming activities`        |

## Data Availability Matrix

| Data Type                  | Commercial Companies | Notes                                               |
| -------------------------- | -------------------- | --------------------------------------------------- |
| Company Profile            | ✅ Async              | Full structured data from OpenData Registradores    |
| Legal Representatives      | ✅                    | Directors and officers from OpenData                |
| Other Key Persons          | ✅                    | Board members, secretaries, attorneys from OpenData |
| Shareholders               | ❌                    | Not available in public registry                    |
| Ultimate Beneficial Owners | ❌                    | Not publicly available                              |
| Establishments             | ❌                    | Not available through OpenData                      |
| Activity Codes             | ✅                    | CNAE + NACE from OpenData, ISIC via AI              |
| Trade Register Extract     | ✅ (Paid)             | PDF from SEDE, real-time pricing                    |
| Financial Statements       | ✅ (Paid)             | PDF per fiscal year from SEDE                       |

**Legend:** ✅ Available | ❌ Not Available | Async = Asynchronous processing

## Documents by Company Type

Documents are retrieved from **SEDE Electronica del Colegio de Registradores** with real-time pricing.

### Commercial Companies (NIF)

| Document Type                                           | API Category            | Format | Catalog item               | Availability    | Notes                              |
| ------------------------------------------------------- | ----------------------- | ------ | -------------------------- | --------------- | ---------------------------------- |
| **Nota Informativa Mercantil (Trade Register Extract)** | `tradeRegisterExtract`  | PDF    | `ESP_REGISTER_EXTRACT`     | ✅ All companies | Real-time pricing from SEDE        |
| **Deposito de Cuentas (Financial Statements)**          | `financialStatements[]` | PDF    | `ESP_FINANCIAL_STATEMENTS` | ✅ When filed    | Per fiscal year, real-time pricing |

<Note>
  **Document prices are fetched in real-time** from SEDE and displayed in the `price` field before purchase. For trade register extracts, the following data segments are included: capital, social representation, administrators, and attorneys-in-fact.
</Note>

<Warning>
  **Financial statement availability varies.** Not all companies file their annual accounts (Deposito de Cuentas) with the Registro Mercantil. Available fiscal years are listed via a dropdown on SEDE. Each year's price is determined individually.
</Warning>

## Example API Responses

All examples use **placeholder data**. Query: `POST /v2/company` with `{ "id": "<NIF>", "countryCode": "ES", "dataPoints": ["company", "legalRepresentatives"] }`

<AccordionGroup>
  <Accordion title="Active SA (Sociedad Anonima) -- with VAT verification">
    ```json theme={null}
    {
      "company": {
        "id": "A12345678",
        "countryCode": "ES",
        "identifiers": {
          "NIF": "A12345678",
          "VAT": "A12345678",
          "IRUS": "1000263762669",
          "EUID": "ESRM.1000263762669"
        },
        "taxId": {
          "type": "eu_vat",
          "value": "A12345678",
          "country": "ES",
          "verification": {
            "status": "verified",
            "verifiedName": "EXAMPLE CORP SA",
            "verifiedAddress": "CALLE GRAN VIA 28, MADRID",
            "consultationNumber": "WAPIXXXXXXXXXXXX"
          }
        },
        "legalName": "Example Corp SA",
        "registrationDate": "2010-05-15",
        "status": {
          "localName": "Vigente",
          "active": true,
          "statusDetails": { "status": "ACTIVE" }
        },
        "legalForm": {
          "localName": "Sociedad Anonima",
          "standardized": "Corporation",
          "iso20275Code": "WWQZ"
        },
        "capital": {
          "amount": 60000,
          "currency": "EUR"
        },
        "activities": {
          "CNAE": [{ "code": "6201", "description": "Actividades de programacion informatica", "isAIInferred": false }],
          "NACE": [{ "code": "62.01", "description": "Computer programming activities", "isAIInferred": false }],
          "ISIC": [{ "code": "6201", "description": "Computer programming activities", "isAIInferred": true }]
        },
        "legalAddress": {
          "addressLine1": "Calle Gran Via 28",
          "city": "Madrid",
          "postalCode": "28013",
          "countryCode": "ES"
        }
      },
      "legalRepresentatives": [
        {
          "type": "individual",
          "role": { "localName": "Administrador unico", "standardized": "Director" },
          "individual": { "name": { "fullName": "Carlos Garcia Lopez" } }
        }
      ]
    }
    ```
  </Accordion>

  <Accordion title="Active SL (Sociedad Limitada) -- multiple administrators">
    ```json theme={null}
    {
      "company": {
        "id": "B98765432",
        "countryCode": "ES",
        "identifiers": {
          "NIF": "B98765432",
          "VAT": "B98765432",
          "IRUS": "2000198745632"
        },
        "legalName": "Servicios Digitales SL",
        "registrationDate": "2018-11-20",
        "status": {
          "localName": "Vigente",
          "active": true,
          "statusDetails": { "status": "ACTIVE" }
        },
        "legalForm": {
          "localName": "Sociedad Limitada",
          "standardized": "Limited Liability Company",
          "iso20275Code": "N5GY"
        },
        "capital": {
          "amount": 3000,
          "currency": "EUR"
        },
        "activities": {
          "CNAE": [{ "code": "7022", "description": "Otras actividades de consultoria de gestion empresarial", "isAIInferred": false }],
          "NACE": [{ "code": "70.22", "description": "Business and other management consultancy activities", "isAIInferred": false }],
          "ISIC": [{ "code": "7020", "description": "Management consultancy activities", "isAIInferred": true }]
        },
        "legalAddress": {
          "addressLine1": "Passeig de Gracia 100",
          "city": "Barcelona",
          "postalCode": "08008",
          "countryCode": "ES"
        }
      },
      "legalRepresentatives": [
        {
          "type": "individual",
          "role": { "localName": "Administrador solidario", "standardized": "Director" },
          "individual": { "name": { "fullName": "Ana Martinez Ruiz" } }
        },
        {
          "type": "individual",
          "role": { "localName": "Administrador solidario", "standardized": "Director" },
          "individual": { "name": { "fullName": "Pedro Sanchez Diaz" } }
        }
      ]
    }
    ```
  </Accordion>

  <Accordion title="Closed company (Extinguida)">
    ```json theme={null}
    {
      "company": {
        "id": "B55667788",
        "countryCode": "ES",
        "identifiers": {
          "NIF": "B55667788",
          "VAT": "B55667788",
          "IRUS": "3000112233445"
        },
        "legalName": "Comercio Antiguo SL",
        "registrationDate": "2005-03-10",
        "status": {
          "localName": "Extinguida",
          "active": false,
          "statusDetails": { "status": "CLOSED" }
        },
        "legalForm": {
          "localName": "Sociedad Limitada",
          "standardized": "Limited Liability Company",
          "iso20275Code": "N5GY"
        },
        "capital": {
          "amount": 3000,
          "currency": "EUR"
        },
        "activities": {
          "CNAE": [{ "code": "4771", "description": "Comercio al por menor de prendas de vestir en establecimientos especializados", "isAIInferred": false }],
          "NACE": [{ "code": "47.71", "description": "Retail sale of clothing in specialised stores", "isAIInferred": false }],
          "ISIC": [{ "code": "4771", "description": "Retail sale of clothing, footwear and leather articles in specialised stores", "isAIInferred": true }]
        },
        "legalAddress": {
          "addressLine1": "Calle Serrano 45",
          "city": "Madrid",
          "postalCode": "28001",
          "countryCode": "ES"
        }
      },
      "legalRepresentatives": [
        {
          "type": "individual",
          "role": { "localName": "Liquidador", "standardized": "Liquidator" },
          "individual": { "name": { "fullName": "Maria Lopez Fernandez" } }
        }
      ]
    }
    ```

    **Note:** Closed companies have `active: false` and status `Extinguida`. Documents may still be available from SEDE.
  </Accordion>

  <Accordion title="VAT unverified (not in ROI)">
    ```json theme={null}
    {
      "company": {
        "id": "B11223344",
        "countryCode": "ES",
        "identifiers": {
          "NIF": "B11223344",
          "VAT": "B11223344",
          "IRUS": "4000556677889"
        },
        "taxId": {
          "type": "eu_vat",
          "value": "B11223344",
          "country": "ES",
          "verification": {
            "status": "unverified"
          }
        },
        "legalName": "Pequena Empresa SL",
        "registrationDate": "2020-07-01",
        "status": {
          "localName": "Vigente",
          "active": true,
          "statusDetails": { "status": "ACTIVE" }
        },
        "legalForm": {
          "localName": "Sociedad Limitada",
          "standardized": "Limited Liability Company",
          "iso20275Code": "N5GY"
        }
      }
    }
    ```

    **Note:** VAT status is `unverified` because the company is not registered in the ROI (Registro de Operadores Intracomunitarios). This is common for small companies that do not engage in EU cross-border trade.
  </Accordion>

  <Accordion title="Available Documents">
    Documents are returned when `"dataPoints": ["availableDocuments"]` is requested.

    | API Category            | Document                         | Notes                              |
    | ----------------------- | -------------------------------- | ---------------------------------- |
    | `tradeRegisterExtract`  | Nota Informativa Mercantil (PDF) | Real-time pricing from SEDE        |
    | `financialStatements[]` | Deposito de Cuentas (PDF)        | Per fiscal year, real-time pricing |

    **Trade Register Extract segments included:**

    * Capital social (share capital)
    * Representacion social (social representation)
    * Administradores (directors)
    * Apoderados (attorneys-in-fact)
  </Accordion>
</AccordionGroup>

## Data Source Priority & Routing

For a given entity, the system follows this resolution flow:

<Note>
  **Company Profile Resolution Flow:**

  1. **SEDE search by NIF** -- Resolves the NIF to an IRUS identifier and returns search results. The resolver selects the main entity (filtering out branches).
  2. **OpenData lookup by IRUS** -- Retrieves structured data from OpenData Registradores (name, legal form, status, address, capital, CNAE/NACE, officers, registration date).
  3. **AI enrichment** -- Legal form, status, activities (ISIC), address, and capital formatting are enriched.
  4. **VIES VAT validation** -- A qualified VIES check validates the VAT number and obtains a consultation number (legal proof for audits).

  **Document Resolution Flow:**

  Documents are retrieved through the official SEDE portal of the Colegio de Registradores. Available document types include trade register extracts (Nota Informativa Mercantil) and financial statements (Deposito de Cuentas). Documents are delivered as PDFs after retrieval processing.
</Note>

### Attribute-Level Source Mapping

| Attribute                             | Source                  | Notes                                           |
| ------------------------------------- | ----------------------- | ----------------------------------------------- |
| Company name (denominacion social)    | **OpenData**            | Official registry name                          |
| Legal form (forma social)             | **OpenData**            | AI-enriched for standardization + ISO 20275     |
| Status (estado)                       | **OpenData**            | AI-enriched; `active` flag from string matching |
| Registered address (domicilio social) | **OpenData**            | AI-enriched for structured address components   |
| Share capital                         | **OpenData**            | AI-formatted for standardization                |
| CNAE / NACE activity codes            | **OpenData**            | Official, never AI-inferred                     |
| ISIC activity codes                   | **AI**                  | Always AI-inferred from CNAE/NACE               |
| Legal representatives                 | **OpenData**            | From cargos/administradores; roles AI-enriched  |
| Registration date (constitucion)      | **OpenData**            | Company formation date                          |
| NIF                                   | **OpenData** / **SEDE** | From search results                             |
| IRUS                                  | **SEDE**                | Resolved during NIF search                      |
| EUID                                  | **OpenData**            | European Unique Identifier, when available      |
| VAT verification                      | **VIES**                | Qualified check with consultation number        |
