Why invoices from certified software in Portugal have a QR code
By Mikael
The first time I bought a coffee in Lisbon as a registered freelancer, the little slip the café printed had a QR code at the bottom, something I had never seen in Sweden. I assumed it was a loyalty code. It was not. That slip was a simplified invoice (fatura simplificada), and in Portugal even a one-euro coffee comes on a real invoice, QR code and all. Same at the hardware store. Same on the invoice from my accountant.
I ignored it for months. Then a client asked me to send an invoice "with the QR." I looked it up, realized how deep the system goes, and started explaining it to every expat who had just registered their activity and was trying to figure out why their invoicing tool from back home wouldn't work here.
This is that explanation, written properly.
The QR code is just the visible part
The code itself is generated per Portaria 195/2020 and has been mandatory since 1 January 2022 on invoices issued by AT-certified software. Pre-printed documents from an authorised print shop (tipografia) carry no QR code. Scan it and you get a structured text string, not a URL. It contains:
- The issuer's NIF and the buyer's NIF (or the anonymous placeholder
999999990if no NIF was given) - The buyer's country
- The document type (FT for a standard invoice, FR for an invoice-receipt, NC for a credit note, and so on)
- The document status (normal or cancelled)
- The document date and number
- The ATCUD unique document code
- A breakdown of the taxable amounts and VAT by rate (reduced, intermediate, normal) and by territory (mainland, Madeira, Azores)
- The gross total and any withholding tax
- A 4-character excerpt of the document's cryptographic hash chain
- The AT software certificate number
That last field is the tell. The QR code carries the software certificate number and a short excerpt of the document's hash, which tie the invoice to certified software and to a signed hash chain. The ATCUD ties it to a registered series. Three separate links, all visible in a code you can scan on your phone.
What is ATCUD, and why does it matter
ATCUD stands for Código Único de Documento da AT. Every invoice series (invoices, receipts, credit notes) must be registered with the tax authority before any documents are issued. That registration returns a validation code. The ATCUD on each document combines that code with the document's sequential number.
So ABCD1234-7 means: document number 7 in the series identified by the validation code ABCD1234. The AT issued that code. The sequential number cannot be skipped or reused without creating a detectable gap.
ATCUD became mandatory on 1 January 2023, one year after the QR code requirement. Before 2023, you could issue a QR code without a valid ATCUD inside it. After 2023, both are required on documents from certified software. Only the QR code needs certified software: pre-printed tipografia documents carry an ATCUD but no QR code.
For a deeper look at the code itself, including how series registration works, see the ATCUD glossary entry.
Why every invoice issued by software must come from AT-certified software
The QR code isn't something you add manually, and neither is a series registration. They need software that:
- Registers your invoice series with the AT via a webservice and receives validation codes
- Assigns sequential document numbers without gaps or duplications
- Generates the QR code per the AT technical specification
- Communicates invoice data to the AT, either in real time or by day 5 of the following month
- Generates the SAF-T (PT) audit file covering all your invoicing activity
This is what AT certification means in practice. The AT maintains a public list of certified software providers. Tools built for the Portuguese market are generally on it. Most tools built for other markets are not, and a tool that is absent from the list cannot produce compliant Portuguese invoices, however good it is at invoicing elsewhere. So do not assume: before you commit to any tool, check the register on AT's register. It takes a click, and it is the only answer that counts.
The AT portal is free, and so is the ATGO app. Both issue Portuguese-language documents only, and ATGO issues only the fatura-recibo, so neither works if you need an English invoice. What certified third-party software adds is a better interface, automatic client records, and the ability to track everything without logging into the portal for each invoice.
SAF-T: one obligation, two channels
SAF-T (PT) is a standardized XML file that contains your complete invoicing record for a period. Portugal's national SAF-T format was introduced in 2008. Certified invoicing software came in phases from 2011 (Portaria 363/2010 of 23 June 2010), and the duty to communicate invoices to the AT has applied since 1 January 2013 (DL 198/2012).
That duty has two channels, and certified software offers both. The software can send each invoice to the AT in real time through a webservice. Or it produces the monthly billing SAF-T file, and you or your accountant upload it to the Portal das Finanças by day 5 of the following month. Which one you are on is a setting in your tool, and the real-time route is often a paid tier. If you are on the monthly route, SAF-T is not invisible: the upload is your filing.
The file also matters when you switch invoicing software and need to migrate your invoice history to the new system.
There is also a SAF-T contabilidade format, which covers full accounting entries. That one applies to periods from 2027, with the first file delivered in 2028. For simplified-regime freelancers with no organized accounting, it is not relevant.
eFatura: the consumer-facing side
The system described above covers invoices you issue. But Portugal built something equally significant on the consumer side.
When you give your NIF at a shop, café, pharmacy, or any Portuguese merchant, that transaction is reported through the merchant's certified software and lands in your e-Fatura account on Portal das Finanças. The AT uses those records to pre-fill your IRS deductions. Health, education, restaurant meals: all of it tracked automatically, deductions calculated for you, flowing into your Modelo 3 filing.
For freelancers on the simplified regime, eFatura does double duty. Personal purchases (health, education) feed into Anexo H deductions. Business purchases where you give your NIF as a professional also count toward the 15% documented expense requirement under the simplified regime, provided you classify the invoice as activity-related on e-Fatura by the end of February of the following year.
This is the part that genuinely surprises people who come from other countries. In most of Europe, tracking deductible expenses means keeping a folder of receipts, reconciling them manually, and hoping you didn't miss anything. In Portugal, if you gave your NIF, the AT already has the record.
For a full walkthrough of how to read your eFatura statement, categorize pending expenses, and handle the February review window, see eFatura: How to Read Your Expense Statement.
What the EU is only now requiring
The EU's ViDA (VAT in the Digital Age) package, Directive (EU) 2025/516, was adopted on 11 March 2025. It makes structured e-invoicing the default for intra-EU B2B transactions from 1 July 2030.
Portugal has not been waiting for ViDA. The requirements have been building since 2008 (SAF-T), through 2011 (certified software phased in), 2013 (invoice communication to the AT), 2022 (QR codes on invoices from certified software), and 2023 (ATCUD). The consumer-side eFatura system, where your purchases are tracked against your NIF and flow into your IRS return automatically, has been running for years.
Worth being clear about the design. Portugal's model is reporting by the issuer: an invoice issued by certified software is delivered to the buyer through whatever channel works, and reaches the AT either in real time or by day 5 of the following month.
The result, from a freelancer's perspective: if you are used to invoicing in Sweden, Germany, or the UK, the Portuguese system looks unusually sophisticated. The QR code is not decoration. The ATCUD is not bureaucracy for its own sake. They are the visible surface of an infrastructure that has been collecting invoice data and pre-filling parts of tax returns for years.
What this means when you are setting up as a freelancer
The practical consequence is that your invoicing software choice is not optional in the way it might be elsewhere. Every invoice issued by software has to come from AT-certified software, which registers series, generates ATCUDs, produces QR codes, and communicates data to the AT. The invoices of a tool that cannot do those things are not legally valid.
That is the certification gate most expats hit within their first month. Your existing tool from home, however good it is, is probably not on the AT certification list. Most tools built for other markets are not, so check the register.
The buyer's guide to certified invoicing software covers the main options and how to choose between them. PDF invoices are accepted as electronic invoices until 31 December 2026. After that, a PDF counts as an electronic invoice only where its origin and integrity are guaranteed, for example by a qualified electronic signature, a qualified electronic seal or an EDI system. The tolerance has been extended before, so check the next State Budget. For the current status, see PDF Invoices in Portugal in 2026.
The invoice types fact page covers the different document prefixes (FT, FR, FS, NC, ND, RG) and when each one is used.
Descodify handles invoicing, VAT, and IRS reporting so you can focus on your work.
Try Descodify freeWorking for yourself in Portugal - monthly
Invoicing, VAT, Social Security, expenses, and tax, explained simply. One email a month.