Guide
FatturaPA: XML vs XML.P7M Explained
Last updated October 7, 2026
Italian e-invoices travel as files, and the file you receive may be called IT01234567890_00001.xml or IT01234567890_00001.xml.p7m. They carry the same invoice, but one is wrapped in a digital signature. This guide explains the two, how to open them and what opening does not tell you.
The XML file
The invoice itself is an XML document in the FatturaPA format, today schema version 1.2.2 (format codes FPR12 for private parties and FPA12 for public administrations); the Agenzia delle Entrate's technical documentation, at version 1.9.1 since 15 May 2026, describes the rules around it. The XML has a header with the transmission data, the supplier (cedente/prestatore) and the customer (cessionario/committente), and one or more bodies with the document data, the lines, the VAT summary and the payment details. Documents of several invoices can be batched in one file. The XML is what travels through the Sistema di Interscambio (SdI).
The .p7m envelope
A file ending in .xml.p7m is the same XML inside a CMS (PKCS #7) SignedData envelope, normally in the CAdES form. The envelope contains the XML, the signature or signatures and often the signer's certificate. It may be stored in binary (DER or BER, sometimes with indefinite lengths) or as base64 text, and an already signed file can be signed again, giving two layers. Whether an invoice has to be signed depends on the situation and on the issuer's choice; ask your adviser rather than inferring it from the file extension.
Opening them
- An .xml file can be opened by any viewer that understands FatturaPA, or read as a table in a browser.
- A .xml.p7m file first has to be unwrapped: the XML is taken out of the envelope. Many signature programs do this; so does the Fattura Elettronica Viewer, in your browser and including base64 and double envelopes.
Unwrapping is not verifying
Taking the XML out of the envelope reads data; it does not prove anything about who signed or whether the content is unchanged since. Verifying a signature means checking the cryptographic signature against the signed content, building and validating the certificate chain, checking the validity period and revocation, and deciding whether the signature meets the level required, for example as a qualified electronic signature under eIDAS, which depends on the trust list of qualified providers. The viewer lists the signers and certificates it finds and states the declared signing time, but it performs none of these checks and it is not a legal verification. For a PDF signature, see the PAdES PDF Signature Inspector, which has the same honest limits.
Checking structure
Because the schema is public, the XML can be checked against it. The viewer does that in the browser and reports a missing mandatory element or a wrong order with the line number. That is a structure check; the SdI applies further rules and can reject an invoice that is structurally valid.
Reading code values
FatturaPA uses codes for the document type (TD01 invoice, TD04 credit note and others), the payment method (MP05 is a bank transfer), the VAT nature (the N codes for exempt, non-taxable and reverse-charge operations) and the tax regime (RF01 ordinary, RF19 flat-rate regime). The viewer shows the code with its name. Other formats from other countries, such as the Spanish Facturae, are shown by the Facturae viewer, and unknown XML can be identified with the E-Invoice Format Detector.