atcud.format
ATCUD format — VALIDATION-SEQUENCE since 2023
Mandatory unique-document code: 8 uppercase alphanumeric chars, dash, sequence ≥ 1.
What ATCUD is
ATCUD (Código Único de Documento) is a unique document code AT mandates on every invoice, receipt, transport document and SAF-T entry since 1 January 2023. It links the document to a registered series at AT plus a sequential position within that series.
The format
ATCUD has two parts joined by a single dash:
<VALIDATION-CODE>-<SEQUENCE>
- Validation code: exactly 8 uppercase alphanumeric characters (A–Z, 0–9). AT issues this when you register a document series.
- Sequence: a positive integer starting at 1, no leading zeros.
SAFTCheck applies the regex:
/^[A-Z0-9]{8}-[1-9]\d{0,9}$/
Examples
| Value | Verdict | Why |
|---|---|---|
AAJFK4DH-1 | ✓ | 8 uppercase + dash + 1 |
BCDEF123-99 | ✓ | 8 uppercase + dash + 99 |
1234ABCD-1000000 | ✓ | Mix of digits + letters OK |
0 | ✓ (sentinel) | Allowed for documents whose series predates ATCUD obligations |
aaaaaaaa-1 | ✗ | Lowercase validation code |
AAJFK4DH1 | ✗ | Missing dash |
AAJFK4DH-0 | ✗ | Sequence must be ≥ 1 |
AAJFK4DH-001 | ✗ | Leading zero |
SHORTCD-1 | ✗ | Validation code must be exactly 8 chars |
How to fix
Look at the offending document in your ERP and the series registration on the AT portal:
- Confirm the series validation code with AT (Portal das Finanças → Faturação → Comunicação de séries).
- Make sure the ERP stores the validation code in uppercase exactly as AT issued it.
- Re-emit the document with the corrected ATCUD — or use the inline editor to patch this one occurrence in place. The editor includes a one-click UPPERCASE button for the common lowercase-validation-code case.
Related
- NIF Mod-11 — the entity-level identifier, separate from ATCUD.
- Inline editor — fix an ATCUD without re-emitting the document.
- Walkthrough: ATCUD format errors and how to fix them