# TIN Validation

For transactions in jurisdictions that require a Tax Identification Number (TIN), Banxa validates the submitted value against the format and checksum rules for the user's country. The specific field type collected depends on the country — some countries use a national tax ID, others use a national identity number, and the US uses an SSN.

TIN collection is triggered by eligibility — it is required when a transaction meets the threshold for the Standard or Express tier in a TIN-required jurisdiction (primarily Europe). Partners do not need to determine when to collect it; the eligibility response will include it as a requirement when applicable.

## Tax ID type by country

The `type` value indicates which identifier Banxa collects and validates for each country.

| Type | Description |
|  --- | --- |
| `tax_id` | Government-issued tax identification number |
| `national_number` | National identity or civil registration number |
| `identity_card` | National identity card number |
| `ssn` | US Social Security Number |


| Country | Type |
|  --- | --- |
| AR — Argentina | `tax_id` |
| AT — Austria | `tax_id` |
| BE — Belgium | `national_number` |
| BG — Bulgaria | `national_number` |
| BR — Brazil | `tax_id` |
| CL — Chile | `tax_id` |
| CO — Colombia | `identity_card` |
| CY — Cyprus | `tax_id` |
| CZ — Czech Republic | `national_number` |
| DE — Germany | `tax_id` |
| DK — Denmark | `national_number` |
| EE — Estonia | `national_number` |
| ES — Spain | `tax_id` |
| FI — Finland | `national_number` |
| FR — France | `tax_id` |
| GB — United Kingdom | `national_number` |
| GR — Greece | `tax_id` |
| HR — Croatia | `national_number` |
| HU — Hungary | `tax_id` |
| IE — Ireland | `tax_id` |
| IT — Italy | `tax_id` |
| LT — Lithuania | `national_number` |
| LU — Luxembourg | `national_number` |
| LV — Latvia | `national_number` |
| MT — Malta | `tax_id` |
| MX — Mexico | `identity_card` |
| NL — Netherlands | `national_number` |
| PL — Poland | `national_number` |
| PT — Portugal | `tax_id` |
| RO — Romania | `national_number` |
| SE — Sweden | `national_number` |
| SI — Slovenia | `national_number` |
| SK — Slovakia | `national_number` |
| TH — Thailand | `tax_id` |
| US — United States | `ssn` |
| ZA — South Africa | `identity_card` |


## Validation rules by country

Format and checksum rules applied when validating a submitted TIN.

## 🇦🇷 Argentina (AR) - ArTinValidator

**Format:** DNI (7-8 digits) OR CUIT (11 digits)
**Regex:** `/^(?:\d{7,8}|\d{2}-\d{8}-\d)$/` (normalized)
**Validation:**

- DNI: Simple 7-8 digit number
- CUIT: 11 digits with Modulo 11 checksum
**Valid Examples:** `12345678`, `20-12345678-9`


## 🇦🇹 Austria (AT) - AtTinValidator

**Format:** 9 digits (Abgabenkontonummer)
**Regex:** `/^\d{9}$/`
**Validation:** Luhn-like algorithm with weighted sum

- Odd positions (1-based): Add digit directly
- Even positions (1-based): Multiply by 2, add cross-sum
- Check digit = (10 - (sum % 10)) % 10
**Valid Examples:** `123456789`


## 🇧🇪 Belgium (BE) - BeTinValidator

**Format:** 11 digits (National Number)
**Regex:** `/^\d{11}$/`
**Validation:** Modulo 97 checksum

- Pre-2000: Check = 97 - (First9Digits % 97)
- Post-2000: Check = 97 - ((2000000000 + First9Digits) % 97)
**Valid Examples:** `85073003361`, `00012312345`


## 🇧🇬 Bulgaria (BG) - BgTinValidator

**Format:** 10 digits (EGN - Unified Civil Number)
**Regex:** `/^\d{10}$/`
**Validation:** Weighted sum modulo 11

- Weights: [2, 4, 8, 5, 10, 9, 7, 3, 6]
- If remainder < 10: check digit = remainder
- If remainder == 10: check digit = 0
**Valid Examples:** `1234567890`


## 🇧🇷 Brazil (BR) - BrTinValidator

