DEV Community

Alexander Nitrovich
Alexander Nitrovich

Posted on Originally published at blog.eurovalidate.com

Verify a company by registration number

Introduction

In today’s digital landscape, verifying a company by its registration number is essential for ensuring compliance and conducting due diligence. EuroValidate API simplifies this process by providing developers with a reliable tool to automate company verification. Whether you're onboarding new business partners or vetting potential vendors, integrating this capability into your systems can enhance operational efficiency and mitigate risk.

Understanding the Use-Case

Verifying a company's registration number is crucial in various scenarios such as business due diligence, vendor validation, and compliance checks. Automating these checks using an API saves time and reduces human error, ensuring data accuracy and improving decision-making processes in fintech companies, compliance solutions providers, and enterprise organizations.

How Our API Verifies Company Registration Numbers

EuroValidate API facilitates company verification by offering a straightforward architecture. The /v1/vat/{number} endpoint is designed to verify a company's VAT registration number, requiring input parameters like the registration number and the country code. An example response includes key data points such as company_name, company_address, and status, enabling effective verification workflows.

Step-by-Step Integration Guide

Authentication & API Key Setup

To start, sign up for an API key at EuroValidate. This key will authenticate your requests.

Constructing the API Request

Here's a typical request format to verify a company:

curl -X GET "https://api.eurovalidate.com/v1/vat/NL820646660B01" \
-H "Authorization: Bearer your_api_key" \
-H "Content-Type: application/json"
Enter fullscreen mode Exit fullscreen mode

Handling and Parsing the API Response

Upon making a request, handle the response carefully. The successful response provides company details:

Valid Response Example:

{
  "vat_number": "NL820646660B01",
  "country_code": "NL",
  "status": "verified",
  "company_name": "Test Company B.V.",
  "company_address": "Rokin 1, Amsterdam",
  "request_id": "abc123",
  "meta": {
    "confidence": 0.95,
    "source": "official database",
    "cached": false,
    "response_time_ms": 120
  }
}
Enter fullscreen mode Exit fullscreen mode

Invalid Response Example:

{
  "vat_number": "DE89370400440532013000",
  "country_code": "DE",
  "status": "invalid",
  "request_id": "xyz789",
  "meta": {
    "confidence": 0.80,
    "source": "official database",
    "cached": false,
    "response_time_ms": 150
  }
}
Enter fullscreen mode Exit fullscreen mode

Code Examples

Python Example

Before running the code, ensure EuroValidate library is installed:

pip install eurovalidate
Enter fullscreen mode Exit fullscreen mode
import requests

API_KEY = 'your_api_key'
vat_number = 'FR40303265045'
endpoint = f'https://api.eurovalidate.com/v1/vat/{vat_number}'

headers = {
    'Authorization': f'Bearer {API_KEY}',
    'Content-Type': 'application/json'
}

response = requests.get(endpoint, headers=headers)

if response.status_code == 200:
    data = response.json()
    print("Company Name:", data.get("company_name"))
    print("Company Address:", data.get("company_address"))
else:
    print("Error verifying registration:", response.status_code, response.text)
Enter fullscreen mode Exit fullscreen mode

Node.js Example

Ensure the EuroValidate SDK is installed:

npm install @eurovalidate/sdk
Enter fullscreen mode Exit fullscreen mode
const axios = require('axios');

const API_KEY = 'your_api_key';
const vatNumber = 'DE89370400440532013000';
const endpoint = `https://api.eurovalidate.com/v1/vat/${vatNumber}`;

axios.get(endpoint, {
  headers: { 
    Authorization: `Bearer ${API_KEY}`,
    'Content-Type': 'application/json'
  }
})
.then(response => {
  const data = response.data;
  console.log('Company Name:', data.company_name);
  console.log('Company Address:', data.company_address);
})
.catch(error => {
  console.error('Error verifying registration:', error.response ? error.response.status : error.message);
});
Enter fullscreen mode Exit fullscreen mode

Best Practices and Tips

To ensure data accuracy, manage your API requests within the rate limits of your pricing plan. Utilize robust error handling to manage connectivity issues or data discrepancies. Test thoroughly in a sandbox environment before production deployment to minimize disruptions.

Conclusion

Verifying a company by its registration number using EuroValidate API brings accuracy and efficiency to compliance and due diligence processes. Get started today by signing up for a free trial at EuroValidate and explore our comprehensive API documentation to leverage more endpoints and enhance your integration. Have questions? Schedule a demo with our technical team to see how our API can optimize your verification workflows.

Top comments (0)