ATCUD + QR code — mandatory on every invoice since 2023
Since 1 January 2023, every Portuguese invoice carries two new elements: an ATCUD (Código Único de Documento, unique document code) and a QR code. ATCUD makes each document traceable and verifiable by the tax authority (the AT); the QR code encodes the invoice essentials for a single-scan check. It is the culmination of fifteen years of anti-fraud engineering (SAF-T 2008 → certification 2010 → ATCUD 2023).
History — from DL 28/2019 to 1 January 2023
Decreto-Lei n.º 28/2019 set the principle: every invoice must display an enforceable unique identifier (ATCUD) and a QR code. Portaria n.º 195/2020 then defined the exact structure of both. The COVID-19 pandemic caused several postponements.
Final timeline: the QR code became mandatory in 2021-2022, then ATCUD on 1 January 2023. At that point the Portuguese anti-fraud triptych is complete: chained hash (since 2010), ATCUD (enforceable unique code) and QR code (scan verification). Portugal then has end-to-end billing control with no European equivalent at that date.
2019 | Decreto-Lei n.º 28/2019 — establishes the principle of ATCUD
| and the invoice QR code, but defers entry into force
| (several COVID-related postponements).
|
2020 | Portaria n.º 195/2020 (13 August) — defines the exact STRUCTURE
| of the QR code (19 fields A to R) and ATCUD. Despacho 412/2020-XXII
| details the technical specifications.
|
2021 | QR code recommended then mandatory; ATCUD still optional.
| Run-in phase: series registration via API opens.
|
2022 | ATCUD optional but already accepted; vendors integrate series
| communication to the AT (SOAP/REST channel).
|
2023 | 1 January — ATCUD MANDATORY on every invoice, with the series
| validation code. The QR code is already mandatory. The anti-
| fraud apparatus is complete: hash + ATCUD + QR. Governance — series registered with the AT
The crux of ATCUD is the prior registration of series.
Before issuing the first invoice of a new series (e.g. 2026A),
the company (or its software) must declare that series to the AT through a
dedicated webservice
(authenticated SOAP/REST channel). The AT then returns a validation
code (8 characters, e.g. JFHA3T7N) specific to that
series.
Each invoice's ATCUD is then built by concatenating that validation code and the document's sequential number within the series. Because the AT knows the validation code and the first declared numbering, it can verify that no invoice has been inserted out of sequence.
Technical schema — ATCUD + QR structure
ATCUD has a simple form:
<SeriesValidationCode>-<SequentialNumber>. The QR
code is defined by Portaria 195/2020: a string of tagged fields A
to R, separated by *, encoded as a model-2 QR with
error-correction level M. It carries the issuer and acquirer NIFs, the
document type and status, the date, the ATCUD, the VAT bases and amounts
per rate, the totals, the first 4 characters of the hash, and the software
certificate number.
--- ATCUD: structure ---
ATCUD = <SeriesValidationCode>-<SequentialNumber>
Example: JFHA3T7N-417
| |
| +-- sequential number of the document in the series
+----------- validation code issued by the AT when the
series was registered
--- QR code: 19 fields separated by '*' (excerpt) ---
A:509876543* (issuer NIF)
B:512345678* (acquirer NIF)
C:PT* (acquirer country)
D:FT* (document type)
E:N* (status: Normal)
F:20260612* (document date)
G:FT 2026A/00417* (full document no.)
H:JFHA3T7N-417* (ATCUD)
I1:PT* (tax space)
I7:1000.00*I8:230.00* (base + VAT at standard 23% rate)
N:230.00* (total VAT)
O:1230.00* (total with taxes)
Q:kEr8* (first 4 characters of the Hash)
R:1234 (software certificate no.) ATCUD vs other unique codes
| Dimension | ATCUD (PT) | Codice destinatario (IT) | VeriFactu (ES) |
|---|---|---|---|
| Nature | Unique code per document | SdI routing address | Per-invoice hash + QR |
| Issued by | AT (per series) | SdI (per recipient) | Self-computed + AEAT reporting |
| Visible on the invoice | Yes (text + QR) | No (internal routing) | Yes (QR) |
| Prior registration | Yes (series declared) | No | No |
| Year | 2023 | 2019 (SdI 2014) | 2024-2026 |
| Lineage | Original model | Different (clearance) | Inspired by PT model |
Adoption — every invoice since 2023
- 100% of Portuguese invoices carry a QR code since 2022 and an ATCUD since 1 January 2023 — a threshold-free obligation.
- Automated series registration: certified software calls the AT webservice in the background; the user usually does nothing manually.
- Consumer application: the e-fatura app and portal let a consumer scan the QR to attach the expense to their NIF (tax deduction).
- Field control: AT inspectors can scan a paper invoice and instantly verify its consistency — NIF, totals, software certificate.
Common pitfalls
- Issuing without registering the series. Without a validation code from the AT, a valid ATCUD cannot be built. Every new series must be declared before the first invoice.
- Confusing validation code and ATCUD. The validation code
(e.g.
JFHA3T7N) is issued once per series; the ATCUD (JFHA3T7N-417) adds the sequential number and changes on every invoice. - Wrong QR level / version. The QR must follow the Portaria 195/2020 spec (model 2, level M, ordered fields A–R). A malformed QR is unusable by the AT app.
- Missing VAT fields in the QR. Bases and amounts must be broken down per rate (I7/I8 standard, I4/I5 reduced, etc.). Incorrect grouping skews automatic reading.
- Thinking ATCUD replaces the hash. ATCUD, hash and QR are complementary: the hash ensures internal immutability, ATCUD enforceable uniqueness, the QR field verification.