**Format:** 11 digits (CPF)
**Regex:** `/^\d{11}$/`
**Validation:** Dual check-digit validation (Modulo 11)

- First check digit: Weighted sum of first 9 digits
- Second check digit: Weighted sum of first 10 digits
**Valid Examples:** `12345678909`


## 🇨🇱 Chile (CL) - ClTinValidator

**Format:** 7-9 characters (RUT/CI)
**Regex:** `/^\d{7,8}[0-9K]$/` (normalized)
**Validation:** Modulo 11 checksum

- Multipliers cycle: 2, 3, 4, 5, 6, 7, 2, 3...
- Remainder 11 → '0', Remainder 10 → 'K', else → digit
**Valid Examples:** `12.345.678-5`, `12345678-5`, `12.345.670-K`


## 🇨🇴 Colombia (CO) - CoTinValidator

**Format:** 6-10 digits (CC - Cédula de Ciudadanía)
**Regex:** `/^\d{6,10}$/`
**Validation:** Format only (no checksum)
**Valid Examples:** `123456`, `1234567890`

## 🇨🇾 Cyprus (CY) - CyTinValidator

**Format:** 8 digits + 1 letter (TIC)
**Regex:** `/^\d{8}[A-Z]$/`
**Validation:** Custom translation map for even indices

- Even indices use translation map
- Odd indices add directly
- Sum % 26 → Letter (A-Z)
**Valid Examples:** `12345678A`


## 🇨🇿 Czech Republic (CZ) - CzTinValidator

**Format:** 9 or 10 digits (DIČ/RČ)
**Regex:** `/^\d{9,10}$/`
**Validation:**

- 10 digits: (First 9 % 11) % 10 == 10th digit
- 9 digits: No checksum (pre-1954)
**Valid Examples:** `1234567890`, `123456789`


## 🇩🇪 Germany (DE) - DeTinValidator

**Format:** 11 digits (Steuer-Identifikationsnummer)
**Regex:** `/^\d{11}$/`
**Validation:** ISO 7064 Mod 11,10 + structure check

- First digit cannot be 0
- Exactly one digit must repeat 2 or 3 times in first 10 digits
- ISO 7064 Mod 11,10 checksum
**Valid Examples:** `12345678902`


## 🇩🇰 Denmark (DK) - DkTinValidator

**Format:** 10 digits (CPR)
**Regex:** `/^\d{10}$/`
**Validation:** Format only (no checksum)
**Valid Examples:** `1234567890`

## 🇪🇪 Estonia (EE) - EeTinValidator

**Format:** 11 digits (Isikukood)
**Regex:** `/^\d{11}$/`
**Validation:** Weighted sum modulo 11 (two-stage)

- Weights1: [1, 2, 3, 4, 5, 6, 7, 8, 9, 1]
- If remainder == 10, use Weights2: [3, 4, 5, 6, 7, 8, 9, 1, 2, 3]
- If still 10, check digit = 0
**Valid Examples:** `12345678901`


## 🇪🇸 Spain (ES) - EsTinValidator

**Format:** NIF (8 digits + letter) OR NIE (X/Y/Z + 7 digits + letter)
**Regex:** `/^(\d{8}|[XYZ]\d{7})[A-Z]$/`
**Validation:** Modulo 23 with letter mapping

- NIE: Replace X→0, Y→1, Z→2
- Number % 23 → Letter from "TRWAGMYFPDXBNJZSQVHLCKE"
**Valid Examples:** `12345678Z`, `X1234567L`


## 🇫🇮 Finland (FI) - FiTinValidator

**Format:** 11 characters (HETU)
**Regex:** `/^\d{6}[+\-A]\d{3}[0-9A-Z]$/`
**Validation:** Modulo 31 checksum

- Combine DDMMYY + NNN (ignore separator)
- Number % 31 → Check char from "0123456789ABCDEFHJKLMNPRSTUVWXY"
**Valid Examples:** `010190-123A`


## 🇫🇷 France (FR) - FrTinValidator

**Format:** 13 digits (NIF)
**Regex:** `/^[0-3]\d{12}$/`
**Validation:** Format only - first digit must be 0, 1, 2, or 3
**Valid Examples:** `0123456789012`, `1123456789012`

## 🇬🇧 United Kingdom (GB) - GbTinValidator

**Format:** 2 letters + 6 digits + 1 letter (NINO)
**Regex:** `/^[A-CEGHJ-PR-TW-Z]{1}[A-CEGHJ-NPR-TW-Z]{1}[0-9]{6}[A-D]{1}$/`
**Validation:** Format + forbidden prefix check

- Forbidden prefixes: BG, GB, KN, NK, NT, TN, ZZ, OO
**Valid Examples:** `AB123456C`


## 🇬🇷 Greece (GR) - GrTinValidator

**Format:** 9 digits (AFM)
**Regex:** `/^\d{9}$/`
**Validation:** Weighted sum modulo 11

- Weights: [256, 128, 64, 32, 16, 8, 4, 2]
- Check digit = (Sum % 11) % 10
**Valid Examples:** `123456789`


## 🇭🇷 Croatia (HR) - HrTinValidator

**Format:** 11 digits (OIB)
**Regex:** `/^\d{11}$/`
**Validation:** ISO 7064 Mod 11,10
**Valid Examples:** `12345678901`

## 🇭🇺 Hungary (HU) - HuTinValidator

**Format:** 10 digits (Adóazonosító jel)
**Regex:** `/^\d{10}$/`
**Validation:** Weighted sum modulo 11

- Weights: [1, 2, 3, 4, 5, 6, 7, 8, 9]
- If remainder == 10: Invalid
- Else: Check digit = remainder
**Valid Examples:** `1234567890`


## 🇮🇪 Ireland (IE) - IeTinValidator

**Format:** 7 digits + 1 or 2 letters (PPS)
**Regex:** `/^\d{7}[A-Z]{1,2}$/`
**Validation:** Weighted sum modulo 23

- Weights for first 7 digits: [8, 7, 6, 5, 4, 3, 2]
- If 9 chars, add (9th char value × 9) to sum
- Remainder 0 → 'W', else → letter from A-Z
**Valid Examples:** `1234567W`, `1234567WA`


## 🇮🇹 Italy (IT) - ItTinValidator

**Format:** 16 characters (Codice Fiscale)
**Regex:** `/^[A-Z]{6}\d{2}[ABCDEHLMPRST]\d{2}[A-Z]\d{3}[A-Z]$/`
**Validation:** Complex odd/even position mapping

- Odd positions: Custom value map
- Even positions: 0-9 = 0-9, A-Z = 0-25
- Sum % 26 → Check letter
**Valid Examples:** `RSSMRA00A01H501X`


## 🇱🇹 Lithuania (LT) - LtTinValidator

**Format:** 11 digits (Asmens kodas)
**Regex:** `/^\d{11}$/`
**Validation:** Same as Estonia (two-stage weighted sum)

- Weights1: [1, 2, 3, 4, 5, 6, 7, 8, 9, 1]
- If remainder == 10, use Weights2: [3, 4, 5, 6, 7, 8, 9, 1, 2, 3]
**Valid Examples:** `12345678901`


## 🇱🇻 Latvia (LV) - LvTinValidator

**Format:** 11 digits (Personas kods)
**Regex:** `/^\d{11}$/`
**Validation:** Format only (post-2017 IDs have no checksum)
**Valid Examples:** `12345678901`

## 🇱🇺 Luxembourg (LU) - LuTinValidator

**Format:** 13 digits (Matricule)
**Regex:** `/^\d{13}$/`
**Validation:** Dual checksum (Luhn + Verhoeff)

- 12th digit = Luhn checksum of first 11 digits
- 13th digit = Verhoeff checksum of first 11 digits
**Valid Examples:** `1234567890123`


## 🇲🇹 Malta (MT) - MtTinValidator

**Format:** 7 digits + letter OR 9 digits
**Regex:** `/^(\d{7}[ABGHLMPZ]|\d{9})$/`
**Validation:** Format only

- Identity Card: 7 digits + letter (A, B, G, H, L, M, P, Z)
- Taxpayer Reference: 9 digits
**Valid Examples:** `1234567M`, `123456789`


## 🇲🇽 Mexico (MX) - MxTinValidator

