Introduction
Invopop, as a certified provider in Portugal, allows you to issue fully-compliant tax documents and report them to the Autoridade Tributária e Aduaneira (AT). Using the AT Portugal app, you can generate PDFs with the correct signatures, ATCUD and QR codes for all your documents (invoices, transport documents, payments, etc.). Also, you can report them to the AT either in batch, via periodic SAF-T PT reports, or in real-time, using the AT web services. This guide will walk you through the process of issuing invoices, delivery documents, and payments in a supplier’s name, cancelling them if needed, and reporting them to the AT.Prerequisites
To issue invoices and other documents in Portugal, you will need:- A registered supplier: follow the AT supplier registration guide to connect the AT Portugal app, register the supplier, and register their document series before issuing.
- Document details:
- Line items with quantity, price, description
- Applicable VAT rates
- Any other details required for the specific document type
Setup
Prepare the processing and cancel workflows for the document types you plan to issue: invoices, deliveries, and payments.Prepare the invoice processing workflow
- Template
- Code
- Build from scratch
AT issue invoice workflow
Prepare the invoice cancel workflow
- Template
- Code
- Build from scratch
AT cancel invoice workflow
Prepare the delivery processing workflow
- Template
- Code
- Build from scratch
AT issue delivery workflow
Prepare the delivery cancel workflow
- Template
- Code
- Build from scratch
AT cancel delivery workflow
Prepare the payment processing workflow
- Template
- Code
- Build from scratch
AT issue payment workflow
Prepare the payment cancel workflow
- Template
- Code
- Build from scratch
AT cancel payment workflow
Running
In this section, we’ll provide details on how to issue AT invoices and other documents on behalf of a registered supplier, cancel them, and report them to the AT.Send a document
The following examples show partial GOBL documents you can copy and paste directly into the Invopop Console or store via the API as silo entries. After uploading, you must run the corresponding processing workflow (invoice, delivery, or payment) created during setup.code property) is assigned automatically by the Record document for SAF-T step — do not add a sequence step. See Series management in the supplier registration guide for naming rules, sequence assignment, and series types.AT B2B invoice
AT B2B invoice
- the minimal version in the first tab contains only the essential fields required to create the invoice, without totals or calculations,
- the
pt-saft-v1addon ensures the document will be validated and normalized using the SAF-T PT v1 rules built into the GOBL library, - the
supplierandseriesfields are set to example values; you’ll need to replace them with the details of supplier and series registered as per the previous sections. The series must be registered in the Supplier Portal and follow Portuguese naming conventions (see Series management for details), - when running
gobl build, or uploading the file, the system automatically calculates totals, assigns thept-saft-invoice-typeextension toFT(Fatura), sets thept-saft-payment-meansextension toCCfor card payment, and applies thept-saft-tax-rateextension toNORfor standard VAT, - the built version in the second tab shows the normalized document with calculated totals, line item sums (including advance payment deductions), tax breakdowns, and automatically generated fields, and,
- the
hitem unit causes thept-saft-product-typeextension to be set toS(Serviço), and thept-regionextension is automatically set toPT.
AT invoice with IRS withholding
AT invoice with IRS withholding
- the minimal version in the first tab contains only the essential fields; the line carries a second tax on top of
VAT: anIRScombo withpercentset to25%and norate, - the document-level
tax.notesentry withcat: "IRS"carries the legal basis for the withholding (here Art. 101.º CIRS); the SAF-T export surfaces it as theWithholdingTaxType(IRS) andWithholdingTaxDescriptionof theWithholdingTaxblock, and, - in the built version the
IRStax becomes its ownretainedcategory intotals.taxes, separate fromVAT, withretained: "250.00"(25% of the 1000,00 base).
AT Cash VAT invoice
AT Cash VAT invoice
- the only difference from the standard AT B2B invoice above is the
cash-vattag ($tags: ["cash-vat"]), which flags the supplier’s membership in the scheme, - the
pt-saft-v1addon reacts to that tag by setting thept-saft-cash-vatextension to1in the invoice’staxsection, and, - the document is otherwise a normal
standardinvoice: thept-saft-invoice-typeextension is still set toFT(Fatura) and the standard VAT rate still maps to thept-saft-tax-rateextensionNOR.
AT simplified invoice
AT simplified invoice
- the document carries the
simplifiedtag ($tags: ["simplified"]) and omits thecustomerentirely, - the
pt-saft-v1addon reacts to the tag by setting thept-saft-invoice-typeextension toFS(Fatura Simplificada), and theseriesfollows the matchingFSprefix convention, - if the document also records full payment (for example, a 100% advance), the addon derives the type
FR(Fatura-Recibo) instead, and the series must then use theFRprefix, and, - as with the other examples, totals and tax breakdowns are calculated automatically when running
gobl buildor uploading.
AT delivery note
AT delivery note
- the first tab shows the minimal version containing only the essential fields required to create the delivery document; there are no totals or calculations,
- the
pt-saft-v1addon ensures the document will be validated and normalized using the SAF-T PT v1 rules built into the GOBL library, - the
supplierandseriesfields are set to example values; you’ll need to replace them with the details of supplier and series registered as per the previous sections. The series must be registered in the Supplier Portal and follow Portuguese naming conventions (see Series management for details), - this is a
notedocument type with thept-saft-movement-typeextension set toGR(Guia de Remessa), - when running
gobl build, or uploading the document, the system automatically calculates totals, applies the standard VAT rate with thept-saft-tax-rateextension set toNOR, and normalizes all fields, - the second tab shows the built version of the document with the calculated totals, line item sums, tax breakdowns, and automatically generated fields, and,
- the
pt-regionextension is automatically set toPT.
AT return guide
AT return guide
- the document carries the
returntag ($tags: ["return"]), which thept-saft-v1addon uses to automatically set thept-saft-movement-typeextension toGD(Guia de Devolução), - the
seriesfollows theGDprefix convention and must be registered through the Supplier Portal, and, - the flow of goods is reversed compared to a delivery note: the
customeris the party returning the goods, and thesupplieris the one receiving them back.
AT global waybill
AT global waybill
- the document
typeis set towaybill, which thept-saft-v1addon normalizes to thept-saft-movement-typeextensionGT(Guia de Transporte), - the
seriesfollows theGTprefix convention required by the AT and must be registered through the Supplier Portal, and, - the
customerfield is omitted: when no customer is provided on aGT, the SAF-T submission auto-fills the AT-prescribed generic entry Consumidor final with NIF999999990and address Desconhecido.
AT delivery from global waybill
AT delivery from global waybill
GR (Guia de Remessa) — must be issued with the full transaction details, including the customer and a cross-reference back to the originating GT so the AT can correlate both records.Notice:- the
customeris now populated with the actual recipient of the goods, and, - the
precedingarray carries one entry with theseries,code, andissue_dateof the originatingGT.
AT return from global waybill
AT return from global waybill
- as in the standalone return guide, the
returntag drives thept-saft-movement-typeextension toGD, - the
precedingarray references the originatingGT, and, - the
customeris omitted, since the goods are returning to the issuer’s own depot rather than to a specific party.
AT payment receipt
AT payment receipt
- the minimal version in the first tab contains only the essential fields required to create the payment document,
- the
pt-saft-v1addon ensures the document will be validated and normalized using the SAF-T PT v1 rules built into the GOBL library, - the
supplierandseriesfields are set to example values; you’ll need to replace them with the details of supplier and series registered as per the previous sections. The series must be registered in the Supplier Portal and follow Portuguese naming conventions (see Series management for details), - this is a single
receiptpayment that bundles multiple payment methods: 30,00 EUR in cash plus 31,50 EUR by card, summing to the document total of 61,50 EUR. Each method gets its ownpt-saft-payment-meansextension auto-assigned (NUfor cash,CCfor card), - when running
gobl build, the system automatically assigns thept-saft-payment-typeextension toRGand thept-saft-sourceextension toP, - the built version in the second tab shows the normalized document with all automatically generated fields and extensions properly set,
- the payment lines reference the original invoice being paid, though a single receipt can reference multiple invoices if needed,
- this receipt could represent either a full or partial payment of the referenced invoice; it simply records the amounts and taxes being paid, so the total may or may not cover the full invoice amount, and,
- there are no calculations in the minimal version; all normalizations will be made automatically when uploading.
AT Cash VAT receipt
AT Cash VAT receipt
- the document carries the
cash-vattag ($tags: ["cash-vat"]), exactly as the Cash VAT invoice does, - on a
receipt, that tag drives thept-saft-payment-typeextension toRC(Recibo no âmbito do regime de IVA de Caixa) instead of the defaultRG(Outro Recibo) you’d get on the ordinary AT payment receipt above, - the
seriesfollows theRCprefix convention and must be registered through the Supplier Portal, - the payment line references the original invoice being settled, carrying its VAT breakdown so the AT can match the now-due tax to the issued invoice, and,
- as with any receipt, the
pt-saft-payment-meansextension is auto-assigned per method (TBfor the bank transfer) and thept-saft-sourceextension is set toP.
Cancel a document
If you need to cancel a document that has already been issued and reported to the AT, you can use the cancel workflows created during setup. The cancellation process follows the same pattern as sending a document: create a job for the silo entry you want to cancel using the cancel workflow appropriate for the document type.Recovering documents issued offline
If you lose the connection to Invopop and cannot issue documents through your regular workflow, Portuguese law defines exactly what to do. Despacho n.º 8632/2014, section 2.4, regulates the issuance of documents during a period of software unavailability (inoperacionalidade do programa) and their later integration into the certified invoicing system.While offline: issue on paper
During the outage, documents must be issued manually on pre-printed paper forms acquired from an AT-authorized typography (tipografia autorizada). These paper documents:- Carry their own series and sequential numbering, pre-printed by the typography.
- Include a pre-printed ATCUD: the typography registers the series with the AT and obtains the validation code on your behalf.
- Do not require a QR code: the QR code obligation only applies to documents issued by certified software.
Once back online: recover the documents
Immediately after the connection is restored, each paper document must be re-entered (“recovered”) through Invopop so it becomes part of the certified record and gets reported to the AT:-
Register a recovery series (type
R), either through the Supplier Portal or the series registration endpoint. You can do this ahead of time as part of your contingency setup. Documents recovered from paper can only be issued under a recovery series. -
Create a GOBL document replicating the paper document exactly — same line items, taxes, and totals — with these specifics:
- The
issue_datemust be the date of the original paper document. - The
$tagsarray must includebypass, so the totals are taken verbatim from the paper document instead of being recalculated. - The
pt-saft-sourceextension must be set toM(manual). - The
pt-saft-source-refextension must reference the paper document using the format defined in section 2.4.5 of the despacho: the document type code followed by the letterM, a space, and the paper document’s series and number separated by a slash.
This partial example shows only the recovery-specific fields. Complete the document with the supplier, customer, lines, and totals copied from the paper document. - The
-
Run your regular invoice workflow on the document. The recovered document is sealed like any other software-issued document — it receives a hash, an ATCUD from the recovery series, and a QR code — and is reported to the AT through the usual channels (real-time webservice and/or SAF-T PT). The reference to the paper document is included in the SAF-T
HashControlfield, as required by the despacho.
- Each paper document can be recovered only once. Attempting to recover the same source reference twice is rejected.
- Any later document referencing a recovered one (e.g., a credit note rectifying it) must reference the original paper document’s series and number, not the number assigned to the recovered document.
pt-saft-source-ref extension uses the letter D instead of M (e.g., FTD FT SERIES/123), and the original series is automatically decommissioned once the first document is recovered, as the law requires it to be closed.Reporting documents to the AT
The AT Portugal app supports two methods for reporting documents to the Autoridade Tributária e Aduaneira:- Real-time reporting - Documents are submitted individually to the AT immediately upon issuance via webservice
- SAF-T PT reporting - Documents are reported in batch format through periodic SAF-T PT reports
Real-time reporting
The Send document to AT step uses the AT’s webservice to submit each document to the tax authority immediately after it is recorded. This step is optional. If you prefer to report documents only via SAF-T PT reports, you can remove it from your workflows.WFA for invoices, WDT for transport documents) as described in the supplier registration guide.SAF-T PT reporting
SAF-T PT reports allow you to submit documents to the AT in batch format. The Record document for SAF-T step takes care of recording the documents for this purpose.- Go to the Invopop AT Portugal Supplier Portal
- Log in using the email address provided with the supplier’s information
- Go to the SAF-T PT section, enter a date range and click Generate
FAQ
Should our customers upload their SAF-T files manually?
Should our customers upload their SAF-T files manually?
- SAF-T monthly export – a single XML file including all documents for the month. This file is generated by the invoicing software and then uploaded manually to the AT portal, as there is no API available for submitting it automatically.
- Real-time transmission – instead of a monthly file, each invoice is sent individually to the AT at the time of issuance, using the authority’s API.
How do I configure my workspace for Portuguese invoicing?
How do I configure my workspace for Portuguese invoicing?
Why does recording fail with 'payable: too high according to Artigo 40.º do CIVA'?
Why does recording fail with 'payable: too high according to Artigo 40.º do CIVA'?
recording envelope: totals: (payable: too high according to Artigo 40.º do CIVA.)
What it means: Article 40 of the Portuguese VAT Code (Código do IVA) sets limits and rules for simplified invoices (faturas simplificadas). If the payable amount exceeds what is allowed for a simplified invoice in your situation, the rules effectively require a full invoice (fatura completa) with proper buyer identification—not an anonymous or minimal customer.What to do:- Treat the document as a full invoice and supply real customer tax data when you have it.
- If you do not have the buyer’s tax information, Portuguese practice allows the generic retail customer: set the customer name to
Consumidor finaland the tax ID to999999990. - For transactions above €1,000, the law also expects name and address on the document. The AT may not always reject submissions that omit some of that detail, but you should follow the rule for full compliance.
Why does my payment workflow fail with 'payment type RG is not supported for real-time reporting'?
Why does my payment workflow fail with 'payment type RG is not supported for real-time reporting'?
What payment receipt types are supported in Portugal?
What payment receipt types are supported in Portugal?
- RG — Outros Recibos: Standard payment receipts, reported through the monthly SAF-T file only. Real-time reporting is not available for this type.
- RC — Recibo no âmbito do regime de IVA de Caixa: Receipts specific to the VAT Cash accounting regime. RC payments are not currently supported by the AT Portugal app.
Where do I find Portugal-specific GOBL documentation?
Where do I find Portugal-specific GOBL documentation?
pt-saft-v1 addon documents fields required by the SAF-T schema.🇵🇹 Invopop resources for Portugal
🇵🇹 Invopop resources for Portugal