How to generate the billing SAF-T file
What is it for?
The billing SAF-T file brings together, in one XML file, a month's sales documents and receipts, as well as the delivery notes and working documents (quotes, orders, pro formas) issued that month, with the customers and products they use. This is the file submitted to the Tax and Customs Authority (AT) in the monthly invoicing communication.
Generating is not submitting: this article creates the file and checks that it is valid. Submitting is the next step.
When to use it?
- At the start of each month, for the previous month's file.
- After fixing the errors of a file that came out Invalid.
- When your certified accountant or the AT asks for a month's file.
Where to find it?
Accounting › Declare › SAF-T file › Generate SAF-T
The administrator finds the same in Settings › fiscaldoo · Certification, in the Configure the certification: SAF-T group, line Generate SAF-T (PT).
Before you start
- Your profile is Certified Accountant / Fiscal Manager with Fiscal officer. All the steps were done with this profile, up to downloading the file.
- With the Accountant profile you can generate and download the file (steps 1 to 7), but the record does not show Record submission: submitting is left to someone with Fiscal officer. The Billing profile does not have the Accounting app.
- The month's documents have been issued. A draft is not included in the file.
- You are working in the right company: the file belongs to one company (the window's Company field).
How to use it
- Open Accounting › Declare › SAF-T file › Generate SAF-T. The Generate SAF-T (PT) window opens, in three steps.
- In STEP 1 OF 3: PERIOD, check that the Mode is F — Invoicing: the window already opens this way. Do not change it to C — Accounting, which is a different file. The other options are I — Integrated accounting/invoicing and S — Self-billing.
- In Period, leave Month (the other options are Quarter, Fiscal Year and Custom range).
- Check the dates. The window opens on the previous month, with the Reference date on the 1st of that month. In the example, on 31/10/2026: Reference date
01/09/2026, Date From01/09/2026and Date To30/09/2026. For another month, type a day of that month in Reference date: with15/08/2026, the dates change to01/08/2026and31/08/2026. - Read STEP 2 OF 3: CHECKS. With the month still open, the screen warns: “The period is still open (lock date: 31/12/2025): entries up to 30/09/2026 can still change after this file is generated. Lock the period when it is final.” The warning does not stop you from generating, and the window does not lock the period.
- In STEP 3 OF 3: GENERATE THE FILE, the line “… documents in this period will go into the file.” says how many documents the file will contain, and the line below says how many there are of each type. The button shows the same number. For September, in the demo, the window says “3 documents in this period will go into the file.” and, below, “3 sales documents (invoices and credit notes)”. In a month with delivery notes, such as October, the window says “14 documents in this period will go into the file.” and, below, “9 sales documents (invoices and credit notes), 4 transport guides, 1 working documents (quotes, orders, pro formas)”, and the downloaded file had those 14 documents. If the month has draft documents, the window adds a line with how many there are and their value, because they are not included in the file: in October, with a draft invoice dated 01/10/2026, “These documents of the period are NOT in the file: 1 draft sales documents (a draft is not a document yet): €104.55.” If the draft is a sale that should be included, close the window, issue the invoice (How to issue a certified invoice) and go back to step 1; if not, delete it or leave it, because it does not count. Click Generate with … documents. The totals are checked in steps 8 and 9.
- The SAF-T (PT) export record opens. If the status is Generated, click Download file. The browser saves the file
SAFT-PT_509999999_2026_09_F.xml. - Before submitting, check the file. Scroll down to the record's messages: the note “SalesInvoices control totals (checked against an independent SQL query): 3 document(s), TotalDebit 0.00, TotalCredit 5276.00.” says how many sales documents the file contains and their total excluding VAT: invoices in TotalCredit, credit notes in TotalDebit.
- Compare with what you invoiced. Open Billing › Invoice › Customer invoices, remove the This month filter and choose the filters Posted, Invoices and Invoice Date › September. The Untaxed (company currency) column is already in the list, and the footer gives its total. The number of lines must match the note (3) and the total must match TotalCredit: in the example, 3,941.00 + 1,200.00 + 135.00 = €5,276.00. The other total in the footer (€6,452.25) is for Outstanding, which includes VAT: it is not the one to compare. Do the same with the Credit Notes filter for TotalDebit. If the numbers do not match, do not submit: see “Common problems”.
Expected result
- The record is in the Generated state, with the Generated file name (
SAFT-PT_509999999_2026_09_F.xmlin the example: company tax number, year, month and mode), the File SHA-256, Error Count 0, Warning count 0 and the Submission status Not sent. - Download file saves the XML to your computer. The September file contains invoices
FT D26/28,FT D26/29andFT D26/30, as the control note says. - Record submission is the submission step, explained in How to communicate the month's invoicing to the AT. The Submit (simulated channel) button only exists in a test database: it does not appear in a production database.
Demo video
The video shows steps 1 to 7: open Generate SAF-T, choose mode F — Invoicing, leave Month and type the reference date 15/09/2026, read the open period warning, generate the file and download it. It does not show the totals check (steps 8 and 9).
No telemóvel, rode-o para a horizontal e veja o vídeo em ecrã inteiro: o texto do ecrã fica legível.
Transcrição
Important notes
- The Generate SAF-T (PT) window does not lock the period: the warning in step 5 only reminds you that the month's entries can still change.
- The billing file contains the company's certified sales documents, receipts, delivery notes and working documents (step 3 of the window counts them by type). The control totals note in step 8 counts only sales documents. Left out are drafts, supplier invoices, documents from a training series and those from another company in the database. Pending validation by a certified accountant: list of documents the law requires in the billing SAF-T.
- The file is a snapshot of the month at the moment it is generated. If anything in the month changes afterwards, generate it again: each generation is a new record and the old ones are kept as history.
- The month's file must be submitted to the AT by the deadline. In the demo, the What is there to do with the SAF-T? summary gave 6 October 2026 as the deadline for the September 2026 file. Pending validation by a certified accountant: legal deadline for the monthly invoicing communication and the rule when the day falls on a public holiday.
- Each product's SAF-T product type and each customer's tax number go into the file: How to create a product with the right VAT and type and How to create a customer with the right tax data.
Common problems
The window opens an error message and does not create the record
- Symptom: when you click Generate with … documents, a Validation Error, Warning or Invalid Operation opens, and no new record appears.
- What to do: see the message and the solution in The SAF-T is not generated or is Invalid.
The file comes out “Generated”, with warnings
- Symptom: the record is Generated, with Error Count 0, but the Warning count is not 0 and the Warnings list appears.
- Cause: the file is valid, but with incomplete data or data replaced by values the file accepts, for example a customer without a tax number or a contact without an address.
- What to do: read each warning before submitting. What each one means, when it requires a fix on the contact or the invoice, and an October 2026 example, are in How to fix SAF-T validation errors, sections “Customer without a NIF: not an error” and “Important notes”. After fixing a contact, click Regenerate.
The file comes out “Invalid”, with errors
- Symptom: instead of Generated, the record is Invalid, with the Errors button and their number, the Error Count, the Errors by type (for example “Format or invalid value: 1”) and the warning “This file is marked invalid. If you have already fixed the records listed below, press the “Regenerate” button above to check again with the current version of the product. This record stays as history; the new file is a new record.”. There is no Download file.
- Cause: there are documents or contacts in the month that the AT would not accept. The errors seen so far, including the supplier without a NIF and which files it affects, with an example through to Generated, are in How to fix SAF-T validation errors.
- What to do: each line of the list says Who corrects it and has the Open the record to fix button. Fix the records and click Regenerate. Export errors (XLSX) gives the list as a spreadsheet, to hand to whoever fixes it. Do not submit an Invalid file.
A posted invoice does not appear in the file, or the file comes out “Invalid” because of an invoice without a series
- Symptom: the file comes out Invalid with “Sales document "FT/2026/00005" is posted but has no SAF-T series/number (its journal is not certified) — it cannot be left out of the file silently. Issue it in a certified journal or fix the journal before generating.” Seen in a test company in the demo with old invoices in a non-certified journal.
- Cause: the invoice was posted in a journal that is not certified, so it has no series or ATCUD. fiscaldoo does not leave it out without warning.
- What to do: do not submit the file. Talk to your certified accountant and the Fiscal officer: the journal must be certified, or the document handled another way. Pending validation by a certified accountant: how to regularise an invoice posted without a certified series. If the number of invoices in the control note does not match the list (step 9) and there was no error, check the company and the list's filters.
I generated the SAF-T and it came out with the accounting entries
- Cause: the Mode was changed to C — Accounting (the window opens on F — Invoicing).
- What to do: generate again with F — Invoicing (step 2). The accounting file has its own use and deadline.