NIFs Management API Documentation

# Basic operation Here you will find the technical documentation of our API for general management of your NIFs in our system.

NIFs

NIFs can be created in the test environment, which communicates with the administration's test environment.

GET /nifs

List NIFs

This endpoint returns a list of all NIFs.

Responses

StatusDescription
200NIF list
400Invalid query parameters
401Unauthorized — invalid or missing API key.
500Internal server error.

POST /nifs

Add NIFs

This endpoint adds new NIFs.

Responses

StatusDescription
200NIF
400Invalid input data
401Unauthorized — invalid or missing API key.
409NIF already exists
500Internal server error.

GET /nifs/{entorno}/{nif}

NIF Information

This endpoint returns the information of a specific NIF.

Responses

StatusDescription
200NIF
401Unauthorized — invalid or missing API key.
404NIF not found
500Internal server error.

PUT /nifs/{entorno}/{nif}

Modify NIF

This endpoint allows modifying the information of a specific NIF.

Request body

FieldTypeRequiredDescription
nombrestringnoFull name or company name of the NIF.
direccionstringnoNIF address.
cpstringnoNIF postal code.
poblacionstringnoNIF city.
provinciastringnoNIF province.
webhooksarraynoList of webhook identifiers to which the NIF will be linked.
labelstringnoLabel associated with the NIF.

Responses

StatusDescription
200NIF
400Invalid input data
401Unauthorized — invalid or missing API key.
404NIF not found
500Internal server error.

DELETE /nifs/{entorno}/{nif}

Deactivate NIF

This endpoint allows deactivating a NIF.

Responses

StatusDescription
200OK
401Unauthorized — invalid or missing API key.
403NIF is already inactive
404NIF not found
500Internal server error.

DELETE /nifs/{entorno}/{nif}/permanent

Delete NIF

This endpoint allows <u><strong>permanently</strong></u> deleting a NIF.

Responses

StatusDescription
200OK
401Unauthorized — invalid or missing API key.
404NIF not found
500Internal server error.

PUT /nifs/activate/{entorno}/{nif}

Activate NIF

This endpoint allows activating a NIF that has been previously deactivated.

Responses

StatusDescription
200OK
401Unauthorized — invalid or missing API key.
403NIF is already active
404NIF not found
500Internal server error.

GET /nifs/keys/{entorno}/{nif}

NIF API Key

This endpoint returns the API key for a specific NIF in a specific environment.

Responses

StatusDescription
200API key
401Unauthorized — invalid or missing API key.
404NIF not found
500Internal server error.

Validation

There are many circumstances where it is useful to validate that a NIF is correct and registered with the administration, for both companies (CIF) and national citizens (DNI) and foreign residents (NIE).

POST /nifs/validar

Validate NIF at the AEAT

This endpoint validates whether a NIF of an individual or legal entity is identified at the tax agency.

Request body

FieldTypeRequiredDescription
nifstringyesNIF of the individual or legal entity to be verified.
nombrestringnoLast name and first name of the individual or company name of the legal entity for which the verification query is to be made.

Responses

StatusDescription
200AEAT response
400Invalid input data
401Unauthorized — invalid or missing API key.
500Internal server error or AEAT service unavailable

POST /nifs/validar_lotes

Batch Validate NIFs

This endpoint allows validating up to 20,000 NIFs in a single call, checking whether each NIF of an individual or legal entity exists.

Responses

StatusDescription
200AEAT response
400Invalid input data
401Unauthorized — invalid or missing API key.
500Internal server error or AEAT service unavailable

POST /nifs/validar/vies

Validate VAT in VIES

This endpoint allows validating that an intra-community VAT number is registered in the VIES census.

Request body

FieldTypeRequiredDescription
codigo_paisstringyesCountry code to which the VAT number belongs.
ivastringyesIntra-community VAT number.

Responses

StatusDescription
200VIES census response
400Invalid input data
401Unauthorized — invalid or missing API key.
500Internal server error.

Representation

To generate and send invoices to the AEAT production environment using our API, it is necessary to fill out a representation grant form and <span style="font-weight: bold; text-decoration: underline">the invoice issuer NIF</span> must sign it digitally.

POST /representacion/generar/{nif}

Generate Representation PDF

This endpoint allows downloading the representation grant PDF document for a VeriFactu NIF.

Request body

