DAC7 (Council Directive 2021/514/EU) requires digital platforms and marketplaces to collect, verify, and report seller information — including VAT registration — to EU tax authorities. From 1 January 2023, covered platforms must validate and report seller tax IDs annually, with retroactive reporting obligations for pre-existing sellers. A VAT validation API is the technical tool that makes this obligation automatable at scale.
What DAC7 Requires From Marketplaces
- →Collect VAT number (and TIN/tax identification number) from every EU-resident seller at onboarding.
- →Verify the VAT number is valid at the time of collection.
- →Perform annual re-validation and report inactive numbers to the relevant tax authority.
- →Withhold first payment to new sellers until VAT number is validated (for platforms that handle payment flows).
- →Store the validated VAT number, company name, registered address, and the date of validation for at least 7 years.
Onboarding Validation Flow
interface SellerOnboardingData {
sellerId: string;
vatNumber: string;
declaredCountry: string;
}
async function onboardSeller(data: SellerOnboardingData) {
const vat = data.vatNumber.replace(/\s/g, '').toUpperCase();
const country = vat.slice(0, 2);
// Validate VAT country matches declared country
const expectedPrefix = data.declaredCountry.toUpperCase();
if (country !== expectedPrefix && !(country === 'EL' && expectedPrefix === 'GR')) {
return {
approved: false,
reason: 'vat_country_mismatch',
message: `VAT number prefix ${country} does not match declared country ${expectedPrefix}`,
};
}
const res = await fetch(
`https://taxid.dev/api/v1/validate/${country}/${vat}`,
{ headers: { Authorization: `Bearer ${process.env.TAXID_API_KEY}` } }
);
const data_api = await res.json();
if (data_api.status === 'active') {
await db.seller.update({
where: { id: data.sellerId },
data: {
vatNumber: vat,
vatStatus: 'verified',
companyName: data_api.company_name,
companyAddress: data_api.address,
vatVerifiedAt: new Date(),
vatAuditRef: data_api.request_id,
paymentHold: false, // Release hold on first payment
},
});
return { approved: true, companyName: data_api.company_name };
}
if (data_api.status === 'service_unavailable') {
// Keep payment hold until manual review
return { approved: false, reason: 'pending_manual_review' };
}
return { approved: false, reason: data_api.status };
}Annual DAC7 Re-validation Batch
async function runAnnualDac7Revalidation() {
const sellers = await db.seller.findMany({
where: {
vatStatus: 'verified',
vatNumber: { not: null },
vatVerifiedAt: { lt: new Date(Date.now() - 365 * 24 * 60 * 60 * 1000) },
},
});
const report = { reconfirmed: 0, deregistered: 0, unavailable: 0 };
for (const seller of sellers) {
await new Promise(r => setTimeout(r, 300)); // rate limit
const vat = seller.vatNumber!;
const res = await fetch(
`https://taxid.dev/api/v1/validate/${vat.slice(0,2)}/${vat}`,
{ headers: { Authorization: `Bearer ${process.env.TAXID_API_KEY}` } }
);
const data = await res.json();
if (data.status === 'active') {
await db.seller.update({
where: { id: seller.id },
data: { vatVerifiedAt: new Date(), vatAuditRef: data.request_id },
});
report.reconfirmed++;
} else if (data.status === 'inactive') {
await db.seller.update({
where: { id: seller.id },
data: { vatStatus: 'deregistered', vatDeregisteredAt: new Date() },
});
// Flag for DAC7 annual report
report.deregistered++;
} else {
report.unavailable++;
}
}
return report;
}Related guides
Start validating EU VAT numbers
Free plan — 100 validations/month. No credit card required.