定制 vatnode/eu-vat-rates-data 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

vatnode/eu-vat-rates-data

Composer 安装命令:

composer require vatnode/eu-vat-rates-data

包简介

VAT rates for 45 European countries — EU-27 plus Norway, Switzerland, UK, and more. Updated daily. From vatnode.dev — live VIES validation via API.

README 文档

README

Packagist Version PHP Version Last updated License: MIT

VAT rates for 45 European countries — EU-27 plus Norway, Switzerland, UK, and more. EU rates sourced from the European Commission TEDB and checked daily. Non-EU rates maintained manually.

  • Standard, reduced, super-reduced, and parking rates
  • eu_member flag on every country — true for EU-27, false for non-EU
  • vat_name — official name of the VAT tax in the country's primary official language
  • vat_abbr — short abbreviation used locally (e.g. "ALV", "MwSt", "TVA")
  • format — human-readable VAT number format (e.g. "ATU + 8 digits") — unique to this package
  • pattern — regex for VAT number validation + built-in validateFormat() — free, no API key needed — unique to this package
  • No dependencies — pure PHP 8.1+
  • Data bundled in the package — works offline, no network calls
  • EU rates checked daily via GitHub Actions, new version published only when rates change

Also available in: JavaScript/TypeScript (npm) · Python (PyPI) · Go · Ruby (RubyGems)

Need live VIES validation?

This package gives you VAT rates and format checks for free, offline, in your code. It does not call VIES — validateFormat() only checks the shape of a VAT number, not whether it actually exists.

For live VIES validation — confirming a VAT ID is real, pulling the registered company name and address, and getting a VIES consultation number (audit-grade proof of validation) — there's vatnode:

  • Live VIES validation, with national-database fallback when VIES is down
  • Registered company name, address, registration date
  • VIES consultation number for compliance and audit trails
  • Webhooks for VAT status changes
  • Official MCP server so AI agents (Claude, Cursor, ChatGPT) can validate VAT IDs directly
  • Free tier — no credit card needed
curl https://api.vatnode.dev/v1/vat/IE6388047V \
  -H "Authorization: Bearer YOUR_API_KEY"

Get a free API key →

Installation

composer require vatnode/eu-vat-rates-data

Usage

use vatnode\EuVatRates\EuVatRates;

// Full rate array for a country
$fi = EuVatRates::getRate('FI');
// [
//   'country'       => 'Finland',
//   'currency'      => 'EUR',
//   'eu_member'     => true,
//   'vat_name'      => 'Arvonlisävero',
//   'vat_abbr'      => 'ALV',
//   'standard'      => 25.5,
//   'reduced'       => [10.0, 13.5],
//   'super_reduced' => null,
//   'parking'       => null,
// ]

// Just the standard rate
EuVatRates::getStandardRate('DE');  // → 19.0

// EU membership check — false for non-EU countries (GB, NO, CH, ...)
if (EuVatRates::isEuMember($userInput)) {
    $rate = EuVatRates::getRate($userInput);
}

// Dataset membership check (all 45 countries)
if (EuVatRates::hasRate($userInput)) {
    $rate = EuVatRates::getRate($userInput);
}

// All 45 countries at once
foreach (EuVatRates::getAllRates() as $code => $rate) {
    echo "{$code}: {$rate['standard']}%\n";
}

// When were EU rates last fetched?
echo EuVatRates::dataVersion();  // e.g. "2026-03-27"

// VAT number format validation — no API key, no network call
EuVatRates::validateFormat('ATU12345678');  // → true
EuVatRates::validateFormat('DE123456789');  // → true
EuVatRates::validateFormat('INVALID');      // → false

// Access format metadata directly
$at = EuVatRates::getRate('AT');
echo $at['format'];   // "ATU + 8 digits"
echo $at['pattern'];  // "^ATU\d{8}$"

// Flag emoji from a 2-letter country code — no lookup table, computed from regional indicator symbols
EuVatRates::getFlag('FI');  // → "🇫🇮"
EuVatRates::getFlag('DE');  // → "🇩🇪"
EuVatRates::getFlag('XX');  // → "" (empty string for unknown/invalid codes)

Data source & update frequency

  • EU-27 rates: European Commission TEDB, refreshed daily at 07:00 UTC
  • Non-EU rates: maintained manually, updated on official rate changes
  • Published to Packagist only when actual rates change

Keeping rates current

Rates are bundled at install time. A new package version is published automatically whenever rates change — but your installed version will not update itself.

Recommended: add Renovate or Dependabot to your repo. They detect new versions and open a PR automatically whenever rates change — no manual update commands needed.

Need real-time accuracy? Fetch the always-current JSON directly:

https://cdn.jsdelivr.net/gh/vatnode/eu-vat-rates-data@main/data/eu-vat-rates-data.json

No package needed — parse it with a single fetch() / http.get() / file_get_contents() call and cache locally.

Covered countries

EU-27 (daily auto-updates via EC TEDB):

AT BE BG CY CZ DE DK EE ES FI FR GR HR HU IE IT LT LU LV MT NL PL PT RO SE SI SK

Non-EU Europe (manually maintained):

AD AL BA CH GB GE IS LI MC MD ME MK NO RS TR UA XK

Need to validate VAT numbers?

This package provides VAT rates only. If you also need to validate EU VAT numbers against the official VIES database — confirming a business is VAT-registered — check out vatnode.dev, a simple REST API with a free tier.

curl https://api.vatnode.dev/v1/vat/FI17156132 \
  -H "Authorization: Bearer vat_live_..."
# → { "valid": true, "companyName": "Suomen Pehmeä Ikkuna Oy" }

Changelog

2026-04-25

  • fix: Corrected Sweden (SE) VAT number regex — was ^SE\d{12}$, now correctly requires the mandatory 01 suffix: ^SE\d{10}01$.

License

MIT

If you find this useful, a ⭐ on GitHub is appreciated.

vatnode/eu-vat-rates-data 适用场景与选型建议

vatnode/eu-vat-rates-data 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 24 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 02 月 25 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「invoice」 「vat」 「tax」 「e-commerce」 「billing」 「rates」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 vatnode/eu-vat-rates-data 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 vatnode/eu-vat-rates-data 我们能提供哪些服务?
定制开发 / 二次开发

基于 vatnode/eu-vat-rates-data 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 24
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 38
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-02-25