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

推荐订阅源

小众软件
小众软件
N
News and Events Feed by Topic
A
About on SuperTechFans
aimingoo的专栏
aimingoo的专栏
The Cloudflare Blog
H
Heimdal Security Blog
Schneier on Security
Schneier on Security
Engineering at Meta
Engineering at Meta
Google Online Security Blog
Google Online Security Blog
宝玉的分享
宝玉的分享
AI
AI
The GitHub Blog
The GitHub Blog
MongoDB | Blog
MongoDB | Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
The Last Watchdog
The Last Watchdog
T
Troy Hunt's Blog
S
Security @ Cisco Blogs
H
Hacker News: Front Page
F
Fortinet All Blogs
博客园_首页
S
Secure Thoughts
N
News and Events Feed by Topic
P
Proofpoint News Feed
Microsoft Azure Blog
Microsoft Azure Blog
I
InfoQ
Spread Privacy
Spread Privacy
Hacker News - Newest:
Hacker News - Newest: "LLM"
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Hugging Face - Blog
Hugging Face - Blog
Hacker News: Ask HN
Hacker News: Ask HN
C
CXSECURITY Database RSS Feed - CXSecurity.com
酷 壳 – CoolShell
酷 壳 – CoolShell
Stack Overflow Blog
Stack Overflow Blog
L
LINUX DO - 最新话题
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
S
Schneier on Security
Know Your Adversary
Know Your Adversary
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Scott Helme
Scott Helme
P
Privacy & Cybersecurity Law Blog
S
Securelist
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
O
OpenAI News
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
PCI Perspectives
PCI Perspectives
L
LangChain Blog
雷峰网
雷峰网
Security Archives - TechRepublic
Security Archives - TechRepublic
V2EX - 技术
V2EX - 技术

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 Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Validate German VAT Numbers (USt-IdNr.) in Node.js
Iurii Roguli · 2026-05-29 · via DEV Community

Originally published at vatnode.dev. The version on vatnode.dev is the canonical source — refer to it for the latest content.

Germany is the largest EU market for most B2B SaaS, and the German VIES node is one of the member-state paths engineering teams commonly build fallback logic around. If you are validating German VAT numbers in Node.js, the format check is the easy part. Getting a reliable answer when VIES DE is throttling or temporarily offline is the actual problem. Here is the full pipeline.

What a German VAT number looks like

Germany issues two different tax identifiers, and developers regularly confuse them:

  • USt-IdNr. (Umsatzsteuer-Identifikationsnummer) — the EU VAT ID. Format: DE + 9 digits. This is what goes on cross-border B2B invoices and what VIES validates.
  • Steuernummer — the domestic tax number issued by the local Finanzamt. Format varies by federal state (10 or 11 digits, sometimes with slashes). This is not a VAT ID and is not valid for VIES.

If a customer gives you a number without the DE prefix and it contains slashes, they sent you the wrong thing. Ask for the USt-IdNr.

Step 1: format validation

Before you make any network call, reject malformed input. The regex is short, but you need to decide up-front which mode you are running in:

  • Strict (API mode) — your service exposes a documented DE + 9-digit format. Reject anything else.
  • Lenient (checkout mode) — accept what the customer types and try to make it work. Spaces, dots, and a missing DE prefix are common; auto-correct them and log the original input.

Make the difference explicit in code, not implicit:

const DE_VAT_PATTERN = /^DE\d{9}$/

function normaliseGermanVatId(
  input: string,
  opts: { mode?: 'strict' | 'lenient' } = {}
): string | null {
  let cleaned = input.replace(/[\s.\-]/g, '').toUpperCase()
  // Lenient mode: prepend DE when the user typed only the 9 digits
  if (opts.mode === 'lenient' && /^\d{9}$/.test(cleaned)) {
    cleaned = `DE${cleaned}`
  }
  return DE_VAT_PATTERN.test(cleaned) ? cleaned : null
}

// Strict (default) — API consumers should send a fully-qualified ID
normaliseGermanVatId('DE 123 456 789')                    // → 'DE123456789'
normaliseGermanVatId('123456789')                         // → null

// Lenient — for checkout forms where customers paste 9 digits
normaliseGermanVatId('123456789', { mode: 'lenient' })    // → 'DE123456789'
normaliseGermanVatId('DE12345678', { mode: 'lenient' })   // → null (still wrong length)

Enter fullscreen mode Exit fullscreen mode

There is a checksum algorithm (MOD 11-10) used internally by BZSt, but it is not officially documented for third-party client use. Do not gate on it. Treat checksum failure as a soft signal that may warrant a warning, never as grounds to reject — the authoritative yes/no comes from VIES or BZSt.

Step 2: VIES — and why DE is special

VIES is the EU-wide validation service. For most member states it works fine. For Germany it does not, often enough that you have to design around it.

VIES is a federation of 27 national nodes. When you query a DE number, the European Commission routes the request to the BZSt (Bundeszentralamt für Steuern) system in Bonn. BZSt rate-limits and occasionally takes the node offline. The result your application sees from VIES is either:

  • A valid/invalid answer
  • MS_UNAVAILABLE (the German node is down)
  • SERVICE_UNAVAILABLE (VIES itself is degraded)
  • A timeout after ~10 seconds

You cannot fix the VIES DE node. What you can do is fall back to BZSt directly.

Step 3: BZSt fallback