**Format:** 18 characters (CURP)
**Regex:** `/^[A-Z]{4}\d{6}[HM][A-Z]{5}[A-Z0-9]\d$/`
**Validation:** Format only (case-insensitive)
**Valid Examples:** `HEGG560427MVZRRL04`

## 🇳🇱 Netherlands (NL) - NlTinValidator

**Format:** 9 digits (BSN)
**Regex:** `/^\d{9}$/`
**Validation:** 11-test (weighted sum)

- Weights: [9, 8, 7, 6, 5, 4, 3, 2, -1]
- Sum % 11 must equal 0
**Valid Examples:** `123456782`


## 🇵🇱 Poland (PL) - PlTinValidator

**Format:** 11 digits (PESEL)
**Regex:** `/^\d{11}$/`
**Validation:** Weighted sum

- Weights: [1, 3, 7, 9, 1, 3, 7, 9, 1, 3]
- Check digit = (10 - (sum % 10)) % 10
**Valid Examples:** `12345678901`


## 🇵🇷 Puerto Rico (PR) - UsTinValidator

**Uses US SSN validation** (same as US)

## 🇵🇹 Portugal (PT) - PtTinValidator

**Format:** 9 digits (NIF)
**Regex:** `/^\d{9}$/`
**Validation:** Weighted sum modulo 11

- Weights: [9, 8, 7, 6, 5, 4, 3, 2]
- If remainder < 2: check digit = 0
- Else: check digit = 11 - remainder
**Valid Examples:** `123456789`


## 🇷🇴 Romania (RO) - RoTinValidator

**Format:** 13 digits (CNP)
**Regex:** `/^\d{13}$/`
**Validation:** Weighted sum modulo 11

- Weights: [2, 7, 9, 1, 4, 6, 3, 5, 8, 2, 7, 9]
- If remainder == 10: check digit = 1
- Else: check digit = remainder
**Valid Examples:** `1234567890123`


## 🇸🇪 Sweden (SE) - SeTinValidator

**Format:** 10 or 12 digits (Personnummer)
**Regex:** `/^(\d{10}|\d{12})$/`
**Validation:** Luhn algorithm

- If 12 digits, drop first 2 (century)
- Luhn checksum on remaining 10 digits
**Valid Examples:** `1234567890`, `201234567890`


## 🇸🇮 Slovenia (SI) - SiTinValidator

**Format:** 8 digits (Davčna številka)
**Regex:** `/^\d{8}$/`
**Validation:** Weighted sum modulo 11

- Weights: [8, 7, 6, 5, 4, 3, 2]
- If remainder 0 or 1: check digit = 0
- Else: check digit = 11 - remainder
**Valid Examples:** `12345678`


## 🇸🇰 Slovakia (SK) - SkTinValidator

**Format:** 9 or 10 digits (Rodné číslo)
**Regex:** `/^\d{9,10}$/`
**Validation:**

- 10 digits: (First 9 % 11) % 10 == 10th digit
- 9 digits: No checksum (pre-1954)
**Valid Examples:** `1234567890`, `123456789`


## 🇹🇭 Thailand (TH) - ThTinValidator

**Format:** 13 digits (TIC)
**Regex:** `/^\d{13}$/`
**Validation:** Format only (no checksum)
**Valid Examples:** `1234567890123`

## 🇺🇸 United States (US) - UsTinValidator

**Format:** 9 digits (SSN)
**Regex:** Complex validation (not simple regex)
**Validation:** Multiple rules

- Cannot start with 666, 000, or 9xx
- Group number (digits 4-5) cannot be 00
- Serial number (digits 6-9) cannot be 0000
**Valid Examples:** `123-45-6789`, `123456789`
**Invalid Examples:** `666-12-3456`, `000-12-3456`, `123-00-3456`


## 🇿🇦 South Africa (ZA) - ZaTinValidator

**Format:** 13 digits (SAID)
**Regex:** `/^\d{13}$/`
**Validation:** Luhn checksum

- Last digit must match Luhn checksum of first 12 digits
**Valid Examples:** `8001015009087`


**Total: 36 countries supported**
**Validation Types:**

- Simple Regex: 6 countries (CO, DK, FR, LV, MX, TH)
- Checksum Validation: 30 countries (various algorithms)