ATCUD Validator (Portugal)
Validate official formatting, series validation codes, and structural integrity for Portuguese ATCUD codes and QR payloads.
How does validation work?
ATCUD (Código Único do Documento) is the mandatory document identifier enacted by Decree-Law 28/2019 and Ordinance 195/2020 by the Portuguese Tax Authority (AT).
Structured as [SeriesValidationCode]-[SequentialNumber], where the series validation code has at least 8 alphanumeric characters registered with AT.
Anatomy & Structure of ATCUD Code (Portugal)
The Unique Document Code (ATCUD) is composed of two segments joined by a hyphen per Ordinance 195/2020:
| Position | Field | Length | Meaning & Tax Authority Rules | Example |
|---|---|---|---|---|
| Part 1 | Series Validation Code | min 8 chars | Alphanumeric code granted by the Tax Authority (AT) upon invoice series registration. | BWXUJ79O |
| Separator | Hyphen | 1 char | Mandatory '-' separator between series code and sequence number. | - |
| Part 2 | Sequential Number | 1-10 digits | Strictly sequential document number issued within that documented series. | 26853 |
ATCUD Formation and Validation Rules (Ordinance 195/2020)
ATCUD guarantees invoice traceability across Portuguese billing systems:
ATCUD = [SeriesValidationCode]-[SequentialNumber]
- 1. Separator Validation: code must contain exactly one hyphen separating the two components.
- 2. Series Code Validation: left component must contain at least 8 valid alphanumeric characters issued by AT.
- 3. Sequential Number Validation: right component must consist purely of digits representing the chronological invoice number.