NIFs Management
Use this guide to learn more about NIF management with the Verifacti API integration, including AEAT and VIES validations.
IMPORTANTTo follow the steps below, it is essential to have the corresponding Authorization Token. For more information, please refer to the following documentation page: Authorization Token
Verifacti API Key from a NIF
This endpoint returns the API key for a specific NIF and in a specific environment.
Visit our API Reference to test this endpoint.
Endpoint
GET https://ecartpay.com/api/billings/providers/{id}/nifs/keysGET https://sandbox.ecartpay.com/api/billings/providers/{id}/nifs/keys
Headers
Authorization:token
Path Parameters
id: The provideridfor Verifacti is6917807fca828055fb9888e9.
Query Parameters
nif: The NIF from which the API Key will be consulted.entorno: The environment of the NIF. This value can betestorprod.
Examples
Request
curl --location --request GET 'http://sandbox.ecartpay.com/api/billings/providers/6917807fca828055fb9888e9/nifs/keys?nif=B75777847&entorno=test' \
--header 'Authorization: eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY4YTRjMzE1MGIyOGE5NTg0MzA1YTJhYSIsImFjY291bnRfaWQiOiI2OGE0YzMxNTBiMjhhOTU4NDMwNWEyYTYiLCJhY2NvdW50Ijp7ImVtYWlsIjoiaHVnby5tb3JpbkBlY2FydHBheS5jb20iLCJmaXJzdF9uYW1lIjoiSHVnbyIsImxhc3RfbmFtZSI6Ik1vcsOtbiIsInBob25lIjoiNTI......' \
--header 'Cookie: lang=en' Response
{
"api_key": "vf_test_VU/MpUG999y7qnTR0dDAsC4nVoSGTRNDABGEbff="
}List NIFs
This endpoint returns a list of all NIFs. By default, it returns both active and inactive in both environments, although it allows you to filter only active or inactive and the environment.
Visit our API Reference to test this endpoint.
Endpoint
GET https://ecartpay.com/api/billings/providers/{id}/nifsGET https://sandbox.ecartpay.com/api/billings/providers/{id}/nifs
Headers
Authorization:token
Path Parameters
id: The provideridof Verifacti is6917807fca828055fb9888e9.
Query Parameters
entorno: The environment of the NIF. This value can betestorprod.activos: To list NIFs that are active or not. This value can betrueorfalse.limite: Parameter to set a limit on the number of results returned, defaults to 40 (max. 100).pagina: Pagination paramater for the listed NIFs, defaults to 1.
Examples
Request
curl --location 'http://sandbox.ecartpay.com/api/billings/providers/6917807fca828055fb9888e9/nifs?entorno=test&activos=true&limite=40&pagina=1' \
--header 'Authorization: eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY4YTRjMzE1MGIyOGE5NTg0MzA1YTJhYSIsImFjY291bnRfaWQiOiI2OGE0YzMxNTBiMjhhOTU4NDMwNWEyYTYiLCJhY2NvdW50Ijp7ImVtYWlsIjoiaHVnby5tb3JpbkBlY2FydHBheS5jb20iLCJmaXJzdF9uYW1lIjoiSHVnbyIsImxhc3RfbmFtZSI6Ik1vcsOtbiIsInBob25lIjoiNTI......' \
--header 'Cookie: lang=en'Response
[
{
"nif": "B86561412",
"hacienda": "verifactu",
"entorno": "test",
"nombre": "Mi empresa SL",
"activo": true,
"representacion": "Inexistente",
"webhooks": [],
"fecha_creacion": "2025-12-01T17:52:39.094Z"
},
{
"nif": "B75777847",
"hacienda": "verifactu",
"entorno": "test",
"nombre": "Nombre Actualizado SL",
"activo": true,
"representacion": "Inexistente",
"webhooks": [],
"fecha_creacion": "2025-11-05T14:29:20.292Z"
}
]Add NIF
New NIFs are added through this endpoint to enable Verifactu invoicing. Please note that each NIF requires a unique Verifacti API Key, which Verifacti generates upon adding a new NIF.
IMPORTANT
- Verifacti API Key generation: A unique Verifacti API Key will be generated automatically when adding a new NIF. You will need this key to issue valid Verifactu invoices.
- For Ecart Pay API users: If you want to use a specific NIF for invoicing through Ecart Pay, ensure you update the corresponding key in: Integrations -> Billing Gateways -> Verifacti (Spain).
Visit our API Reference to test this endpoint.
Endpoint
POST https://ecartpay.com/api/billings/providers/{id}/nifsPOST https://sandbox.ecartpay.com/api/billings/providers/{id}/nifs
Headers
Authorization:token
Path Parameters
id: The provideridof Verifacti is6917807fca828055fb9888e9.
Examples
Request
curl --location 'http://sandbox.ecartpay.com/api/billings/providers/6917807fca828055fb9888e9/nifs' \
--header 'Authorization: eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY4YTRjMzE1MGIyOGE5NTg0MzA1YTJhYSIsImFjY291bnRfaWQiOiI2OGE0YzMxNTBiMjhhOTU4NDMwNWEyYTYiLCJhY2NvdW50Ijp7ImVtYWlsIjoiaHVnby5tb3JpbkBlY2FydHBheS5jb20iLCJmaXJzdF9uYW1lIjoiSHVnbyIsImxhc3RfbmFtZSI6Ik1vcsOtbiIsInBob25lIjoiNTI......' \
--header 'Content-Type: application/json' \
--header 'Cookie: lang=en' \
--data '[
{
"nif": "A15022510",
"entorno": "test",
"hacienda": "verifactu",
"nombre": "Mi negocio SL",
"direccion": "Calle Mayor 15",
"cp": "28040",
"poblacion": "Madrid",
"provincia": "Madrid",
"persona_fisica": false
}
]
'Response
[
{
"nif": "A15022510",
"entorno": "test",
"hacienda": "verifactu",
"webhooks": [],
"nombre": "Mi negocio SL",
"activo": true,
"direccion": "Calle Mayor 15",
"cp": "28040",
"poblacion": "Madrid",
"provincia": "Madrid",
"fecha_creacion": "2025-12-01T22:23:15.499Z",
"fecha_modificacion": "2025-12-01T22:23:15.499Z",
"representacion": "Inexistente"
}
]NIF Information
This endpoint returns the information of a specific NIF.
Visit our API Reference to test this endpoint.
Endpoint
GET https://ecartpay.com/api/billings/providers/{id}/nifs/{nif}GET https://sandbox.ecartpay.com/api/billings/providers/{id}/nifs/{nif}
Headers
Authorization:token
Path Parameters
id: The provideridof Verifacti is6917807fca828055fb9888e9.nif: The NIF to get information from.
Examples
Request
curl --location 'http://sandbox.ecartpay.com/api/billings/providers/6917807fca828055fb9888e9/nifs/B75777847' \
--header 'Authorization: eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY4YTRjMzE1MGIyOGE5NTg0MzA1YTJhYSIsImFjY291bnRfaWQiOiI2OGE0YzMxNTBiMjhhOTU4NDMwNWEyYTYiLCJhY2NvdW50Ijp7ImVtYWlsIjoiaHVnby5tb3JpbkBlY2FydHBheS5jb20iLCJmaXJzdF9uYW1lIjoiSHVnbyIsImxhc3RfbmFtZSI6Ik1vcsOtbiIsInBob25lIjoiNTI......' \
--header 'Cookie: lang=en'Response
{
"nif": "B75777847",
"entorno": "test",
"hacienda": "verifactu",
"webhooks": [],
"nombre": "Mi empresita SL",
"activo": true,
"direccion": "Calle Mayor 15",
"cp": "28040",
"poblacion": "Madrid",
"provincia": "Madrid",
"fecha_creacion": "2025-11-05T14:29:20.292Z",
"fecha_modificacion": "2025-12-01T17:50:02.158Z",
"representacion": "Inexistente"
}Update NIF
This endpoint allows you to modify the information of a specific NIF.
Visit our API Reference to test this endpoint.
Endpoint
PUT https://ecartpay.com/api/billings/providers/{id}/nifs/{nif}PUT https://sandbox.ecartpay.com/api/billings/providers/{id}/nifs/{nif}
Headers
Authorization:token
Path Parameters
id: The provideridof Verifacti is6917807fca828055fb9888e9.nif: The NIF that will be updated.
Examples
Request
curl --location --request PUT 'http://sandbox.ecartpay.com/api/billings/providers/6917807fca828055fb9888e9/nifs/B75777847' \
--header 'Authorization: eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY4YTRjMzE1MGIyOGE5NTg0MzA1YTJhYSIsImFjY291bnRfaWQiOiI2OGE0YzMxNTBiMjhhOTU4NDMwNWEyYTYiLCJhY2NvdW50Ijp7ImVtYWlsIjoiaHVnby5tb3JpbkBlY2FydHBheS5jb20iLCJmaXJzdF9uYW1lIjoiSHVnbyIsImxhc3RfbmFtZSI6Ik1vcsOtbiIsInBob25lIjoiNTI......' \
--header 'Content-Type: application/json' \
--header 'Cookie: lang=en' \
--data '{
"nombre": "Nombre Actualizado SL",
"direccion": "Calle Nueva 123",
"cp": "28001",
"poblacion": "Madrid",
"provincia": "Madrid"
}'Response
{
"nif": "B75777847",
"entorno": "test",
"hacienda": "verifactu",
"webhooks": [],
"nombre": "Nombre Actualizado SL",
"activo": true,
"direccion": "Calle Nueva 123",
"cp": "28001",
"poblacion": "Madrid",
"provincia": "Madrid",
"fecha_creacion": "2025-11-05T14:29:20.292Z",
"fecha_modificacion": "2025-12-01T22:34:23.974Z",
"representacion": "Inexistente"
}Deactivate NIF
This endpoint allows you to deactivate a NIF. Any deactivated NIF can be reactivated at any time to continue sending invoices.
Visit our API Reference to test this endpoint.
Endpoint
DELETE https://ecartpay.com/api/billings/providers/{id}/nifs/{nif}DELETE https://sandbox.ecartpay.com/api/billings/providers/{id}/nifs/{nif}
Headers
Authorization:token
Path Parameters
id: The provideridof Verifacti is6917807fca828055fb9888e9.nif: The NIF that will be deactivated.
Query Parameters
entorno: The environment of the NIF. This value can betestorprod.
Examples
Request
curl --location --request DELETE 'http://sandbox.ecartpay.com/api/billings/providers/6917807fca828055fb9888e9/nifs/B86561412' \
--header 'Authorization: eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY4YTRjMzE1MGIyOGE5NTg0MzA1YTJhYSIsImFjY291bnRfaWQiOiI2OGE0YzMxNTBiMjhhOTU4NDMwNWEyYTYiLCJhY2NvdW50Ijp7ImVtYWlsIjoiaHVnby5tb3JpbkBlY2FydHBheS5jb20iLCJmaXJzdF9uYW1lIjoiSHVnbyIsImxhc3RfbmFtZSI6Ik1vcsOtbiIsInBob25lIjoiNTI......' \
--header 'Cookie: lang=en'Response
{
"message": "OK"
}Activate NIF
This endpoint allows you to activate a NIF that has been previously deactivated.
Visit our API Reference to test this endpoint.
Endpoint
PUT https://ecartpay.com/api/billings/providers/{id}/nifs/{nif}/activatePUT https://sandbox.ecartpay.com/api/billings/providers/{id}/nifs/{nif}/activate
Headers
Authorization:token
Path Parameters
id: The provideridof Verifacti is6917807fca828055fb9888e9.nif: The NIF previously deactivated that will be activated upon successful request.
Query Parameters
entorno: The environment of the NIF. This value can betestorprod.
Examples
Request
curl --location --request PUT 'http://sandbox.ecartpay.com/api/billings/providers/6917807fca828055fb9888e9/nifs/B86561412/activate?entorno=test' \
--header 'Authorization: eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY4YTRjMzE1MGIyOGE5NTg0MzA1YTJhYSIsImFjY291bnRfaWQiOiI2OGE0YzMxNTBiMjhhOTU4NDMwNWEyYTYiLCJhY2NvdW50Ijp7ImVtYWlsIjoiaHVnby5tb3JpbkBlY2FydHBheS5jb20iLCJmaXJzdF9uYW1lIjoiSHVnbyIsImxhc3RfbmFtZSI6Ik1vcsOtbiIsInBob25lIjoiNTI......' \
--header 'Cookie: lang=en'Response
{
"message": "OK"
}VIES Validation
This endpoint allows you to validate that an intra-community NIF-IVA number is in the VIES census.
Visit our API Reference to test this endpoint.
Endpoint
POST https://ecartpay.com/api/billings/providers/{id}/nifs/validate/viesPOST https://sandbox.ecartpay.com/api/billings/providers/{id}/nifs/validate/vies
Headers
Authorization:token
Path Parameters
id: The provideridof Verifacti is6917807fca828055fb9888e9.
Examples
Request
curl --location 'http://sandbox.ecartpay.com/api/billings/providers/6917807fca828055fb9888e9/nifs/validate/vies' \
--header 'Authorization: eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY4YTRjMzE1MGIyOGE5NTg0MzA1YTJhYSIsImFjY291bnRfaWQiOiI2OGE0YzMxNTBiMjhhOTU4NDMwNWEyYTYiLCJhY2NvdW50Ijp7ImVtYWlsIjoiaHVnby5tb3JpbkBlY2FydHBheS5jb20iLCJmaXJzdF9uYW1lIjoiSHVnbyIsImxhc3RfbmFtZSI6Ik1vcsOtbiIsInBob25lIjoiNTI......' \
--header 'Content-Type: application/json' \
--header 'Cookie: lang=en' \
--data '{
"codigo_pais": "ES",
"iva": "B86561412"
}'Response
{
"iva": "ESB86561412",
"resultado": "IDENTIFICADO"
}Response key values
This response will return either IDENTIFICADO or NO IDENTIFICADO:
IDENTIFICADO: The IVA or NIF is identified as part of the VIES census.NO IDENTIFICADOThe IVA or NIF is not identified as part of the VIES census.
AEAT Validation
This endpoint allows you to validate that a NIF is identified in the AEAT.
Visit our API Reference to test this endpoint.
Endpoint
POST https://ecartpay.com/api/billings/providers/{id}/nifs/validate/aeatPOST https://sandbox.ecartpay.com/api/billings/providers/{id}/nifs/validate/aeat
Headers
Authorization:token
Path Parameters
id: The provideridof Verifacti is6917807fca828055fb9888e9.
Examples
Request
curl --location 'http://sandbox.ecartpay.com/api/billings/providers/6917807fca828055fb9888e9/nifs/validate/aeat' \
--header 'Authorization: eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY4YTRjMzE1MGIyOGE5NTg0MzA1YTJhYSIsImFjY291bnRfaWQiOiI2OGE0YzMxNTBiMjhhOTU4NDMwNWEyYTYiLCJhY2NvdW50Ijp7ImVtYWlsIjoiaHVnby5tb3JpbkBlY2FydHBheS5jb20iLCJmaXJzdF9uYW1lIjoiSHVnbyIsImxhc3RfbmFtZSI6Ik1vcsOtbiIsInBob25lIjoiNTI......' \
--header 'Content-Type: application/json' \
--header 'Cookie: lang=en' \
--data '{
"nif": "B86561412"
}'Response
{
"nif": "B86561412",
"nombre": "COCA-COLA EUROPACIFIC PARTNERS IBERIA SL",
"resultado": "IDENTIFICADO"
}Updated 10 days ago