AEAT social collaborator

NIF management API

The Verifacti NIF management API is the common layer you share across regulations: with it you register, activate and deactivate your customers’ NIFs, manage their representation form and set up webhooks, once. Then each regulation (Verifactu, TicketBAI or SII) connects through its own submission integration.

Read the documentation
Test environment and test NIF included
POST /nifs
[{
  "nif": "B86561412",
  "entorno": "test",
  "hacienda": "verifactu",
  "nombre": "Mi empresa SL",
  …
}]
200 OK
[{
  "nif": "B86561412",
  "activo": true,
  "representacion": "Inexistente",
  …
}]

What the NIF management API does

Three pieces you integrate once and that every compliance API shares. It is not a sequence: you use each one when you need it.

NIF management APIYour account’s common layer, with its account API key (vfn_…)

NIF management

Register, activate and remove your customers’ NIFs by API, one by one or in batches, each with its environment, its treasury and its own API key.

  • Invoicing software and SaaS: you register each customer from your product, without going through a dashboard.
  • ERPs and groups: you manage hundreds or thousands of NIFs and only pay for those active in production.
  • Integrators and consultancies: all your projects in one account.
Registering, activating and removing →

Representation form

The document that authorises Verifacti to submit on behalf of each NIF. You generate it pre-filled, upload it signed and check its status by API.

  • The same document for the AEAT and the three foral treasuries.
  • The holder can also sign it online, without a digital certificate.
Representation form →

Webhooks

The result of each submission to the AEAT or the foral treasury reaches your system, without polling the status.

  • Per environment: test or production.
  • For all your NIFs or only some.
Webhooks →

Registering, activating and removing NIFs

You register your customers’ NIFs one by one or in batches, choosing for each one its environment (test or production) and its treasury: verifactu, alava, vizcaya, guipuzcoa or sii. The same NIF can be in several treasuries.
  • Registration and lookup

    POST /nifs to register and GET /nifs to list, filtering by environment and status.
  • Activate and deactivate

    Deactivate a NIF that stops invoicing and reactivate it when it comes back. You only pay for NIFs active in production.
  • One API key per NIF

    Each NIF has its own submission API key, which you can look up and rotate by API.
  • Data and labels

    Edit each NIF’s data and organise them with labels.
What the common layer does and which APIs each function serves
FunctionEndpointsUsed for
Registering, looking up, editing, deactivating, reactivating and deleting NIFsPOST /nifs, GET /nifs; GET, PUT and DELETE /nifs/{entorno}/{nif}; PUT /nifs/activate/{entorno}/{nif}; DELETE /nifs/{entorno}/{nif}/permanentVerifactu API, TicketBAI API and SII API
API keys of each NIFGET /nifs/keys/{entorno}/{nif}; POST /nifs/keys/{entorno}/{nif}/rotarEvery available API
Representation form/representacion/generar, /enviar, /estado, /descargar, /cancelar and /firma_remotaAEAT (Verifactu and SII) and the foral treasuries of Álava, Bizkaia and Gipuzkoa (TicketBAI): the same document
Webhooks/webhooks and /webhooks/{webhook_id}/nifs/{nif}Responses from the AEAT and the foral treasuries
ValidationPOST /nifs/validar, /nifs/validar_lotes and /nifs/validar/viesRecipients under any regulation
Example: register a NIF · cURL
curl -X POST https://api.verifacti.com/nifs \
  -H "Authorization: Bearer $VERIFACTI_USER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '[{
    "nif": "B86561412",
    "entorno": "test",
    "hacienda": "verifactu",
    "nombre": "Mi empresa SL",
    "direccion": "Calle Mayor 15",
    "cp": "28040",
    "poblacion": "Madrid",
    "provincia": "Madrid"
  }]'

# Response
[{
  "nif": "B86561412",
  "entorno": "test",
  "hacienda": "verifactu",
  "nombre": "Mi empresa SL",
  "activo": true,
  "representacion": "Inexistente",
  "fecha_creacion": "2026-11-17T10:18:21.671Z",
  "webhooks": []
}]

Representation form by API

You generate the pre-filled representation form, upload it signed, check its status, download it or cancel it. The holder can also sign it online, without a digital certificate. How the representation form works.

Webhooks

You register webhooks per environment (test or production) and attach them to all your NIFs or only some. Your system receives the result of each submission to the AEAT or the foral treasury, without polling the status.

NIF validation

Check whether a NIF is identified by the AEAT (POST /nifs/validar), up to 20,000 NIFs per call (POST /nifs/validar_lotes), and the intra-EU VAT number in VIES (POST /nifs/validar/vies).

Built to integrate at scale

Built for developers

Public documentation with examples for every call, quick start guide, Postman collections, llms.txt and a free account with a test environment.

Typical integration: one to three developer days

Specialists in Spain

Common and foral territory: Verifactu, TicketBAI and SII with one provider.

TicketBAI guarantor software in Álava, Bizkaia and Gipuzkoa

Proven reliability

Hundreds of companies and software vendors in production with Verifacti. Data hosted in the EU and an SLA in the terms of use.

AEAT social collaborator

Pricing

The NIF management API is included in the subscription: you pay for the NIFs active in production of each regulation. With the free account you can test sending in the test environment.

See pricing

    Questions about NIF management

    More FAQ

    Can I register NIFs in bulk and receive webhooks?

    Yes. Registration accepts several NIFs per call, and webhooks are registered per environment and attached to all NIFs or only some.

    Do I have to integrate NIF management for each regulation?

    No. You integrate it once and it works for Verifactu, TicketBAI and SII; each regulation adds its own submission.

    Can I deactivate a NIF that is not invoicing?

    Yes, and reactivate it later. You only pay for NIFs active in production.

    Can I validate the recipient’s NIF before invoicing?

    Yes, against the AEAT and VIES, one by one or in batches of up to 20,000.

    Is the NIF management API in the free account?

    The NIF management API (vfn_ keys) and production webhooks require a subscription. With the free account you test sending invoices with test keys and test webhooks.

    Start integrating today

    Try it for free with the test environment.

    Test environment and test NIF includedSee pricing