Use this skill with your AI agent
Paste this skill into your AI agent's context, or save the file to your project. Works with any AI agent that reads markdown.
| 1 | --- |
| 2 | name: portugal-einvoice |
| 3 | description: > |
| 4 | Use this skill whenever asked about e-invoicing in Portugal, ATCUD codes, SAF-T PT reporting, QR code requirements on invoices, certified billing software (Modelo 24), e-Fatura portal, Qualified Electronic Signature (QES) for invoices, CIUS-PT, B2G e-invoicing via Peppol, or any question about issuing, transmitting, validating, or archiving electronic invoices under Portuguese law. Trigger on phrases like "ATCUD", "SAF-T Portugal", "e-Fatura", "QR code invoice", "certified software AT", "Peppol Portugal", "B2G e-invoice", "invoice hash chain", "Portaria 363/2010", "Decreto-Lei 28/2019", or "Qualified Electronic Signature Portugal". ALWAYS read this skill before touching any Portugal invoicing compliance work. |
| 5 | version: 1.0 |
| 6 | jurisdiction: PT |
| 7 | category: invoicing |
| 8 | depends_on: |
| 9 | - einvoice-workflow-base |
| 10 | --- |
| 11 | |
| 12 | # Portugal E-Invoicing Compliance Skill v1.0 |
| 13 | |
| 14 | --- |
| 15 | |
| 16 | ## Section 1 -- Quick Reference |
| 17 | |
| 18 | | Field | Value | |
| 19 | |---|---| |
| 20 | | Country | Portugal (República Portuguesa) | |
| 21 | | Currency | EUR | |
| 22 | | E-invoicing system name | e-Fatura (reporting portal) + ATCUD/QR framework | |
| 23 | | Governing body | Autoridade Tributária e Aduaneira (AT) | |
| 24 | | Key legislation | Decreto-Lei 28/2019; Portaria 363/2010 (software certification); Portaria 321-A/2007 (SAF-T); Portaria 195/2020 (QR code specs); RGIT (penalties) | |
| 25 | | Implementation timeline | QR codes mandatory Jan 2022; ATCUD mandatory Jan 2023; B2G e-invoicing Jan 2024 all entities; QES for PDF invoices Jan 2027; SAF-T Accounting 2028 (FY 2027) | |
| 26 | | Current status (2026) | ATCUD and QR fully enforced; monthly SAF-T Billing active; B2G via Peppol/CIUS-PT; B2B not yet mandated as structured e-invoice; QES mandatory from Jan 2027 | |
| 27 | | Skill version | 1.0 | |
| 28 | |
| 29 | --- |
| 30 | |
| 31 | ## Section 2 -- Mandate Scope |
| 32 | |
| 33 | ### Who Must Comply |
| 34 | |
| 35 | **B2G (Business-to-Government):** |
| 36 | All suppliers to Portuguese public entities must issue structured e-invoices via Peppol (CIUS-PT / Peppol BIS Billing 3.0). Mandatory for large companies since 2021, extended to SMEs and micro-enterprises from 1 January 2024. |
| 37 | |
| 38 | **B2B (Business-to-Business):** |
| 39 | Portugal does not currently mandate structured e-invoice exchange between private entities. Instead, compliance is achieved through a layered framework: (1) certified invoicing software, (2) ATCUD unique document codes, (3) QR codes on all invoices, and (4) monthly SAF-T Billing reporting to AT. This gives AT real-time visibility without requiring direct B2B e-invoice exchange. |
| 40 | |
| 41 | **B2C (Business-to-Consumer):** |
| 42 | Same as B2B -- invoices must carry ATCUD and QR code, be issued via certified software, and be reported in SAF-T Billing. Consumers can verify invoices on e-Fatura for personal tax deductions. |
| 43 | |
| 44 | ### Thresholds and Exemptions |
| 45 | |
| 46 | - No turnover threshold -- all taxable persons performing VAT-taxable transactions in Portugal must comply. |
| 47 | - Non-resident companies with a Portuguese VAT registration must also use AT-certified software (since 2021). |
| 48 | - Simplified invoices (under EUR 100 or EUR 1,000 for certain sectors) still require ATCUD and QR codes. |
| 49 | |
| 50 | ### Timeline Phases |
| 51 | |
| 52 | | Date | Milestone | |
| 53 | |---|---| |
| 54 | | January 2020 | AT software certification framework under Portaria 363/2010 | |
| 55 | | January 2022 | QR codes mandatory on all fiscally relevant documents | |
| 56 | | January 2023 | ATCUD mandatory on all invoices and fiscally relevant documents | |
| 57 | | January 2024 | B2G e-invoicing mandatory for all entities (SMEs/micro included) | |
| 58 | | January 2025 | SAF-T Billing monthly 5th-day deadline strictly enforced | |
| 59 | | January 2027 | QES mandatory on all PDF invoices; PDFs without QES no longer legally valid | |
| 60 | | 2028 | First mandatory SAF-T Accounting file (FY 2027) | |
| 61 | |
| 62 | --- |
| 63 | |
| 64 | ## Section 3 -- Technical Format |
| 65 | |
| 66 | ### Invoice Format Standards |
| 67 | |
| 68 | **B2G:** UBL 2.1 XML via CIUS-PT (Core Invoice Usage Specification for Portugal), aligned with EN 16931. Transmitted over the Peppol network using Peppol BIS Billing 3.0. |
| 69 | |
| 70 | **B2B/B2C:** No mandated structured XML exchange format. Invoices may be issued as PDF, paper, or other formats, provided they are generated by AT-certified software and include ATCUD + QR code. The invoice data is reported to AT via SAF-T (PT) in XML. |
| 71 | |
| 72 | ### SAF-T (PT) Schema |
| 73 | |
| 74 | - XML structure defined by Portaria 321-A/2007 (updated periodically). |
| 75 | - SAF-T Billing contains: Header, Customer, TaxTable, Payments, Supplier, Product, SalesInvoices, MovementOfGoods, WorkingDocuments. |
| 76 | - SAF-T Accounting contains: Header, Customer, TaxTable, Payments, GeneralLedgerAccounts, Supplier, GeneralLedgerEntries, FixedAssets, Inventory. |
| 77 | |
| 78 | ### ATCUD Structure |
| 79 | |
| 80 | Format: `ATCUD:ValidationCode-SequentialNumber` |
| 81 | |
| 82 | The validation code is obtained from AT when registering an invoice series. The sequential number is assigned by the certified software. Example: `ATCUD:TES123TE-4561`. |
| 83 | |
| 84 | In the QR code and SAF-T XML, only `TES123TE-4561` (without the `ATCUD:` prefix) is used. |
| 85 | |
| 86 | ### QR Code Specification |
| 87 | |
| 88 | Defined by Portaria 195/2020. The QR code encodes: |
| 89 | - Issuer NIF (tax ID), buyer NIF, buyer country |
| 90 | - Document type, document status, document date, document unique ID, ATCUD |
| 91 | - Tax country region, tax base and tax amounts per VAT rate (fields I1-I8, J1-J8, K1-K8 for PT, PT-AC, PT-MA fiscal spaces) |
| 92 | - Gross total, withholding tax amount, hash (4-char hash from RSA signature) |
| 93 | |
| 94 | ### Hash Chain (RSA Digital Signature) |
| 95 | |
| 96 | Every invoice issued by certified software includes an RSA digital signature hash. The hash chain links each invoice to its predecessor, ensuring tamper-evidence. The first 4 characters of the hash must appear on the printed/PDF invoice. |
| 97 | |
| 98 | --- |
| 99 | |
| 100 | ## Section 4 -- Mandatory Fields |
| 101 | |
| 102 | ### Fields Required on Every Portuguese Invoice |
| 103 | |
| 104 | | Field | Description | |
| 105 | |---|---| |
| 106 | | Issuer NIF | Portuguese tax identification number of supplier | |
| 107 | | Issuer name and address | Full legal name and registered address | |
| 108 | | Buyer NIF | Required for B2B; "consumidor final" for B2C under EUR 1,000 | |
| 109 | | Buyer name and address | Required when NIF is provided | |
| 110 | | Invoice number | Sequential, unique within the series (format: TypeCode SeriesID/SequentialNumber) | |
| 111 | | Invoice date | Date of issuance | |
| 112 | | ATCUD | Unique document code (ValidationCode-SequentialNumber) | |
| 113 | | QR code | 2D barcode encoding invoice data per Portaria 195/2020 | |
| 114 | | Hash (4 characters) | First 4 characters of the RSA signature hash | |
| 115 | | Certified software number | AT certification number of the invoicing program | |
| 116 | | Tax point date | Date of supply of goods/services | |
| 117 | | Description of goods/services | Line-level detail | |
| 118 | | Quantity and unit price | Per line item | |
| 119 | | VAT rate and amount | Per applicable rate, per fiscal space (PT, PT-AC, PT-MA) | |
| 120 | | Total taxable amount | Sum of all line items before VAT | |
| 121 | | Total VAT amount | Sum of VAT across all rates | |
| 122 | | Total gross amount | Including VAT | |
| 123 | | Currency | EUR for domestic; foreign currency with EUR exchange rate for cross-border | |
| 124 | | Payment terms/method | If applicable | |
| 125 | |
| 126 | ### Additional B2G Fields (CIUS-PT / Peppol BIS 3.0) |
| 127 | |
| 128 | | Field | Path (UBL 2.1) | |
| 129 | |---|---| |
| 130 | | Buyer reference | `cbc:BuyerReference` | |
| 131 | | Contract reference | `cac:ContractDocumentReference/cbc:ID` | |
| 132 | | Order reference | `cac:OrderReference/cbc:ID` | |
| 133 | | CIUS-PT CustomizationID | `cbc:CustomizationID` = `urn:cen.eu:en16931:2017#compliant#urn:feap.gov.pt:CIUS-PT:2.1.1` | |
| 134 | | Profile ID | `cbc:ProfileID` = `urn:fdc:peppol.eu:2017:poacc:billing:01:1.0` | |
| 135 | | Endpoint ID (Peppol) | `cbc:EndpointID` with scheme identifier | |
| 136 | |
| 137 | --- |
| 138 | |
| 139 | ## Section 5 -- Transmission Method |
| 140 | |
| 141 | ### SAF-T Billing Submission (B2B/B2C) |
| 142 | |
| 143 | | Channel | Detail | |
| 144 | |---|---| |
| 145 | | e-Fatura web service | SOAP/REST API for automated submission | |
| 146 | | Command-line tool | AT-provided CLI for batch upload | |
| 147 | | Portal das Finanças | Manual file upload (XML) | |
| 148 | | Direct entry | Low-volume issuers can enter invoice data manually on the portal | |
| 149 | | Deadline | By the 5th calendar day of the month following the reporting period | |
| 150 | | Authentication | Digital certificate (qualified or AT-issued) | |
| 151 | |
| 152 | ### B2G E-Invoice Transmission |
| 153 | |
| 154 | | Channel | Detail | |
| 155 | |---|---| |
| 156 | | Peppol network | Via certified Peppol Access Point | |
| 157 | | Format | Peppol BIS Billing 3.0 (UBL 2.1 XML) with CIUS-PT | |
| 158 | | Endpoint | Buyer's Peppol endpoint registered in SMP | |
| 159 | | Authentication | Peppol PKI certificates | |
| 160 | |
| 161 | ### Series Registration |
| 162 | |
| 163 | Before issuing invoices, each document series must be registered with AT via the Portal das Finanças to obtain the validation code used in ATCUD generation. |
| 164 | |
| 165 | --- |
| 166 | |
| 167 | ## Section 6 -- Validation Rules |
| 168 | |
| 169 | ### AT-Side Validation (SAF-T) |
| 170 | |
| 171 | - Schema validation against the current SAF-T (PT) XSD |
| 172 | - Cross-checks: ATCUD uniqueness, hash chain integrity, NIF validation against AT registry |
| 173 | - Tax table consistency: VAT rates must match the rates in force for the fiscal space |
| 174 | - Sequential numbering: gaps or duplicates within a series trigger warnings |
| 175 | - Document type alignment: invoice types must match SAF-T table codes (4.1 SalesInvoices, 4.2 MovementOfGoods, etc.) |
| 176 | |
| 177 | ### Pre-Submission Checks |
| 178 | |
| 179 | - Verify ATCUD is present and correctly formatted (ValidationCode-SequentialNumber) |
| 180 | - Verify QR code data matches invoice data fields |
| 181 | - Verify RSA hash chain is unbroken (each invoice references the previous hash) |
| 182 | - Verify certified software number is valid and matches AT registry |
| 183 | - Verify all mandatory fields are populated |
| 184 | |
| 185 | ### Common Rejection Reasons |
| 186 | |
| 187 | | Reason | Detail | |
| 188 | |---|---| |
| 189 | | Invalid ATCUD | Validation code not registered with AT for the series | |
| 190 | | Broken hash chain | Hash does not reference correct predecessor invoice | |
| 191 | | Invalid NIF | Supplier or buyer NIF fails check-digit validation | |
| 192 | | Rate mismatch | VAT rate does not match current legal rate for the goods/services category | |
| 193 | | Missing fields | Omitted mandatory fields in SAF-T XML | |
| 194 | | Schema non-compliance | XML does not conform to the current SAF-T (PT) XSD version | |
| 195 | | Duplicate submission | Same invoice already reported in a prior period | |
| 196 | |
| 197 | --- |
| 198 | |
| 199 | ## Section 7 -- Tax Computation Rules |
| 200 | |
| 201 | ### VAT Rates (2026) |
| 202 | |
| 203 | | Rate | Percentage (Mainland PT) | PT-Açores | PT-Madeira | |
| 204 | |---|---|---|---| |
| 205 | | Standard | 23% | 16% | 22% | |
| 206 | | Intermediate | 13% | 9% | 12% | |
| 207 | | Reduced | 6% | 4% | 5% | |
| 208 | | Exempt | 0% | 0% | 0% | |
| 209 | |
| 210 | ### Rounding Rules |
| 211 | |
| 212 | - VAT amounts are calculated per line and rounded to 2 decimal places (EUR cent). |
| 213 | - Totals are the sum of rounded line amounts -- do NOT re-round the total. |
| 214 | - SAF-T requires separate tax base and tax amount per rate and per fiscal space. |
| 215 | |
| 216 | ### Multi-Rate Invoice Handling |
| 217 | |
| 218 | Each VAT rate and fiscal space must appear as a separate tax subtotal in both the invoice and the SAF-T XML. The QR code fields I1-K8 encode up to 8 rate/space combinations. |
| 219 | |
| 220 | ### Withholding Tax |
| 221 | |
| 222 | If applicable (e.g., professional services), withholding tax must be shown separately. The QR code includes a dedicated field for withholding tax amount. |
| 223 | |
| 224 | --- |
| 225 | |
| 226 | ## Section 8 -- Archiving Requirements |
| 227 | |
| 228 | | Requirement | Detail | |
| 229 | |---|---| |
| 230 | | Retention period | 10 years from the end of the fiscal year | |
| 231 | | Format | Original format of issuance; electronic records must remain machine-readable | |
| 232 | | Accessibility | Uninterrupted access throughout the retention period, even through system migrations | |
| 233 | | SAF-T on demand | SAF-T files (Billing and Accounting) must be producible on demand for tax inspections at any time during the 10-year period | |
| 234 | | Integrity | Hash chain and digital signatures must remain verifiable | |
| 235 | | Location | May be stored outside Portugal within the EU, provided AT is notified and real-time access is guaranteed | |
| 236 | | QES archive | From 2027, PDF invoices with QES must be archived with the signature intact and verifiable | |
| 237 | |
| 238 | --- |
| 239 | |
| 240 | ## Section 9 -- Penalties for Non-Compliance |
| 241 | |
| 242 | | Violation | Individuals (EUR) | Legal Persons (EUR) | |
| 243 | |---|---|---| |
| 244 | | Non-issuance or late issuance of invoices | 150 -- 3,750 | 300 -- 7,500 | |
| 245 | | Use of non-certified invoicing software | 3,000 -- 18,750 | 3,000 -- 18,750 | |
| 246 | | Missing QR code or ATCUD on invoices | 200 -- 1,000 per invoice | 200 -- 1,000 per invoice | |
| 247 | | Improper invoicing (invalid hash, missing certified software number) | 150 -- 3,750 | 150 -- 3,750 | |
| 248 | | Late or incomplete SAF-T Billing submission | Graduated fines under RGIT | Graduated fines under RGIT | |
| 249 | | Failure to submit SAF-T | Up to 5,000 | Up to 5,000 | |
| 250 | | Accounting record delays (over 90 days) | Up to 5,000 | Up to 5,000 | |
| 251 | |
| 252 | Penalties are doubled for intentional or fraudulent infractions under RGIT. Per-invoice penalties (ATCUD/QR) accumulate rapidly for high-volume issuers. |
| 253 | |
| 254 | B2G suppliers face additional risk of procurement disqualification for non-compliance with CIUS-PT requirements. |
| 255 | |
| 256 | --- |
| 257 | |
| 258 | ## Section 10 -- Interaction with Tax Skills |
| 259 | |
| 260 | ### SAF-T Billing → VAT Return |
| 261 | |
| 262 | Monthly SAF-T Billing data feeds directly into the VAT return (Declaração Periódica de IVA). AT pre-populates VAT return fields from SAF-T submissions. Discrepancies between the SAF-T data and the VAT return trigger automatic flags. |
| 263 | |
| 264 | ### e-Fatura Consumer Deductions |
| 265 | |
| 266 | Invoices reported via SAF-T Billing appear on the consumer's e-Fatura profile. Consumers use this data to claim personal income tax deductions (e.g., health, education, general family expenses). Incorrect or missing data affects consumer tax benefits. |
| 267 | |
| 268 | ### SAF-T Accounting → IES/DA Annual Filing |
| 269 | |
| 270 | From 2028 (FY 2027), the SAF-T Accounting file must be submitted and validated by AT before the IES/DA (Informação Empresarial Simplificada / Declaração Anual) can be filed. AT validation should occur within 10 days of submission. |
| 271 | |
| 272 | ### Corporate Tax (IRC) and Personal Income Tax (IRS) |
| 273 | |
| 274 | Invoice data from SAF-T underpins deduction claims and revenue verification for both corporate (IRC) and personal (IRS) income tax returns. AT cross-references invoice data against declared income. |
| 275 | |
| 276 | ### Provisional Tax and Withholding |
| 277 | |
| 278 | Withholding tax data reported on invoices flows into the annual withholding tax reconciliation. The QR code field for withholding enables AT to cross-check against employer/payer declarations. |
| 279 | |
| 280 | --- |
| 281 | |
| 282 | ## Disclaimer |
| 283 | |
| 284 | This skill and its outputs are provided for informational and computational purposes only and do not constitute tax, legal, or financial advice. Open Accountants and its contributors accept no liability for any errors, omissions, or outcomes arising from the use of this skill. All outputs must be reviewed and signed off by a qualified professional (such as a CPA, tax attorney, or equivalent licensed practitioner in your jurisdiction) before filing or acting upon. |
| 285 | |
| 286 | The most up-to-date, verified version of this skill is maintained at [openaccountants.com](https://openaccountants.com). |
| 287 |
Run this skill, then get an accountant to check it
After running the full skill pack in your AI agent, sign up and upload your worksheet. We'll connect you with a trusted accountant in our network who can review your numbers before you file.
Verification status
Research-verified
Drafted from authoritative sources (tax authority sites, Big-4 summaries). Awaiting credentialed sign-off.
Needs section-by-section practitioner review to reach accountant-verified.
Section review progress
About
Use this skill whenever asked about e-invoicing in Portugal, ATCUD codes, SAF-T PT reporting, QR code requirements on invoices, certified billing software (Modelo 24), e-Fatura portal, Qualified Electronic Signature (QES) for invoices, CIUS-PT, B2G e-invoicing via Peppol, or any question about issuing, transmitting, validating, or archiving electronic invoices under Portuguese law. Trigger on phrases like "ATCUD", "SAF-T Portugal", "e-Fatura", "QR code invoice", "certified software AT", "Peppol Portugal", "B2G e-invoice", "invoice hash chain", "Portaria 363/2010", "Decreto-Lei 28/2019", or "Qualified Electronic Signature Portugal". ALWAYS read this skill before touching any Portugal invoicing compliance work.
Use this skill
This skill is open source and free to use in any AI agent. Copy it, download it, or clone the repo. If you find an error, report an issue — a licensed accountant will review.