FieldTypeRequiredDescription
tipo_entidadobjectnoEntity type, individuals or legal entities.
nombrestringnoRequired for individuals.
municipiostringnoRequired for individuals.
callestringnoRequired for individuals.
numerostringnoRequired for individuals.
nombre_entidadstringnoRequired for legal entities.
municipio_entidadstringnoRequired for legal entities.
calle_entidadstringnoRequired for legal entities.
numero_entidadstringnoRequired for legal entities.
nombre_representantestringnoRequired for legal entities.
nif_representantestringnoRequired for legal entities.
municipio_representantestringnoRequired for legal entities.
calle_representantestringnoRequired for legal entities.
numero_representantestringnoRequired for legal entities.

Responses

StatusDescription
200Representation grant PDF document
400Invalid input data
401Unauthorized — invalid or missing API key.
500Internal server error.

POST /representacion/enviar/{nif}

Submit Signed PDF

This endpoint submits the representation grant PDF document for a VeriFactu NIF.

Responses

StatusDescription
200PDF submitted successfully
400PDF not submitted correctly
401Unauthorized — invalid or missing API key.
500Internal server error or failure processing the PDF

PUT /representacion/cancelar/{nif}

Cancel Signed PDF

This endpoint cancels the representation grant PDF document for a VeriFactu NIF.

Responses

StatusDescription
200PDF cancelled successfully
401Unauthorized — invalid or missing API key.
404Representation not found
500Internal server error while processing the cancellation

GET /representacion/descargar/{nif}

Download Signed PDF

This endpoint allows downloading the signed representation grant PDF document for a VeriFactu NIF.

Responses

StatusDescription
200PDF downloaded successfully
401Unauthorized — invalid or missing API key.
404PDF not found for the given NIF
500Internal server error.

GET /representacion/estado/{nif}

Representation Status

This endpoint allows retrieving the representation status for a NIF.

Responses

StatusDescription
200PDF submitted successfully
401Unauthorized — invalid or missing API key.
500Internal server error.

Webhooks

Our platform supports webhooks to receive automatic notifications when a invoicing record is generated.

GET /webhooks

List Webhooks

This endpoint returns a list of all configured webhooks.

Responses

StatusDescription
200Webhook list
400Invalid query parameters
401Unauthorized — invalid or missing API key.
500Internal server error.

POST /webhooks

Add Webhook

This endpoint allows registering a webhook.

Request body

FieldTypeRequiredDescription
urlstringyesURL that will be called when the webhook fires.
entornostringyesWebhook environment. Can be "test" or "prod".
secretobjectnoOptional parameter. A secret key shared between our API and the webhook receiver.
nifsobjectnoNIF list. When invoicing records are sent for any of these NIFs, the webhook will be triggered with the tax authority's result once obtained.

Responses

StatusDescription
200Webhook
400Invalid input data
401Unauthorized — invalid or missing API key.
409Webhook already exists with that URL
500Internal server error.

GET /webhooks/{webhook_id}

Webhook Information

This endpoint returns the information of a specific webhook.

Responses

StatusDescription
200Webhook
401Unauthorized — invalid or missing API key.
404Webhook not found
500Internal server error.

PUT /webhooks/{webhook_id}

Modify Webhook

This endpoint allows modifying a specific webhook.

Request body

FieldTypeRequiredDescription
urlstringnoURL that will be called when the webhook fires.
secretstringnoKey to generate the HMAC signature.
activobooleannoIndicates whether the webhook will be active or not.
nifsarraynoNIF list. When invoicing records are sent for any of these NIFs, the webhook will be triggered with the tax authority's result once obtained.

Responses

StatusDescription
200Webhook
400Invalid input data
401Unauthorized — invalid or missing API key.
404Webhook not found
409Webhook URL conflicts with an existing one
500Internal server error.

DELETE /webhooks/{webhook_id}

Delete Webhook

This endpoint allows deleting a specific webhook.

Responses

StatusDescription
200OK
401Unauthorized — invalid or missing API key.
404Webhook not found
500Internal server error.

POST /webhooks/{webhook_id}/nifs/{nif}

Associate NIF with Webhook

This endpoint allows associating a specific NIF with a specific webhook.

Responses

StatusDescription
200OK
401Unauthorized — invalid or missing API key.
404Webhook or NIF not found
500Internal server error.

DELETE /webhooks/{webhook_id}/nifs/{nif}

Dissociate NIF from Webhook

This endpoint allows dissociating a specific NIF from a specific webhook.

Responses

StatusDescription
200OK
204NIF successfully dissociated from the webhook (no content)
401Unauthorized — invalid or missing API key.
404Webhook or NIF not found
500Internal server error.