Guide6 min readAlberto García

Switzerland UID Validation API: Tax ID Checks for Swiss Businesses

Swiss tax IDs use the UID format (CHE + 9 digits). This guide explains the format, how UID differs from MWST registration, and how to validate both in Node.js and Python.

switzerlanduidvatapiguide

Switzerland is not an EU member state and does not participate in VIES. Swiss businesses are identified by their UID (Unternehmens-Identifikationsnummer — business identification number), a 9-digit number prefixed with `CHE`. Swiss VAT is administered by the Federal Tax Administration (ESTV/AFC/AFC) and is called MWST/TVA/IVA depending on language. A business may have a UID without being MWST-registered — the TaxID API distinguishes between these cases.

Swiss UID / MWST Format

FormatExampleNotes
CHE + 9 digitsCHE123456789Standard format — dashes and dots stripped
CHE-xxx.xxx.xxxCHE-123.456.789Display format — accepted, normalised automatically
CHE-xxx.xxx.xxx MWSTCHE-123.456.789 MWSTFull VAT registration number with MWST suffix

Validating a Swiss UID Number

typescriptlib/validate-ch-uid.ts
async function validateSwissUid(uidNumber: string) {
  // Normalise: strip spaces, dots, dashes, MWST suffix
  let normalised = uidNumber
    .replace(/[\s\.\-]/g, '')
    .replace(/MWST|TVA|IVA$/i, '')
    .toUpperCase();

  // Ensure CHE prefix
  if (!normalised.startsWith('CHE')) normalised = 'CHE' + normalised;

  const res = await fetch(
    `https://taxid.dev/api/v1/validate/CH/${normalised}`,
    { headers: { Authorization: `Bearer ${process.env.TAXID_API_KEY}` } }
  );

  return res.json();
}

// Usage:
const result = await validateSwissUid('CHE-123.456.789 MWST');
// or:
const result2 = await validateSwissUid('CHE123456789');

UID vs MWST Registration

Every Swiss company registered in the Commercial Register has a UID. Not every company with a UID is registered for MWST (Swiss VAT). A company only needs to register for MWST if their annual turnover exceeds CHF 100,000. The TaxID API returns `status: 'active'` only when the UID is active AND the company is registered for MWST. If the company has a valid UID but is not MWST-registered, it returns `status: 'inactive'`.

Note

Switzerland is not an EU member, so Swiss companies are third-country buyers for EU VAT purposes. EU reverse charge does not apply. If you sell goods to Swiss customers, apply your home country's export rules (typically zero-rate for goods, plus Swiss import VAT at the border). For digital services to Swiss B2C customers over CHF 100,000/year, you may need to register for Swiss VAT.

pythonvalidate_ch_uid.py
import os, re, requests

def validate_swiss_uid(uid_number: str) -> dict:
    # Strip spaces, dots, dashes, and MWST/TVA/IVA suffix
    normalised = re.sub(r'[\s\.\-]', '', uid_number).upper()
    normalised = re.sub(r'(MWST|TVA|IVA)$', '', normalised)
    if not normalised.startswith('CHE'):
        normalised = 'CHE' + normalised

    resp = requests.get(
        f'https://taxid.dev/api/v1/validate/CH/{normalised}',
        headers={'Authorization': f'Bearer {os.environ["TAXID_API_KEY"]}'},
        timeout=5,
    )
    resp.raise_for_status()
    return resp.json()

Start validating EU VAT numbers

Free plan — 100 validations/month. No credit card required.

AG
Alberto García

Founder, TaxID

Building EU VAT validation tools for developers. Obsessed with compliance automation and developer experience.