惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

B
Blog RSS Feed
量子位
Y
Y Combinator Blog
大猫的无限游戏
大猫的无限游戏
B
Blog
U
Unit 42
C
Check Point Blog
I
InfoQ
aimingoo的专栏
aimingoo的专栏
雷峰网
雷峰网
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 【当耐特】
人人都是产品经理
人人都是产品经理
The Cloudflare Blog
H
Help Net Security
MongoDB | Blog
MongoDB | Blog
博客园 - Franky
H
Hackread – Cybersecurity News, Data Breaches, AI and More
J
Java Code Geeks
Microsoft Azure Blog
Microsoft Azure Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
云风的 BLOG
云风的 BLOG
宝玉的分享
宝玉的分享
爱范儿
爱范儿

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Why we open-sourced our internal EU VAT sync for Magento 2
Jan-Hendrik · 2026-05-15 · via DEV Community

We open-sourced our internal Magento 2 module that keeps EU VAT rates and Tax Rules in sync automatically. It's on Packagist as storetown/module-tax-sync, MIT-licensed, and you can install it in one composer command. Here's why we did it and how it's built.

The pain you didn't know you had

If you run a Magento 2 store that ships across EU borders, you're probably maintaining ~50–60 tax rates by hand. Standard rate, reduced rate, sometimes a second reduced rate — for 27 EU countries, then Switzerland, the UK, and Norway if you care about those markets.

You added them once during the shop setup. Then someone in Finland decided 25.5% was a better number than 24% (true story — happened in 2024). Then the Covid-era temporary reductions expired in five countries on different dates. Then Estonia announced a 24% standard rate effective 2025-07-01.

Every time, an email lands in your finance team's inbox. Someone forwards it to dev. Dev edits Stores → Tax Zones and Rates. If they edit the rate but forget to recompile the cache, frontend prices stay wrong for a week. If they remember the rate but forget to map it to the right Tax Rule, the change quietly never takes effect on any product.

We've been running a small Magento 2 agency in Hamburg since 2014. We've watched this scenario play out across maybe a dozen client shops. So years ago we built a small internal module that does it for us. Last month we cleaned it up, ripped out the agency-specific bits, and put it on GitHub.

What the module does

storetown/module-tax-sync — MIT, free, no telemetry, no signup:

  • Pulls all 27 EU VAT rates from the EU VAT Rates API (the official one) — standard and reduced
  • Optional: CH, GB, NO (toggleable in admin)
  • Auto-creates Tax Rules, not just Tax Rates. This is the unsexy but important bit. Most Magento extensions stop at Rates. Ours wires the Rates up to your existing customer tax classes and product tax classes so the change is actually applied.
  • Runs on cron (daily/weekly/monthly — your call) and exposes manual sync via admin button + CLI
  • Sends an email diff when rates change: which country, old rate → new rate
  • Falls back to bundled static data if the EU VAT Rates API is unreachable, so you never get a broken sync

Install

composer require storetown/module-tax-sync
bin/magento module:enable Storetown_TaxSync
bin/magento setup:upgrade
bin/magento cache:flush

Enter fullscreen mode Exit fullscreen mode

That's it. Go to Stores → Configuration → Storetown → EU Tax Rate Sync, set your sync frequency and notification email, click Sync Now.

Architecture decisions worth knowing

  1. We picked the EU VAT Rates API over scraping

There's an EU Commission API that returns official current rates as structured data. We use it. Some commercial Magento tax modules scrape national tax authority sites individually — that breaks the moment Germany redesigns their tax page (which happens roughly every 18 months). The EU API doesn't have that fragility.

  1. Tax Rules are auto-created with predictable names

When the module creates a rate, it names it DE-Standard, DE-Reduced, AT-Standard, etc. The Tax Rule that wraps it gets a matching predictable name. This is deliberate — it means a future you can grep for them, automate around them, and tell at a glance what's ours vs. what was set up manually.

We don't touch any rate or rule whose name doesn't match our prefix. So your hand-crafted "DE-Special-Books-Reduced" rule survives any sync.

  1. Fallback data lives in the repo

Storetown/TaxSync/Data/fallback-rates.json is committed and updated with each release. If the EU API is down (it has been; once for 18 hours in late 2024), we fall back to this. Admins get a notification banner that says "API unreachable — using fallback from version X.Y.Z, last updated YYYY-MM-DD".

This is the kind of detail that matters in production but is annoying to write. So we wrote it once.

  1. CLI for CI/CD pipelines
bin/magento tax:sync:run              do a sync now
bin/magento tax:sync:status           last sync time + result
bin/magento tax:sync:run --dry-run    show what would change, don't write

Enter fullscreen mode Exit fullscreen mode

Plumb that into your deploy pipeline if you want — we run --dry-run on staging before every prod deploy.

Why open source, why now

Three reasons.

Reason one is honest self-interest: we're a small agency. Our four paid Magento extensions (checkout, B2B registration, attachments, surcharges) are what pay the bills. The tax-sync module was never going to be one of them — it's too narrow, the buyer pool is too small to support pricing. So either it stays internal and only our clients benefit, or it goes public and anyone running Magento 2 in the EU can use it.

Reason two is that maintaining it inside the agency was actually a slight drag. Every client onboarding meant copying it from one repo to another, occasionally forgetting to update a deprecated method, hand-merging fixes back. Public + Composer + semver = those problems go away.

Reason three is that we'd been quietly using the EU VAT Rates API for a year and seen exactly zero open-source Magento 2 modules using it. There are a couple of paid ones. There's a Drupal module. There's a Shopify app. For Magento 2 it's been DIY or pay €300/year. That gap shouldn't exist in 2026.

What we'd love help with

The roadmap is small and the issues are open:

  • More fallback data updates (PRs welcome — just bump fallback-rates.json and tag a release)
  • Multi-store config: if you run a multi-store with different default countries, we'd like to refine the per-store override logic
  • An eventually-consistent "rate history" view in admin (we have the data, we don't yet have a UI)

Repo + Issues: https://github.com/storetown-media/stm-magento-2-eu-tax-rate-sync


If you're running Magento 2 in the EU and tired of hand-maintaining tax rates, give it a try. And if you're at a Magento agency that does the same hand-maintenance dance, tell us — we'd love to compare notes.


Storetown-Media is a small Magento 2 agency in Hamburg. We've been building Magento extensions since 2014. Our paid catalog is at storetown-media.de/produkt-kategorie/downloads/magento-extensions/ — but this one's free.