BZSt operates eVatR (elektronische Bestätigung von Umsatzsteuer-Identifikationsnummern), a separate validation endpoint for German VAT IDs. It is the same authority that backs VIES DE — but the direct path is more reliable than going through the VIES federation.

There are two important differences between BZSt and VIES:

  1. BZSt requires a valid German VAT ID as the requester. You cannot call BZSt with a non-German VAT number on the requester field. If your company is not German, you cannot use BZSt directly — only as a proxy through a service that has a DE VAT ID.
  2. BZSt does not disclose trader name or address as returned data. A qualified eVatR check can confirm whether the name, address, and postcode you supplied match what BZSt has on file (and return a per-field match status), but BZSt will not hand you those fields if you do not already have them. VIES, by contrast, returns trader name and address when valid (and when the trader has not opted out of disclosure under EU rules). For invoicing under § 14 UStG you usually need to be able to show the name and address, so BZSt is a fallback for the yes/no signal — and optionally a confirmation that the data you already collected matches.

Here is the pattern a resilient validator should implement:

async function validateGermanVat(vatId: string) {
  const cleaned = normaliseGermanVatId(vatId)
  if (!cleaned) {
    return { valid: false, error: 'INVALID_FORMAT' }
  }

  try {
    const vies = await callVies(cleaned)
    if (vies.status === 'OK') {
      return {
        valid: vies.valid,
        name: vies.name,
        address: vies.address,
        source: 'VIES',
      }
    }
  } catch (e) {
    // fall through to BZSt
  }

  // VIES DE unavailable — try BZSt
  const bzst = await callBzst(cleaned)
  return {
    valid: bzst.valid,
    name: null,        // BZSt does not return this
    address: null,
    source: 'BZST',
  }
}

Enter fullscreen mode Exit fullscreen mode

Implementing callBzst yourself means SOAP, a registered requester VAT ID, and handling their error codes (Status A through Status E). It is doable — and a reasonable choice if your team is German and already has a USt-IdNr. to act as the requester.

You have three honest options for the DE fallback path:

  1. Build the BZSt integration directly. Costs engineering time and ongoing maintenance, but gives you full control.
  2. Queue retries against VIES without a fallback. Simplest. Works fine if your flow can tolerate a "we'll get back to you" UX.
  3. Use a VAT validation provider that already runs the pipeline. Several exist; the rest of this article walks through how vatnode does it.

Step 4: use vatnode and skip the boilerplate

vatnode runs the full pipeline above on every German request. If VIES DE is healthy, you get a VIES response with name and address. If VIES DE is unavailable, vatnode automatically retries against BZSt and returns the BZSt result. The response shape is the same — only the source field changes.

const res = await fetch(
  'https://api.vatnode.dev/v1/vat/DE123456789',
  { headers: { Authorization: `Bearer ${process.env.VATNODE_API_KEY}` } }
)

const data = await res.json()
// {
//   "valid": true,
//   "countryCode": "DE",
//   "vatNumber": "123456789",
//   "name": "Example GmbH",          // null if source = BZST
//   "address": "Musterstr. 1, ...",  // null if source = BZST
//   "source": "VIES",                 // or "BZST"
//   "consultationNumber": "WAPIAAAAX...",
//   "checkedAt": "2026-05-22T08:30:00.000Z"
// }

Enter fullscreen mode Exit fullscreen mode

The source field is what lets your invoicing logic know whether you have the trader name. Branch on it:

if (data.source === 'VIES') {
  // Use data.name and data.address on the invoice
} else if (data.source === 'BZST') {
  // BZSt validated the ID — fetch name/address from your CRM
  // or ask the customer to confirm
}

Enter fullscreen mode Exit fullscreen mode

The consultationNumber is the VIES-issued reference that proves you validated the number on a specific date. Store it as audit evidence — the European Commission explicitly recommends keeping proof of validation, and many finance teams retain it because auditors may request evidence of VAT validation on intra-EU reverse-charge supplies. See the VIES downtime guide for why this matters and how to surface it in your audit trail.

What to store in your database

For German VAT IDs specifically, your validation log should include:

  • The cleaned VAT ID (uppercase, no separators)
  • valid (boolean)
  • source (VIES or BZST)
  • consultationNumber (if from VIES)
  • name and address (if from VIES)
  • checkedAt timestamp

If source was BZST, schedule a re-check next time VIES recovers so you can capture the consultation number and trader details. The Node.js VAT validation guide shows the schema vatnode customers use for this.

Common gotchas

  • Customer types the Steuernummer. Detect the slashes early and reject. A 12/345/67890 is never a USt-IdNr.
  • Customer omits the DE prefix. In checkout flows, use the lenient normalisation mode shown above so a bare 9-digit number is auto-prefixed. In strict API mode, reject and let the caller resubmit — and log the original input either way.
  • Spaces and dots. Germans write VAT IDs with spaces (DE 123 456 789) and sometimes dots. Strip them.
  • You query VIES and get MS_UNAVAILABLE. This is not "invalid". Treat it as a transient error and fall back to BZSt or queue for retry — never block checkout on this. See the VIES alternative with automatic fallback for the broader pattern across all member states.

Validate DE VAT numbers without building the BZSt fallback yourself

vatnode handles VIES DE plus BZSt fallback in one call, returns a stable response shape with a source field, and includes the VIES consultation number for your audit trail. Free plan, 100 requests/month.

Get a free API key · German VAT API reference