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 registering a supplier, issuing invoices in their name, and generating a SAF-T PT report.Prerequisites
To issue invoices and other documents in Portugal, you will need:- Supplier details, including:
- Legal business name
- Tax ID
- Business address
- An email address for the supplier to access the Supplier Portal
- The supplier’s credentials to access the AT’s web services for registering series and report documents in real-time
- Document details:
- Line items with quantity, price, description
- Applicable VAT rates
- Any other details required for the specific document type
Setup
There are four key processes to prepare:- create a supplier post-registration workflow,
- connect the AT Portugal app,
- configure a supplier registration workflow, and,
- prepare a document processing workflow.
1
Connect the AT Portugal App
- Navigate to Configuration → Apps.
- Find AT Portugal in the app discovery list.
- Click Connect to activate.
2
Create Supplier post-registration workflow
3
Configure the AT Portugal App
- Navigate to Configuration → Apps.
- Find AT Portugal in the connected apps list.
- Click Configure and choose the “Post-registration workflow” we created in the previous step.
- Click the Save button.
4
Configure the supplier registration workflow
- Template
- Code
- Build from scratch
5
Prepare the invoice processing workflow
You can skip this step if you don’t plan to issue invoices.
- Template
- Code
- Build from scratch
6
Prepare the delivery processing workflow
You can skip this step if you don’t plan to issue delivery documents.
- Template
- Code
- Build from scratch
7
Prepare the payment processing workflow
You can skip this step if you don’t plan to issue payments.
- Template
- Code
- Build from scratch
Running
In this section, we’ll provide details on how to first persist and register a supplier, followed by issuing AT invoices and other documents on their behalf.The recommended approach for running jobs is to perform two steps: first upload the document to the silo, then create a job.
Register a Supplier
1
Submit the Supplier Information
This can be done either manually via the Invopop Console or programmatically via the API. The process is essentially the same; here we’ll do it manually.Find the Parties section of the sidebar and click Suppliers. Click the + New Supplier button to be presented with a new editor. You can use the following example as a template, and replace it with the details of your company. Note that you’ll need the details of a real company both in the sandbox and production environments:Click Build, ensure there are no errors, and click Save.We should now see the document. Find and click the Select Workflow button. Select the Register Supplier workflow created during setup, and click Run Workflow.The execution should be successful, and the silo entry will now be in the “Processing” state.
Portugal AT supplier example
2
Obtain the Supplier's AT Credentials
To complete the registration process, the supplier will need to obtain the credentials of a user with the necessary permissions in the AT’s Portal das Finanças. To create a new user, the supplier can follow these steps:
- Go to the AT’s Portal das Finanças and click on the Iniciar Sessão button.
- Authenticate by any of the available methods.
- Go to Todos os Serviços > Autenticação de Contribuintes > Gestão de Utilizadores.
- Click on the Criar Novo Utilizador button.
- Fill in the form with the required information. We recommend setting a name that identifies the purpose of the user, for example “Invopop User”.
- Select the user permissions, depending on the supplier needs:
WSE– Always required. It allows to register series for any document type.WSA– Required if the supplier wants to submit invoices to the AT in real-time, rather than using SAF-T.WDT– Required if the supplier wants to submit transport documents (e.g. “Guia de Remessa”, “Guia de Transporte”, etc.) to the AT in real-time, rather than using SAF-T.
- Click on the Submeter button to create the user.
- Store the username and password in a secure location, as they will be needed in the next step.
3
Provide the Supplier's AT Credentials and Register Series
Now, the supplier will need to complete the registration process in the Invopop’s Supplier Portal:
- Go to the Invopop AT Portugal Supplier Portal
- Enter the email address provided in the supplier’s information. The system will send to the provided address a code to complete the authentication process.
- Once logged in, go to Credentials, enter the AT credentials obtained in the previous step, and press Save.
- Go to the Series section, click + Register and register at least a series for each document type that the supplier will issue.
For detailed information about series management in Portugal, including naming conventions and automatic sequence assignment, see the Series Management section below.
Series Management
Series management in Portugal has specific requirements that differ from other countries. Understanding these particularities is essential for proper document issuance.Naming
All series names in Portugal must follow a specific format:- Document type prefix: The name must start with a code indicating the document type (e.g.,
FT,FS,FR,NC…), followed by a space. - Base name: After the space, you can add any custom name you prefer. The custom name can contain letters, numbers, and most special characters, but not spaces, forward slashes (
/), or carets (^).
FT A001, NC 2024-01, FR INV-2024
When you register series through the Supplier Portal, you’re asked to provide a base name (without the document prefix) and select the document types you plan to issue. The portal combines each selected prefix with the base name, registers every resulting series with the AT, and retrieves the corresponding validation code required for generating ATCUD codes.
Sequence Assignment
Unlike other countries, Portugal regulations do not allow pre-assigning sequence numbers to documents. The sequence number (i.e., the document’scode property) is automatically assigned during the Seal for the AT (Portugal) step in your workflow, following AT regulations. This is why you’ll find no sequence step in Portugal workflow templates and you should not add one.
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.- Invoice
- Delivery
- Payment
In this example, we’re issuing a simple invoice from a Portuguese supplier to another Portuguese business.Notice:
AT B2B Invoice
- we’ve added the
pt-saft-v1addon; this 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
standardinvoice and the advance payments don’t cover the total amount of the invoice; so, GOBL will automatically assign thept-saft-invoice-typeextension toFT(Fatura), - the
cardpayment method will cause the addon to set thept-saft-payment-meansextension toCC(Cartão crédito), - the
hitem unit will cause thept-saft-product-typeextension to be set toS(Serviço), - the
standardVAT rate will cause thept-saft-tax-rateextension to be set toNOR(Normal), - the
pt-regionextension will automatically be set to the default value ofPT, and - there are no totals or calculations; all these will be made automatically when uploading.
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 to the AT (Portugal) step uses the AT’s webservice to submit each document to the tax authority immediately after it is sealed and recorded. This step is optional. If you prefer to report documents only via SAF-T PT reports, you can remove it from your workflows.The Send to the AT (Portugal) step requires the supplier to have the appropriate AT user permissions (
WSA for invoices, WDT for transport documents) as described in the “Obtain the Supplier’s AT Credentials” section above.SAF-T PT Reporting
SAF-T PT reports allow you to submit documents to the AT in batch format. The Record for SAF-T reporting (Portugal) step takes care of recording the documents for this purpose.The Record for SAF-T reporting (Portugal) step is required in all workflows, regardless of whether you also use real-time reporting. The AT may request SAF-T PT reports for audit purposes at any time, so all documents must be properly recorded.
- 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