Validation rule reference
Every rule SAFTCheck applies to your SAF-T (PT) XML, in plain language. Each page covers what AT expects, the most common ways the rule fails, and how to fix it.
encoding.declaration
XML encoding declaration (Windows-1252)
AT requires Windows-1252 encoding. UTF-8 declarations are silently rejected.
encoding.bom
Byte Order Mark (BOM) at file start
AT rejects SAF-T files that start with a UTF-8 or UTF-16 BOM.
nif.mod11
Portuguese NIF — Mod-11 algorithm and prefixes
9-digit Portuguese tax ID; check digit computed via Mod-11 with weights 9..2.
atcud.format
ATCUD format — VALIDATION-SEQUENCE since 2023
Mandatory unique-document code: 8 uppercase alphanumeric chars, dash, sequence ≥ 1.
header.dates
Header dates — StartDate, EndDate, FiscalYear, DateCreated
Time-window invariants AT enforces on the SAF-T Header block.
feature.inline-editor
Inline editor — fix NIF, ATCUD and header dates in place
Edit the offending value next to the finding, re-validate immediately, no ERP round-trip needed.
nif.vies
VIES cross-check — NIF registered in EU VAT exchange
Header NIF is verified against the EU VIES service and the registered name is compared with the SAF-T CompanyName.
invoice.date.out_of_range
Document date inside the Header reporting window
Every Invoice / Payment / WorkDocument / StockMovement date must fall inside Header.StartDate – Header.EndDate.
totals.reconciliation
Block totals reconcile against child documents
NumberOfEntries and TotalDebit+TotalCredit on each section must match the documents underneath, within 0.01 €.
invoice.currency.exchange
Foreign-currency documents need a complete <Currency> block
When a document declares a non-EUR currency, CurrencyCode + CurrencyAmount + ExchangeRate must all be present.
invoice.status
Invoice status code and date consistency
InvoiceStatus must be one of N/S/A/R/F and InvoiceStatusDate must be >= InvoiceDate.
Looking for narrative deep dives instead? See the blog for end-to-end fix walkthroughs.