FatturaPA XML: What It Is, How It Works, and What Every Field Means
A practical breakdown of the FatturaPA XML format used for all Italian e-invoicing. Understand the structure, key fields, TipoDocumento codes, and common mistakes to avoid.
FatturaPA XML: What It Is, How It Works, and What Every Field Means
When people say "e-invoicing" in Italy, they mean FatturaPA. Every invoice between Italian VAT entities โ B2G, B2B, B2C โ must be a FatturaPA XML file transmitted through the SDI.
This guide is for anyone who needs to actually understand the format: accountants setting up new clients, developers building integrations, or business owners who want to know what their software is generating. We'll skip the government jargon and focus on what matters in practice.
The Basic Structure
A FatturaPA file is an XML document with two major sections:
FatturaElettronica
โโโ FatturaElettronicaHeader โ Who is sending, who is receiving, how to route it
โ โโโ DatiTrasmissione โ SDI routing data
โ โโโ CedentePrestatore โ Sender (the issuer of the invoice)
โ โโโ CessionarioCommittente โ Recipient (the customer)
โโโ FatturaElettronicaBody โ The actual invoice content
โโโ DatiGenerali โ Invoice type, number, date, references
โโโ DatiBeniServizi โ Line items, quantities, prices, VAT
โโโ DatiPagamento โ Payment terms and method
โโโ Allegati โ Optional attachments (PDF, etc.)
Simple in principle. The complexity comes in the details.
Key Fields You Need to Understand
DatiTrasmissione (Transmission Data)
This section tells SDI how to route the invoice.
CodiceDestinatario โ The 7-character SDI address of the recipient. This is the most important routing field. If you get this wrong, the invoice either bounces or ends up in the recipient's general SDI inbox on the Agenzia website (where they may never see it).
- For businesses with a registered SDI intermediary: use their 7-character code
- For public bodies: use the specific code from the IPA (Indice delle Pubbliche Amministrazioni) โ it's 6 characters
- If the recipient has no CodiceDestinatario registered: use
0000000and populatePECDestinatarioinstead
PECDestinatario โ The recipient's certified email (PEC) address for SDI delivery. Only use if the recipient doesn't have a CodiceDestinatario and has given you their PEC.
ProgressivoInvio โ A sequential number assigned by you (or your intermediary) for tracking the transmission. It doesn't need to match your invoice number โ it's purely for tracking.
TipoDocumento (Document Type Codes)
This is where most confusion happens. You need to pick the right code for your document type or SDI will reject it:
| Code | Document Type | When to Use |
|---|---|---|
| TD01 | Standard invoice | Regular sales invoice for goods or services |
| TD02 | Advance / down payment invoice | When billing an advance before the full delivery |
| TD03 | Advance/down payment for forfettari | For flat-rate regime advance payments |
| TD04 | Credit note | When correcting or cancelling a previous invoice |
| TD05 | Debit note | When correcting underbilled amounts |
| TD06 | Fee note | For professional fees (parcella) โ used by lawyers, notaries, etc. |
| TD16 | Self-billing โ reverse charge domestic | When the recipient must apply VAT instead of the supplier |
| TD17 | Self-billing โ services from abroad | For services purchased from non-Italian suppliers |
| TD18 | Self-billing โ intra-EU goods | For goods purchased intra-EU (triangular transactions) |
| TD19 | Self-billing โ non-EU goods with Italian VAT | For non-EU goods subject to Italian import VAT |
| TD24 | Deferred invoice | Invoice issued after the delivery note (DDT) โ within 15 days of month-end |
| TD25 | Deferred invoice โ triangular sale | Deferred invoice for triangular domestic B2B sales |
| TD26 | Invoice for sale of depreciable assets | Specific to asset sales |
| TD27 | Self-billing โ informal supply | Self-billing for supplies without a formal invoice from supplier |
| TD28 | Invoice to foreign customers | Used for invoicing non-Italian customers |
The most common error: using TD01 when you should be using TD16 (reverse charge) or TD17 (services from abroad). The VAT treatment must match the TipoDocumento.
RegimeFiscale (Tax Regime)
Every invoice must include the issuer's tax regime code. Get this wrong and it's a transmission error:
| Code | Regime | Who uses it |
|---|---|---|
| RF01 | Regime ordinario | Most standard VAT businesses |
| RF02 | Contribuenti minimi | Old minimal taxpayer regime (mostly historical) |
| RF04 | Agriculture and fisheries | Specific flat-rate rules |
| RF05 | Salt and tobaccos (monopolio) | Very specific |
| RF06 | Agriturismo | Agricultural tourism |
| RF07 | Farmacia | Pharmacies |
| RF10 | Ventilazione corrispettivi | Retailers using mixed-rate POS systems |
| RF17 | Regime forfettario | Flat-rate freelancers and sole traders |
| RF18 | Other special regimes | Various |
| RF19 | Regime forfettario (since 2019)** | Same as RF17 โ check your accountant |
For most businesses: RF01. For freelancers under the simplified flat-rate scheme: RF17 or RF19 (check with your commercialista which applies to your year).
Natura (VAT Exemption Codes)
When you don't charge VAT, you must explain why using a Natura code. This replaces the VAT percentage in the relevant line item:
| Code | Meaning |
|---|---|
| N1 | Excluded from VAT scope (Art. 15 DPR 633/72) |
| N2.1 | Not subject to VAT โ general |
| N2.2 | Not subject to VAT โ specific cases |
| N3.1 | Non-taxable โ export of goods |
| N3.2 | Non-taxable โ intra-EU supplies |
| N3.3 | Non-taxable โ supplies to San Marino/Vatican |
| N3.4 | Non-taxable โ international transport |
| N3.5 | Non-taxable โ UN/diplomatic |
| N3.6 | Non-taxable โ other |
| N4 | VAT exempt โ e.g., healthcare, education, financial services |
| N5 | Taxable in margin scheme (regime del margine) |
| N6.1 | Reverse charge โ scrap metals |
| N6.2 | Reverse charge โ gold |
| N6.3 | Reverse charge โ subcontracting in construction |
| N6.4 | Reverse charge โ building services |
| N6.5 | Reverse charge โ electronics |
| N6.6 | Reverse charge โ personal protective equipment |
| N6.7 | Reverse charge โ gas and energy certificates |
| N6.8 | Reverse charge โ gaming devices |
| N6.9 | Reverse charge โ other |
| N7 | VAT charged by post office (ritenuta fisso) |
The most common: N4 for exempt services (healthcare professionals, banks), N6.x for various reverse charge scenarios, and N3.1 / N3.2 for exports/intra-EU sales.
Common FatturaPA Errors and How to Fix Them
Error 00001 โ Invalid XML schema
The file doesn't conform to the official FatturaPA XSD schema. Usually means a missing mandatory field or incorrect data type. Solution: validate your XML against the official XSD before transmitting.
Error 00002 โ Invalid Digital Signature
If your intermediary uses a digital signature and it's expired or incorrectly applied, SDI will reject the file. Contact your intermediary.
Error 00311 โ Recipient not found
The CodiceDestinatario doesn't match any registered SDI recipient. Check the code carefully โ one wrong character and the invoice goes nowhere.
Error 00404 โ Duplicate invoice
An invoice with the same sender VAT number, invoice number, and invoice date already exists in SDI. If you genuinely need to resend, you must issue a different invoice number.
Error 00409 โ Data inconsistency
The VAT amounts calculated from the line items don't match the totals in DatiRiepilogo. Rounding differences of even โฌ0.01 trigger this. Apply proper Italian rounding rules (commercial rounding to 2 decimal places).
Scarto (Rejection) vs. Notifica di Mancata Consegna
SDI can respond with different notifications:
- Ricevuta di Consegna (RC) โ success, invoice delivered
- Notifica di Mancata Consegna (MC) โ technical delivery failure, SDI will retry
- Notifica di Scarto (NS) โ invoice rejected, you have 5 days to fix and resubmit
- Notifica di Esito Committente (EC) โ the recipient has accepted or rejected the invoice
- Notifica di Decorrenza Termini (DT) โ 15-day timer expired without recipient response, invoice is auto-accepted
Understanding these response codes is essential. Your e-invoicing software should surface them clearly.
Practical Tips
Validate before transmitting. The Agenzia delle Entrate provides a free online validator at their website. Use it. SDI rejections create administrative overhead.
Match invoice numbers to SDI. Many businesses use a dedicated numbering sequence for e-invoices (e.g., "EF2025/001") to avoid collision with paper invoice numbers still in use for cross-border transactions.
Keep the raw XML, not just the PDF. The FatturaPA XML is the legally valid document. The PDF courtesy copy is not. Make sure your archiving system stores the XML, not a printed version.
Understand the 15-day acceptance window. From the SDI delivery date, the recipient has 15 days to formally accept or reject the invoice (Notifica di Esito Committente). If they don't respond, the invoice is automatically accepted. However, "automatically accepted" doesn't mean "payment is due" โ payment terms still apply separately.
Last updated: April 2026. Source: Agenzia delle Entrate FatturaPA specification v1.3.2.