FatturaPA: the detailed XML specification
The FatturaPA format is an XSD XML schema published by AdE, root element
p:FatturaElettronica, structured as one header and one or more bodies
per invoice. The spec is EN 16931 compliant via the CIUS Italia, and electronically
signed in CAdES-BES (.p7m) or XAdES-BES.
XSD structure
The FatturaPA XSD defines a root type FatturaElettronicaType with two
main children: a unique FatturaElettronicaHeader and one or several
FatturaElettronicaBody. Each body is a distinct invoice (so a single
file can hold up to 50 invoices for the same issuer / recipient couple).
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
xmlns="http://ivaservizi.agenziaentrate.gov.it/docs/xsd/fatture/v1.2"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://ivaservizi.agenziaentrate.gov.it/docs/xsd/fatture/v1.2"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
version="1.8">
<xs:element name="FatturaElettronica" type="FatturaElettronicaType"/>
<xs:complexType name="FatturaElettronicaType">
<xs:sequence>
<xs:element name="FatturaElettronicaHeader" type="FatturaElettronicaHeaderType"/>
<xs:element name="FatturaElettronicaBody" type="FatturaElettronicaBodyType"
minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="versione" type="FormatoTrasmissioneType" use="required"/>
<xs:attribute name="SistemaEmittente" type="SistemaEmittenteType" use="optional"/>
</xs:complexType>
</xs:schema> Three main blocks structure the FatturaElettronicaHeader:
- DatiTrasmissione — IdTrasmittente (who transmits), ProgressivoInvio (sequence counter), FormatoTrasmissione (FPR12 / FPA12), CodiceDestinatario or PECDestinatario.
- CedentePrestatore — supplier data: DatiAnagrafici (IdFiscaleIVA, CodiceFiscale, Anagrafica, RegimeFiscale), Sede (address). Optional: StabileOrganizzazione, RappresentanteFiscale.
- CessionarioCommittente — customer data: DatiAnagrafici (IdFiscaleIVA if B2B, CodiceFiscale if B2C), Sede.
The FatturaElettronicaBody contains four major blocks:
- DatiGenerali — DatiGeneraliDocumento (TipoDocumento, Divisa, Data, Numero, totals, Causale, ImportoTotaleDocumento, Arrotondamento, Art73), DatiOrdineAcquisto, DatiContratto, DatiDDT, DatiTrasporto.
- DatiBeniServizi — DettaglioLinee (NumeroLinea, TipoCessionePrestazione, CodiceArticolo, Descrizione, Quantita, UnitaMisura, PrezzoUnitario, ScontoMaggiorazione, PrezzoTotale, AliquotaIVA, Natura, RiferimentoNormativo), DatiRiepilogo (per IVA rate).
- DatiVeicoli — for intra-EU sales of new transport means (Art. 38 DL 331/93).
- DatiPagamento — CondizioniPagamento (TP01/TP02/TP03), DettaglioPagamento (Beneficiario, ModalitaPagamento MP01-MP23, DataRiferimentoTerminiPagamento, ImportoPagamento, IBAN, CodiceBIC).
<?xml version="1.0" encoding="UTF-8"?>
<p:FatturaElettronica versione="FPR12"
xmlns:p="http://ivaservizi.agenziaentrate.gov.it/docs/xsd/fatture/v1.2">
<FatturaElettronicaHeader>
<DatiTrasmissione>
<IdTrasmittente><IdPaese>IT</IdPaese><IdCodice>01234567890</IdCodice></IdTrasmittente>
<ProgressivoInvio>00001</ProgressivoInvio>
<FormatoTrasmissione>FPR12</FormatoTrasmissione>
<CodiceDestinatario>M5UXCR1</CodiceDestinatario>
</DatiTrasmissione>
<CedentePrestatore>
<DatiAnagrafici>
<IdFiscaleIVA><IdPaese>IT</IdPaese><IdCodice>01234567890</IdCodice></IdFiscaleIVA>
<Anagrafica><Denominazione>ACME SpA</Denominazione></Anagrafica>
<RegimeFiscale>RF01</RegimeFiscale>
</DatiAnagrafici>
<Sede><Indirizzo>Via Roma 1</Indirizzo><CAP>00100</CAP>
<Comune>Roma</Comune><Provincia>RM</Provincia><Nazione>IT</Nazione></Sede>
</CedentePrestatore>
<CessionarioCommittente>
<DatiAnagrafici>
<IdFiscaleIVA><IdPaese>IT</IdPaese><IdCodice>09876543210</IdCodice></IdFiscaleIVA>
<Anagrafica><Denominazione>Beta srl</Denominazione></Anagrafica>
</DatiAnagrafici>
<Sede><Indirizzo>Corso Italia 5</Indirizzo><CAP>20100</CAP>
<Comune>Milano</Comune><Provincia>MI</Provincia><Nazione>IT</Nazione></Sede>
</CessionarioCommittente>
</FatturaElettronicaHeader>
<FatturaElettronicaBody>
<DatiGenerali>
<DatiGeneraliDocumento>
<TipoDocumento>TD01</TipoDocumento>
<Divisa>EUR</Divisa>
<Data>2026-05-19</Data>
<Numero>2026-001</Numero>
<ImportoTotaleDocumento>1220.00</ImportoTotaleDocumento>
</DatiGeneraliDocumento>
</DatiGenerali>
<DatiBeniServizi>
<DettaglioLinee>
<NumeroLinea>1</NumeroLinea>
<Descrizione>Technical consulting</Descrizione>
<Quantita>10.00</Quantita>
<PrezzoUnitario>100.00</PrezzoUnitario>
<PrezzoTotale>1000.00</PrezzoTotale>
<AliquotaIVA>22.00</AliquotaIVA>
</DettaglioLinee>
<DatiRiepilogo>
<AliquotaIVA>22.00</AliquotaIVA>
<ImponibileImporto>1000.00</ImponibileImporto>
<Imposta>220.00</Imposta>
</DatiRiepilogo>
</DatiBeniServizi>
</FatturaElettronicaBody>
</p:FatturaElettronica> EN 16931 mapping (CIUS Italia)
The CIUS (Core Invoice Usage Specification) Italia, published in April 2024 jointly by AgID and AdE, formalises the bidirectional mapping between EN 16931 Business Group / Business Term and FatturaPA elements.
| BG/BT EN 16931 | FatturaPA element | Notes |
|---|---|---|
| BT-1 Invoice number | DatiGeneraliDocumento/Numero | 20 chars max |
| BT-2 Issue date | DatiGeneraliDocumento/Data | ISO 8601 format (YYYY-MM-DD) |
| BT-3 Type code | DatiGeneraliDocumento/TipoDocumento | See TD table below |
| BT-5 Invoice currency | DatiGeneraliDocumento/Divisa | ISO 4217, usually EUR |
| BG-4 Seller | CedentePrestatore | Includes DatiAnagrafici, Sede, IscrizioneREA, Contatti |
| BG-7 Buyer | CessionarioCommittente | Includes DatiAnagrafici, Sede, Rappresentante |
| BG-25 Invoice line | DettaglioLinee | Multivalued — one linea per invoice line |
| BT-106 Sum of invoice line net amounts | Sum of PrezzoTotale | Computed on issuer side |
| BT-110 Invoice total VAT amount | DatiRiepilogo/Imposta | Per IVA rate |
| BT-115 Amount due for payment | DatiGeneraliDocumento/ImportoTotaleDocumento | — |
TipoDocumento codes (TD01-TD28)
The TipoDocumento field identifies the document type. Its value has a
direct impact on downstream tax handling (IVA deduction, booking in purchases /
sales, LIPE return).
| Code | Description | Typical use |
|---|---|---|
TD01 | Fattura | Standard B2B/B2C/B2G invoice |
TD02 | Acconto/Anticipo su fattura | Down payment / advance |
TD03 | Acconto/Anticipo su parcella | Professional fee down payment |
TD04 | Nota di credito | Credit note |
TD05 | Nota di debito | Debit note |
TD06 | Parcella | Professional fee (lawyer, doctor, expert) |
TD16 | Integrazione fattura reverse charge interno | Domestic RC self-invoice |
TD17 | Integrazione/autofattura per acquisto servizi dall'estero | Service purchase intra-EU or extra-EU |
TD18 | Integrazione per acquisto beni intra UE | Intra-EU goods purchase |
TD19 | Integrazione/autofattura per acquisto da soggetti non residenti senza stabile organizzazione | Non-resident purchase |
TD20 | Autofattura per regolarizzazione | Art. 6 c. 8 DL 471/97 regularisation |
TD21 | Autofattura per splafonamento | IVA cap overrun |
TD22 | Estrazione beni da Deposito IVA | Withdrawal from IVA warehouse |
TD23 | Estrazione beni da Deposito IVA con versamento IVA | — |
TD24 | Fattura differita di cui all'art. 21 c. 4 lett. a) | Monthly deferred invoice |
TD25 | Fattura differita di cui all'art. 21 c. 4 lett. b) | Triangulation deferred invoice |
TD26 | Cessione di beni ammortizzabili e per passaggi interni | Sale of fixed assets |
TD27 | Fattura per autoconsumo o per cessioni gratuite senza rivalsa | Self-consumption / free transfer |
TD28 | Acquisti da San Marino con IVA (fattura cartacea) | San Marino purchases (paper added) |
Electronic signature CAdES / XAdES
Depending on the channel, signing is either mandatory or optional.
- PEC or SDIcoop SOAP channel — detached CAdES-BES signature
mandatory. Resulting file is
IT01234567890_00001.xml.p7m. - SDIftp or web portal channel — enveloped XAdES-BES tolerated, or detached CAdES-BES.
- Certificate — issued by a Prestatore di Servizi Fiduciari Qualificato (QTSP) listed in the AgID registry, eIDAS Regulation EU 910/2014 compliant.
- Hash algorithm — SHA-256 (RFC 5754), SHA-1 refused since 2018.
- Time-stamping — not mandatory at SdI level but required for subsequent conservazione sostitutiva (see dedicated page).
Versions 1.7 and 1.8
Schema version 1.7 was published on 8 February 2023 (Provvedimento AdE 30/2023) and went into production on 1 October 2023. Version 1.8, published on 21 February 2025, is mandatory since 1 April 2025. Major changes:
- 1.7 — added TD28 codes (San Marino), N7 (Natura clarifications),
enriched
RiferimentoNormativoto 100 chars max, CIUS Italia Schematron support. - 1.8 — EN 16931 ViDA-ready alignment, extended UNICODE encoding,
GLN support in
IdFiscaleIVA/IdCodice(for PEPPOL bridge transmissions), new Natura codes N3.4 / N3.5 / N3.6 for specific cross-border operations.
Most common XSD and SdI errors
| Code | Cause | Action |
|---|---|---|
00200 | File does not conform to XSD | Re-validate locally against v1.8 |
00201 | More than 50 fatture in the same file | Split into multiple uploads |
00300 | Issuer IdFiscaleIVA/IdCodice invalid | Check VAT checksum |
00400 | Two DatiRiepilogo elements with same AliquotaIVA and Natura | Group into a single riepilogo line |
00417 | IdFiscaleIVA and CodiceFiscale both absent for CessionarioCommittente | Provide at least one |
00422 | Invoice Numero already received | Increment or avoid duplicate |
00430 | TipoDocumento incompatible with Natura | Cross-check TD with expected Natura |
00471 | Cedente/Cessionario identical (mishandled self-invoice) | Use TD20-TD27 as appropriate |
00474 | ImponibileImporto + Imposta != PrezzoTotale | Recalculate with 2-decimal rounding |