Issue documents in Portugal using Invopop’s certified implementation.
We are currently in the process of certifying our direct integration with the Portuguese Tax Authority (AT). As a result, the AT implementation —described in this guide— is not yet available for use.
In the meantime, if you need to issue documents in Portugal, you can use our fully functional integration via InvoiceXpress.
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.
To issue invoices and other documents in Portugal, you will need:
There are four key processes to prepare:
All of the following steps must be carried out from the Invopop Console.
Create Supplier post-registration workflow
Copy and paste into a new Empty Party workflow code view.
Before starting, review the workflows guide to understand the general setup process.
In Console, create a new workflow and choose Empty Party workflow as the base. Then name the workflow with a descriptive label such as “PT-AT Post-registration workflow”.
This worfkow is composed by a single step:
Registered
.Though you can customize it to suit your needs (adding a webhook, or an email notification after a supplier has been registered.)
Connect the AT Portugal App
Click the Configure button on the app, and choose the “Post-registration workflow” we created in the previous step.
Click the Save button.
Configure the supplier registration workflow
Copy and paste into a new Empty Party workflow code view.
Before starting, review the workflows guide to understand the general setup process.
In Console, create a new workflow and choose Empty Party workflow as the base. Then name the workflow with a descriptive label such as “AT supplier registration”.
The new workflow will need to perform three steps:
processing
.Finally, in the Error Handling area, add the Set State action and select Error
.
Add any additional steps you may need, and save the new workflow.
Prepare the document processing workflow
Copy and paste into a new Empty Invoice workflow code view.
Before starting, review the workflows guide to understand the general setup process.
In Console, create a new workflow and choose Empty Invoice workflow as the base. Then name the workflow with a descriptive label such as “AT issue invoice”.
The new workflow will need to perform these steps:
Optionally, if you want to submit each document individually to the AT in real-time, you can add a “Send to the AT (Portugal)” step right after recording the document for SAF-T.
Finally, in the Error Handling area, add the Set State action and select Error
.
Add any additional steps you may need, and save the new workflow.
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.
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 Contacts 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:
Supplier example
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.
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:
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.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:
Once the series are registered, the supplier will be able to issue documents using them. When this happens, the system will automatically execute the “Post-registration workflow” if one was configured.
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 “Issue AT document” workflow created during setup.
GOBL Invoices reported to the AT require the following properties to perform the correct normalization and validation steps. Invopop will try to assign these automatically, but we recommend defining them explicitly before uploading:
$region
to be set to PT
$addons
to include pt-saft-v1
B2B Invoice
In this example, we’re issuing a simple invoice from a Portuguese supplier to another Portuguese business.
Notice:
pt-saft-v1
addon; this ensures the document will be validated and normalized using the SAF-T PT v1 rules built into the GOBL library,supplier
and series
fields are set to example values; you’ll need to replace them with the details of supplier and series registered as per the previous sections,standard
invoice and the advance payments don’t cover the total amount of the invoice; so, GOBL will automatically assign the pt-saft-invoice-type
extension to FT
(Fatura),card
payment method will cause the addon to set the pt-saft-payment-means
extension to CC
(Cartão crédito),h
item unit will cause the pt-saft-product-type
extension to be set to S
(Serviço),standard
VAT rate will cause the pt-saft-tax-rate
extension to be set to NOR
(Normal),pt-region
extension will automatically be set to the default value of PT
, andOnce documents have been issued, Suppliers can generate SAF-T PT reports via the Supplier Portal: