# FatturaPA to Excel - Italian e-invoice XML, P7M and ZIP (`hardreset83/fatturapa-to-excel`) Actor

Turn Italian electronic invoices (FatturaPA / SDI XML, signed .p7m and ZIP archives) into clean Excel, CSV and JSON: supplier, customer, totals, VAT summary, due dates, IBAN and every line.

- **URL**: https://apify.com/hardreset83/fatturapa-to-excel.md
- **Developed by:** [Flavio D'Orio](https://apify.com/hardreset83) (community)
- **Categories:** Business, Automation, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$5.00 / 1,000 invoice parseds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## FatturaPA to Excel, CSV & JSON (Italian e-invoice parser)

Turn Italian electronic invoices into a clean spreadsheet in seconds. Drop in one **FatturaPA XML**, a signed
**.xml.p7m** file or a whole **ZIP archive** (for example the export of your *Cassetto fiscale* or of your
management software) and get back:

- **one row per invoice**: supplier and customer (name, VAT number, tax code, city), number, date, document type,
  taxable amount, VAT, total, stamp duty, withholding tax, pension fund, payment method, due dates and IBAN;
- **one row per line** if you need item analysis: code, description, quantity, unit price, discounts, VAT rate;
- a ready **INVOICES.xlsx** with two sheets (*Fatture* and *Righe*) that opens correctly in Italian Excel,
  plus INVOICES.csv and LINES.csv.

Signed `.p7m` files (binary or base64), several invoices in one file (lotto), credit notes, FPR12 (B2B/B2C),
FPA12 (public administration) and the simplified invoice FSM10 are all supported. SDI receipts and metadata
files inside a ZIP are recognised and skipped **for free**.

### Who is it for

- **Accountants and bookkeepers** who receive hundreds of XML files and need them in Excel.
- **Small businesses** that want to analyse purchases by supplier, due dates and VAT without retyping.
- **Developers and automation builders** (Make, Zapier, n8n, your own code) who need FatturaPA as JSON.
- **Controllers** preparing cash-flow forecasts from due dates and amounts.

### How to use it

1. Upload a file in **Upload a file**, or add links in **Links to invoice files**, or paste one XML.
   The input is prefilled with a demo invoice: press **Start** to see the result.
2. Choose **Dataset rows**: one row per invoice (default), one row per line, or the full JSON.
3. Open the **Storage** tab and download **INVOICES.xlsx**, or export the dataset in any format.

### Example output (one row per invoice)

```json
{
  "status": "ok",
  "fileName": "IT01234567890_FPR01.xml",
  "documentType": "TD01",
  "documentTypeDescription": "Fattura",
  "number": "2026/145",
  "date": "2026-10-31",
  "supplierName": "Esempio Impianti S.r.l.",
  "supplierVatNumber": "IT01234567890",
  "customerName": "Cliente Prova S.p.A.",
  "customerVatNumber": "IT09876543210",
  "taxableAmount": 1102.0,
  "vatAmount": 218.0,
  "totalAmount": 1320.0,
  "stampDuty": 2.0,
  "paymentMethodDescription": "Bonifico",
  "firstDueDate": "2026-11-30",
  "lastDueDate": "2026-12-31",
  "iban": "IT60X0542811101000000123456",
  "vatSummary": [{"vatRate": 22.0, "taxableAmount": 900.0, "vatAmount": 198.0, "vatDueDescription": "Immediata"}],
  "linesCount": 3,
  "warnings": []
}
```

Credit notes (TD04, TD08) have `isCreditNote: true` and a negative `signedTotalAmount`, so totals add up.
`warnings` tells you when the declared total does not match taxable amount plus VAT.

### Input

| Field | What it does |
|---|---|
| Upload a file | One XML, P7M or ZIP file (ZIP can contain thousands of invoices, also nested ZIPs) |
| Links to invoice files | Direct https links to XML, P7M or ZIP files |
| Paste one invoice XML | For a quick test |
| Dataset rows | `invoices`, `lines` or `full` |
| Excel and CSV columns | Italian (semicolon, decimal comma) or English |
| Skip duplicates | The same invoice found as XML and P7M is returned and charged once |
| Extract attached PDFs | Saves the PDF copies attached inside the invoices, with a link |
| Maximum invoices | Stop after N invoices |

### Pricing

Pay per result: you pay only for **invoices read successfully** (event `invoice-parsed`). Receipts, metadata
files, duplicates and broken files are free. Set *Maximum cost per run* in the run options to cap your spend.

### Privacy

Files are processed only inside your run and are not sent anywhere else. Results stay in your Apify storage,
under your control. Nothing is used for training.

### API and integrations

Run it from Make, Zapier, n8n or code with the Apify API, for example with Python:

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_API_TOKEN>")
run = client.actor("<username>/fatturapa-to-excel").call(run_input={
    "invoiceUrls": ["https://example.com/invoices.zip"], "outputMode": "invoices"})
for invoice in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(invoice["number"], invoice["supplierName"], invoice["totalAmount"])
```

### FAQ

**Does it validate invoices against the SDI rules?** No: it reads and converts them. It reports totals that do not
add up, but it is not an SDI validator.

**Does it check the digital signature of .p7m files?** It extracts the signed XML; it does not verify the
certificate chain.

**Which versions are supported?** FatturaPA 1.2.x (FPR12, FPA12) and FSM10.

***

### In italiano

**Da fattura elettronica a Excel in un clic.** Carica un file XML, un file firmato .p7m o uno ZIP con tutte le
fatture (per esempio scaricato dal Cassetto fiscale) e ottieni un **Excel pronto** con due fogli: *Fatture*
(fornitore, cliente, partita IVA, numero, data, imponibile, IVA, totale, bollo, ritenuta, scadenze, IBAN) e
*Righe* (codice, descrizione, quantità, prezzo, sconti, aliquota). Le colonne sono in italiano e i numeri con la
virgola, così il file si apre giusto in Excel.

Ricevute SDI e file di metadati nello ZIP vengono riconosciuti e **non si pagano**. Le note di credito hanno il
totale con il segno meno. Paghi solo le fatture lette davvero.

#### Cosa fa

- Legge le fatture elettroniche XML (FPR12, FPA12 e la semplificata FSM10), anche firmate **.p7m** (binarie o in
  base64) e gli **ZIP** del Cassetto fiscale o del gestionale, anche uno ZIP dentro l'altro.
- Dà un **Excel** con i fogli *Fatture* e *Righe*, più CSV e JSON: fornitore e cliente con partita IVA e codice
  fiscale, numero, data, tipo di documento, imponibile, IVA per aliquota, totale, bollo, ritenuta, cassa
  previdenziale, modalità e scadenze di pagamento, IBAN, ordini e DDT collegati.
- La stessa fattura trovata due volte (per esempio in XML e in .p7m) si paga una volta sola, e ti avvisa quando il
  totale dichiarato non torna con imponibile e IVA.
- Se vuoi, salva anche i PDF allegati dentro le fatture.

#### Come si usa

1. Carica il file (XML, .p7m o ZIP) in **Upload a file**, oppure metti i link, oppure incolla l'XML di una fattura.
2. Lascia **Excel and CSV columns** su *Italiano* e premi **Start**.
3. Nella scheda **Storage** scarica **INVOICES.xlsx**.

Funziona anche da solo con Make, Zapier o n8n, per esempio ogni mese con le fatture appena scaricate.

#### Quanto costa

Paghi solo le fatture lette: 5 $ ogni 1.000 fatture (0,005 $ a fattura). Ricevute, metadati, doppioni e file rotti
sono gratis.

#### Domande frequenti

**Come apro un file .p7m?** Caricalo così com'è: lo strumento tira fuori la fattura dalla busta firmata e te la dà in
Excel. Non verifica il certificato della firma.

**Controlla la fattura come lo SDI?** No: la legge e la converte, e segnala i totali che non tornano.

**I miei file restano privati?** Sì: restano nella tua esecuzione su Apify e non vanno da nessun'altra parte.

# Actor input Schema

## `invoiceFile` (type: `string`):

One FatturaPA file (.xml or signed .xml.p7m) or a ZIP archive with many invoices, for example the export of your Cassetto fiscale or of your management software. SDI receipts and metadata files inside the ZIP are skipped for free.

## `invoiceUrls` (type: `array`):

Direct links (https) to .xml, .xml.p7m or .zip files. Useful from Make, Zapier, n8n or your own code.

## `xmlContent` (type: `string`):

Paste the XML of a single invoice. Prefilled with a demo invoice so you can try the Actor in one click. When you upload a file or add links, the demo invoice is ignored.

## `outputMode` (type: `string`):

invoices: one clean row per invoice (lines are in the Excel file). lines: one row per invoice line, ideal for item analysis. full: one row per invoice with all its lines nested, for developers.

## `language` (type: `string`):

Italian: Italian headers, semicolon separator and decimal comma (opens correctly in Italian Excel). English: English headers, comma separator.

## `saveSpreadsheets` (type: `boolean`):

Creates a ready-to-use Excel file with two sheets (invoices and lines) in the key-value store.

## `deduplicate` (type: `boolean`):

The same invoice (supplier, type, number, date) found twice, for example as .xml and as .p7m, is returned and charged only once.

## `extractAttachments` (type: `boolean`):

Saves the files attached inside the invoices (usually the PDF copy) in the key-value store, with a link in the results.

## `maxInvoices` (type: `integer`):

Stop after this many invoices (0 = no limit). You can also set the maximum cost per run in the run options.

## Actor input object example

```json
{
  "invoiceUrls": [],
  "xmlContent": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<p:FatturaElettronica versione=\"FPR12\" xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\" xmlns:p=\"http://ivaservizi.agenziaentrate.gov.it/docs/xsd/fatture/v1.2\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n  <FatturaElettronicaHeader>\n    <DatiTrasmissione>\n      <IdTrasmittente><IdPaese>IT</IdPaese><IdCodice>01234567890</IdCodice></IdTrasmittente>\n      <ProgressivoInvio>00001</ProgressivoInvio>\n      <FormatoTrasmissione>FPR12</FormatoTrasmissione>\n      <CodiceDestinatario>ABC1234</CodiceDestinatario>\n    </DatiTrasmissione>\n    <CedentePrestatore>\n      <DatiAnagrafici>\n        <IdFiscaleIVA><IdPaese>IT</IdPaese><IdCodice>01234567890</IdCodice></IdFiscaleIVA>\n        <CodiceFiscale>01234567890</CodiceFiscale>\n        <Anagrafica><Denominazione>Esempio Impianti S.r.l.</Denominazione></Anagrafica>\n        <RegimeFiscale>RF01</RegimeFiscale>\n      </DatiAnagrafici>\n      <Sede><Indirizzo>Via Roma</Indirizzo><NumeroCivico>10</NumeroCivico><CAP>20100</CAP><Comune>Milano</Comune><Provincia>MI</Provincia><Nazione>IT</Nazione></Sede>\n      <IscrizioneREA><Ufficio>MI</Ufficio><NumeroREA>123456</NumeroREA><StatoLiquidazione>LN</StatoLiquidazione></IscrizioneREA>\n      <Contatti><Telefono>021234567</Telefono><Email>info@esempio.it</Email></Contatti>\n    </CedentePrestatore>\n    <CessionarioCommittente>\n      <DatiAnagrafici>\n        <IdFiscaleIVA><IdPaese>IT</IdPaese><IdCodice>09876543210</IdCodice></IdFiscaleIVA>\n        <Anagrafica><Denominazione>Cliente Prova S.p.A.</Denominazione></Anagrafica>\n      </DatiAnagrafici>\n      <Sede><Indirizzo>Corso Italia</Indirizzo><NumeroCivico>5</NumeroCivico><CAP>00100</CAP><Comune>Roma</Comune><Provincia>RM</Provincia><Nazione>IT</Nazione></Sede>\n    </CessionarioCommittente>\n  </FatturaElettronicaHeader>\n  <FatturaElettronicaBody>\n    <DatiGenerali>\n      <DatiGeneraliDocumento>\n        <TipoDocumento>TD01</TipoDocumento>\n        <Divisa>EUR</Divisa>\n        <Data>2026-10-31</Data>\n        <Numero>2026/145</Numero>\n        <DatiBollo><BolloVirtuale>SI</BolloVirtuale><ImportoBollo>2.00</ImportoBollo></DatiBollo>\n        <ImportoTotaleDocumento>1320.00</ImportoTotaleDocumento>\n        <Causale>Installazione impianto domotico</Causale>\n        <Causale>Commessa 88</Causale>\n      </DatiGeneraliDocumento>\n      <DatiOrdineAcquisto><RiferimentoNumeroLinea>1</RiferimentoNumeroLinea><IdDocumento>ORD-77</IdDocumento><Data>2026-10-01</Data></DatiOrdineAcquisto>\n      <DatiDDT><NumeroDDT>45</NumeroDDT><DataDDT>2026-10-20</DataDDT></DatiDDT>\n    </DatiGenerali>\n    <DatiBeniServizi>\n      <DettaglioLinee>\n        <NumeroLinea>1</NumeroLinea>\n        <CodiceArticolo><CodiceTipo>INTERNO</CodiceTipo><CodiceValore>HUB-01</CodiceValore></CodiceArticolo>\n        <Descrizione>Centralina domotica</Descrizione>\n        <Quantita>2.00</Quantita>\n        <UnitaMisura>PZ</UnitaMisura>\n        <PrezzoUnitario>500.00</PrezzoUnitario>\n        <ScontoMaggiorazione><Tipo>SC</Tipo><Percentuale>10.00</Percentuale></ScontoMaggiorazione>\n        <PrezzoTotale>900.00</PrezzoTotale>\n        <AliquotaIVA>22.00</AliquotaIVA>\n      </DettaglioLinee>\n      <DettaglioLinee>\n        <NumeroLinea>2</NumeroLinea>\n        <Descrizione>Manodopera installazione</Descrizione>\n        <Quantita>4.00</Quantita>\n        <UnitaMisura>ORE</UnitaMisura>\n        <PrezzoUnitario>50.00</PrezzoUnitario>\n        <PrezzoTotale>200.00</PrezzoTotale>\n        <AliquotaIVA>10.00</AliquotaIVA>\n      </DettaglioLinee>\n      <DettaglioLinee>\n        <NumeroLinea>3</NumeroLinea>\n        <Descrizione>Rimborso bollo</Descrizione>\n        <Quantita>1.00</Quantita>\n        <PrezzoUnitario>2.00</PrezzoUnitario>\n        <PrezzoTotale>2.00</PrezzoTotale>\n        <AliquotaIVA>0.00</AliquotaIVA>\n        <Natura>N1</Natura>\n      </DettaglioLinee>\n      <DatiRiepilogo><AliquotaIVA>22.00</AliquotaIVA><ImponibileImporto>900.00</ImponibileImporto><Imposta>198.00</Imposta><EsigibilitaIVA>I</EsigibilitaIVA></DatiRiepilogo>\n      <DatiRiepilogo><AliquotaIVA>10.00</AliquotaIVA><ImponibileImporto>200.00</ImponibileImporto><Imposta>20.00</Imposta><EsigibilitaIVA>I</EsigibilitaIVA></DatiRiepilogo>\n      <DatiRiepilogo><AliquotaIVA>0.00</AliquotaIVA><Natura>N1</Natura><ImponibileImporto>2.00</ImponibileImporto><Imposta>0.00</Imposta><RiferimentoNormativo>Escluse art.15</RiferimentoNormativo></DatiRiepilogo>\n    </DatiBeniServizi>\n    <DatiPagamento>\n      <CondizioniPagamento>TP01</CondizioniPagamento>\n      <DettaglioPagamento><ModalitaPagamento>MP05</ModalitaPagamento><DataScadenzaPagamento>2026-11-30</DataScadenzaPagamento><ImportoPagamento>794.00</ImportoPagamento><IstitutoFinanziario>Banca Esempio</IstitutoFinanziario><IBAN>IT60X0542811101000000123456</IBAN></DettaglioPagamento>\n      <DettaglioPagamento><ModalitaPagamento>MP05</ModalitaPagamento><DataScadenzaPagamento>2026-12-31</DataScadenzaPagamento><ImportoPagamento>794.00</ImportoPagamento><IBAN>IT60X0542811101000000123456</IBAN></DettaglioPagamento>\n    </DatiPagamento>\n  </FatturaElettronicaBody>\n</p:FatturaElettronica>\n",
  "outputMode": "invoices",
  "language": "it",
  "saveSpreadsheets": true,
  "deduplicate": true,
  "extractAttachments": false,
  "maxInvoices": 0
}
```

# Actor output Schema

## `invoices` (type: `string`):

Every invoice read from your files.

## `report` (type: `string`):

INVOICES.xlsx: the invoices and their lines.

## `files` (type: `string`):

Every file of this run in the key-value store, with its link.

## `summary` (type: `string`):

The result of the run in short: counts, totals, problems and the links to the files.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "invoiceUrls": [],
    "xmlContent": `<?xml version="1.0" encoding="UTF-8"?>
<p:FatturaElettronica versione="FPR12" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:p="http://ivaservizi.agenziaentrate.gov.it/docs/xsd/fatture/v1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <FatturaElettronicaHeader>
    <DatiTrasmissione>
      <IdTrasmittente><IdPaese>IT</IdPaese><IdCodice>01234567890</IdCodice></IdTrasmittente>
      <ProgressivoInvio>00001</ProgressivoInvio>
      <FormatoTrasmissione>FPR12</FormatoTrasmissione>
      <CodiceDestinatario>ABC1234</CodiceDestinatario>
    </DatiTrasmissione>
    <CedentePrestatore>
      <DatiAnagrafici>
        <IdFiscaleIVA><IdPaese>IT</IdPaese><IdCodice>01234567890</IdCodice></IdFiscaleIVA>
        <CodiceFiscale>01234567890</CodiceFiscale>
        <Anagrafica><Denominazione>Esempio Impianti S.r.l.</Denominazione></Anagrafica>
        <RegimeFiscale>RF01</RegimeFiscale>
      </DatiAnagrafici>
      <Sede><Indirizzo>Via Roma</Indirizzo><NumeroCivico>10</NumeroCivico><CAP>20100</CAP><Comune>Milano</Comune><Provincia>MI</Provincia><Nazione>IT</Nazione></Sede>
      <IscrizioneREA><Ufficio>MI</Ufficio><NumeroREA>123456</NumeroREA><StatoLiquidazione>LN</StatoLiquidazione></IscrizioneREA>
      <Contatti><Telefono>021234567</Telefono><Email>info@esempio.it</Email></Contatti>
    </CedentePrestatore>
    <CessionarioCommittente>
      <DatiAnagrafici>
        <IdFiscaleIVA><IdPaese>IT</IdPaese><IdCodice>09876543210</IdCodice></IdFiscaleIVA>
        <Anagrafica><Denominazione>Cliente Prova S.p.A.</Denominazione></Anagrafica>
      </DatiAnagrafici>
      <Sede><Indirizzo>Corso Italia</Indirizzo><NumeroCivico>5</NumeroCivico><CAP>00100</CAP><Comune>Roma</Comune><Provincia>RM</Provincia><Nazione>IT</Nazione></Sede>
    </CessionarioCommittente>
  </FatturaElettronicaHeader>
  <FatturaElettronicaBody>
    <DatiGenerali>
      <DatiGeneraliDocumento>
        <TipoDocumento>TD01</TipoDocumento>
        <Divisa>EUR</Divisa>
        <Data>2026-10-31</Data>
        <Numero>2026/145</Numero>
        <DatiBollo><BolloVirtuale>SI</BolloVirtuale><ImportoBollo>2.00</ImportoBollo></DatiBollo>
        <ImportoTotaleDocumento>1320.00</ImportoTotaleDocumento>
        <Causale>Installazione impianto domotico</Causale>
        <Causale>Commessa 88</Causale>
      </DatiGeneraliDocumento>
      <DatiOrdineAcquisto><RiferimentoNumeroLinea>1</RiferimentoNumeroLinea><IdDocumento>ORD-77</IdDocumento><Data>2026-10-01</Data></DatiOrdineAcquisto>
      <DatiDDT><NumeroDDT>45</NumeroDDT><DataDDT>2026-10-20</DataDDT></DatiDDT>
    </DatiGenerali>
    <DatiBeniServizi>
      <DettaglioLinee>
        <NumeroLinea>1</NumeroLinea>
        <CodiceArticolo><CodiceTipo>INTERNO</CodiceTipo><CodiceValore>HUB-01</CodiceValore></CodiceArticolo>
        <Descrizione>Centralina domotica</Descrizione>
        <Quantita>2.00</Quantita>
        <UnitaMisura>PZ</UnitaMisura>
        <PrezzoUnitario>500.00</PrezzoUnitario>
        <ScontoMaggiorazione><Tipo>SC</Tipo><Percentuale>10.00</Percentuale></ScontoMaggiorazione>
        <PrezzoTotale>900.00</PrezzoTotale>
        <AliquotaIVA>22.00</AliquotaIVA>
      </DettaglioLinee>
      <DettaglioLinee>
        <NumeroLinea>2</NumeroLinea>
        <Descrizione>Manodopera installazione</Descrizione>
        <Quantita>4.00</Quantita>
        <UnitaMisura>ORE</UnitaMisura>
        <PrezzoUnitario>50.00</PrezzoUnitario>
        <PrezzoTotale>200.00</PrezzoTotale>
        <AliquotaIVA>10.00</AliquotaIVA>
      </DettaglioLinee>
      <DettaglioLinee>
        <NumeroLinea>3</NumeroLinea>
        <Descrizione>Rimborso bollo</Descrizione>
        <Quantita>1.00</Quantita>
        <PrezzoUnitario>2.00</PrezzoUnitario>
        <PrezzoTotale>2.00</PrezzoTotale>
        <AliquotaIVA>0.00</AliquotaIVA>
        <Natura>N1</Natura>
      </DettaglioLinee>
      <DatiRiepilogo><AliquotaIVA>22.00</AliquotaIVA><ImponibileImporto>900.00</ImponibileImporto><Imposta>198.00</Imposta><EsigibilitaIVA>I</EsigibilitaIVA></DatiRiepilogo>
      <DatiRiepilogo><AliquotaIVA>10.00</AliquotaIVA><ImponibileImporto>200.00</ImponibileImporto><Imposta>20.00</Imposta><EsigibilitaIVA>I</EsigibilitaIVA></DatiRiepilogo>
      <DatiRiepilogo><AliquotaIVA>0.00</AliquotaIVA><Natura>N1</Natura><ImponibileImporto>2.00</ImponibileImporto><Imposta>0.00</Imposta><RiferimentoNormativo>Escluse art.15</RiferimentoNormativo></DatiRiepilogo>
    </DatiBeniServizi>
    <DatiPagamento>
      <CondizioniPagamento>TP01</CondizioniPagamento>
      <DettaglioPagamento><ModalitaPagamento>MP05</ModalitaPagamento><DataScadenzaPagamento>2026-11-30</DataScadenzaPagamento><ImportoPagamento>794.00</ImportoPagamento><IstitutoFinanziario>Banca Esempio</IstitutoFinanziario><IBAN>IT60X0542811101000000123456</IBAN></DettaglioPagamento>
      <DettaglioPagamento><ModalitaPagamento>MP05</ModalitaPagamento><DataScadenzaPagamento>2026-12-31</DataScadenzaPagamento><ImportoPagamento>794.00</ImportoPagamento><IBAN>IT60X0542811101000000123456</IBAN></DettaglioPagamento>
    </DatiPagamento>
  </FatturaElettronicaBody>
</p:FatturaElettronica>`
};

// Run the Actor and wait for it to finish
const run = await client.actor("hardreset83/fatturapa-to-excel").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "invoiceUrls": [],
    "xmlContent": """<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<p:FatturaElettronica versione=\"FPR12\" xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\" xmlns:p=\"http://ivaservizi.agenziaentrate.gov.it/docs/xsd/fatture/v1.2\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">
  <FatturaElettronicaHeader>
    <DatiTrasmissione>
      <IdTrasmittente><IdPaese>IT</IdPaese><IdCodice>01234567890</IdCodice></IdTrasmittente>
      <ProgressivoInvio>00001</ProgressivoInvio>
      <FormatoTrasmissione>FPR12</FormatoTrasmissione>
      <CodiceDestinatario>ABC1234</CodiceDestinatario>
    </DatiTrasmissione>
    <CedentePrestatore>
      <DatiAnagrafici>
        <IdFiscaleIVA><IdPaese>IT</IdPaese><IdCodice>01234567890</IdCodice></IdFiscaleIVA>
        <CodiceFiscale>01234567890</CodiceFiscale>
        <Anagrafica><Denominazione>Esempio Impianti S.r.l.</Denominazione></Anagrafica>
        <RegimeFiscale>RF01</RegimeFiscale>
      </DatiAnagrafici>
      <Sede><Indirizzo>Via Roma</Indirizzo><NumeroCivico>10</NumeroCivico><CAP>20100</CAP><Comune>Milano</Comune><Provincia>MI</Provincia><Nazione>IT</Nazione></Sede>
      <IscrizioneREA><Ufficio>MI</Ufficio><NumeroREA>123456</NumeroREA><StatoLiquidazione>LN</StatoLiquidazione></IscrizioneREA>
      <Contatti><Telefono>021234567</Telefono><Email>info@esempio.it</Email></Contatti>
    </CedentePrestatore>
    <CessionarioCommittente>
      <DatiAnagrafici>
        <IdFiscaleIVA><IdPaese>IT</IdPaese><IdCodice>09876543210</IdCodice></IdFiscaleIVA>
        <Anagrafica><Denominazione>Cliente Prova S.p.A.</Denominazione></Anagrafica>
      </DatiAnagrafici>
      <Sede><Indirizzo>Corso Italia</Indirizzo><NumeroCivico>5</NumeroCivico><CAP>00100</CAP><Comune>Roma</Comune><Provincia>RM</Provincia><Nazione>IT</Nazione></Sede>
    </CessionarioCommittente>
  </FatturaElettronicaHeader>
  <FatturaElettronicaBody>
    <DatiGenerali>
      <DatiGeneraliDocumento>
        <TipoDocumento>TD01</TipoDocumento>
        <Divisa>EUR</Divisa>
        <Data>2026-10-31</Data>
        <Numero>2026/145</Numero>
        <DatiBollo><BolloVirtuale>SI</BolloVirtuale><ImportoBollo>2.00</ImportoBollo></DatiBollo>
        <ImportoTotaleDocumento>1320.00</ImportoTotaleDocumento>
        <Causale>Installazione impianto domotico</Causale>
        <Causale>Commessa 88</Causale>
      </DatiGeneraliDocumento>
      <DatiOrdineAcquisto><RiferimentoNumeroLinea>1</RiferimentoNumeroLinea><IdDocumento>ORD-77</IdDocumento><Data>2026-10-01</Data></DatiOrdineAcquisto>
      <DatiDDT><NumeroDDT>45</NumeroDDT><DataDDT>2026-10-20</DataDDT></DatiDDT>
    </DatiGenerali>
    <DatiBeniServizi>
      <DettaglioLinee>
        <NumeroLinea>1</NumeroLinea>
        <CodiceArticolo><CodiceTipo>INTERNO</CodiceTipo><CodiceValore>HUB-01</CodiceValore></CodiceArticolo>
        <Descrizione>Centralina domotica</Descrizione>
        <Quantita>2.00</Quantita>
        <UnitaMisura>PZ</UnitaMisura>
        <PrezzoUnitario>500.00</PrezzoUnitario>
        <ScontoMaggiorazione><Tipo>SC</Tipo><Percentuale>10.00</Percentuale></ScontoMaggiorazione>
        <PrezzoTotale>900.00</PrezzoTotale>
        <AliquotaIVA>22.00</AliquotaIVA>
      </DettaglioLinee>
      <DettaglioLinee>
        <NumeroLinea>2</NumeroLinea>
        <Descrizione>Manodopera installazione</Descrizione>
        <Quantita>4.00</Quantita>
        <UnitaMisura>ORE</UnitaMisura>
        <PrezzoUnitario>50.00</PrezzoUnitario>
        <PrezzoTotale>200.00</PrezzoTotale>
        <AliquotaIVA>10.00</AliquotaIVA>
      </DettaglioLinee>
      <DettaglioLinee>
        <NumeroLinea>3</NumeroLinea>
        <Descrizione>Rimborso bollo</Descrizione>
        <Quantita>1.00</Quantita>
        <PrezzoUnitario>2.00</PrezzoUnitario>
        <PrezzoTotale>2.00</PrezzoTotale>
        <AliquotaIVA>0.00</AliquotaIVA>
        <Natura>N1</Natura>
      </DettaglioLinee>
      <DatiRiepilogo><AliquotaIVA>22.00</AliquotaIVA><ImponibileImporto>900.00</ImponibileImporto><Imposta>198.00</Imposta><EsigibilitaIVA>I</EsigibilitaIVA></DatiRiepilogo>
      <DatiRiepilogo><AliquotaIVA>10.00</AliquotaIVA><ImponibileImporto>200.00</ImponibileImporto><Imposta>20.00</Imposta><EsigibilitaIVA>I</EsigibilitaIVA></DatiRiepilogo>
      <DatiRiepilogo><AliquotaIVA>0.00</AliquotaIVA><Natura>N1</Natura><ImponibileImporto>2.00</ImponibileImporto><Imposta>0.00</Imposta><RiferimentoNormativo>Escluse art.15</RiferimentoNormativo></DatiRiepilogo>
    </DatiBeniServizi>
    <DatiPagamento>
      <CondizioniPagamento>TP01</CondizioniPagamento>
      <DettaglioPagamento><ModalitaPagamento>MP05</ModalitaPagamento><DataScadenzaPagamento>2026-11-30</DataScadenzaPagamento><ImportoPagamento>794.00</ImportoPagamento><IstitutoFinanziario>Banca Esempio</IstitutoFinanziario><IBAN>IT60X0542811101000000123456</IBAN></DettaglioPagamento>
      <DettaglioPagamento><ModalitaPagamento>MP05</ModalitaPagamento><DataScadenzaPagamento>2026-12-31</DataScadenzaPagamento><ImportoPagamento>794.00</ImportoPagamento><IBAN>IT60X0542811101000000123456</IBAN></DettaglioPagamento>
    </DatiPagamento>
  </FatturaElettronicaBody>
</p:FatturaElettronica>
""",
}

# Run the Actor and wait for it to finish
run = client.actor("hardreset83/fatturapa-to-excel").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "invoiceUrls": [],
  "xmlContent": "<?xml version=\\"1.0\\" encoding=\\"UTF-8\\"?>\\n<p:FatturaElettronica versione=\\"FPR12\\" xmlns:ds=\\"http://www.w3.org/2000/09/xmldsig#\\" xmlns:p=\\"http://ivaservizi.agenziaentrate.gov.it/docs/xsd/fatture/v1.2\\" xmlns:xsi=\\"http://www.w3.org/2001/XMLSchema-instance\\">\\n  <FatturaElettronicaHeader>\\n    <DatiTrasmissione>\\n      <IdTrasmittente><IdPaese>IT</IdPaese><IdCodice>01234567890</IdCodice></IdTrasmittente>\\n      <ProgressivoInvio>00001</ProgressivoInvio>\\n      <FormatoTrasmissione>FPR12</FormatoTrasmissione>\\n      <CodiceDestinatario>ABC1234</CodiceDestinatario>\\n    </DatiTrasmissione>\\n    <CedentePrestatore>\\n      <DatiAnagrafici>\\n        <IdFiscaleIVA><IdPaese>IT</IdPaese><IdCodice>01234567890</IdCodice></IdFiscaleIVA>\\n        <CodiceFiscale>01234567890</CodiceFiscale>\\n        <Anagrafica><Denominazione>Esempio Impianti S.r.l.</Denominazione></Anagrafica>\\n        <RegimeFiscale>RF01</RegimeFiscale>\\n      </DatiAnagrafici>\\n      <Sede><Indirizzo>Via Roma</Indirizzo><NumeroCivico>10</NumeroCivico><CAP>20100</CAP><Comune>Milano</Comune><Provincia>MI</Provincia><Nazione>IT</Nazione></Sede>\\n      <IscrizioneREA><Ufficio>MI</Ufficio><NumeroREA>123456</NumeroREA><StatoLiquidazione>LN</StatoLiquidazione></IscrizioneREA>\\n      <Contatti><Telefono>021234567</Telefono><Email>info@esempio.it</Email></Contatti>\\n    </CedentePrestatore>\\n    <CessionarioCommittente>\\n      <DatiAnagrafici>\\n        <IdFiscaleIVA><IdPaese>IT</IdPaese><IdCodice>09876543210</IdCodice></IdFiscaleIVA>\\n        <Anagrafica><Denominazione>Cliente Prova S.p.A.</Denominazione></Anagrafica>\\n      </DatiAnagrafici>\\n      <Sede><Indirizzo>Corso Italia</Indirizzo><NumeroCivico>5</NumeroCivico><CAP>00100</CAP><Comune>Roma</Comune><Provincia>RM</Provincia><Nazione>IT</Nazione></Sede>\\n    </CessionarioCommittente>\\n  </FatturaElettronicaHeader>\\n  <FatturaElettronicaBody>\\n    <DatiGenerali>\\n      <DatiGeneraliDocumento>\\n        <TipoDocumento>TD01</TipoDocumento>\\n        <Divisa>EUR</Divisa>\\n        <Data>2026-10-31</Data>\\n        <Numero>2026/145</Numero>\\n        <DatiBollo><BolloVirtuale>SI</BolloVirtuale><ImportoBollo>2.00</ImportoBollo></DatiBollo>\\n        <ImportoTotaleDocumento>1320.00</ImportoTotaleDocumento>\\n        <Causale>Installazione impianto domotico</Causale>\\n        <Causale>Commessa 88</Causale>\\n      </DatiGeneraliDocumento>\\n      <DatiOrdineAcquisto><RiferimentoNumeroLinea>1</RiferimentoNumeroLinea><IdDocumento>ORD-77</IdDocumento><Data>2026-10-01</Data></DatiOrdineAcquisto>\\n      <DatiDDT><NumeroDDT>45</NumeroDDT><DataDDT>2026-10-20</DataDDT></DatiDDT>\\n    </DatiGenerali>\\n    <DatiBeniServizi>\\n      <DettaglioLinee>\\n        <NumeroLinea>1</NumeroLinea>\\n        <CodiceArticolo><CodiceTipo>INTERNO</CodiceTipo><CodiceValore>HUB-01</CodiceValore></CodiceArticolo>\\n        <Descrizione>Centralina domotica</Descrizione>\\n        <Quantita>2.00</Quantita>\\n        <UnitaMisura>PZ</UnitaMisura>\\n        <PrezzoUnitario>500.00</PrezzoUnitario>\\n        <ScontoMaggiorazione><Tipo>SC</Tipo><Percentuale>10.00</Percentuale></ScontoMaggiorazione>\\n        <PrezzoTotale>900.00</PrezzoTotale>\\n        <AliquotaIVA>22.00</AliquotaIVA>\\n      </DettaglioLinee>\\n      <DettaglioLinee>\\n        <NumeroLinea>2</NumeroLinea>\\n        <Descrizione>Manodopera installazione</Descrizione>\\n        <Quantita>4.00</Quantita>\\n        <UnitaMisura>ORE</UnitaMisura>\\n        <PrezzoUnitario>50.00</PrezzoUnitario>\\n        <PrezzoTotale>200.00</PrezzoTotale>\\n        <AliquotaIVA>10.00</AliquotaIVA>\\n      </DettaglioLinee>\\n      <DettaglioLinee>\\n        <NumeroLinea>3</NumeroLinea>\\n        <Descrizione>Rimborso bollo</Descrizione>\\n        <Quantita>1.00</Quantita>\\n        <PrezzoUnitario>2.00</PrezzoUnitario>\\n        <PrezzoTotale>2.00</PrezzoTotale>\\n        <AliquotaIVA>0.00</AliquotaIVA>\\n        <Natura>N1</Natura>\\n      </DettaglioLinee>\\n      <DatiRiepilogo><AliquotaIVA>22.00</AliquotaIVA><ImponibileImporto>900.00</ImponibileImporto><Imposta>198.00</Imposta><EsigibilitaIVA>I</EsigibilitaIVA></DatiRiepilogo>\\n      <DatiRiepilogo><AliquotaIVA>10.00</AliquotaIVA><ImponibileImporto>200.00</ImponibileImporto><Imposta>20.00</Imposta><EsigibilitaIVA>I</EsigibilitaIVA></DatiRiepilogo>\\n      <DatiRiepilogo><AliquotaIVA>0.00</AliquotaIVA><Natura>N1</Natura><ImponibileImporto>2.00</ImponibileImporto><Imposta>0.00</Imposta><RiferimentoNormativo>Escluse art.15</RiferimentoNormativo></DatiRiepilogo>\\n    </DatiBeniServizi>\\n    <DatiPagamento>\\n      <CondizioniPagamento>TP01</CondizioniPagamento>\\n      <DettaglioPagamento><ModalitaPagamento>MP05</ModalitaPagamento><DataScadenzaPagamento>2026-11-30</DataScadenzaPagamento><ImportoPagamento>794.00</ImportoPagamento><IstitutoFinanziario>Banca Esempio</IstitutoFinanziario><IBAN>IT60X0542811101000000123456</IBAN></DettaglioPagamento>\\n      <DettaglioPagamento><ModalitaPagamento>MP05</ModalitaPagamento><DataScadenzaPagamento>2026-12-31</DataScadenzaPagamento><ImportoPagamento>794.00</ImportoPagamento><IBAN>IT60X0542811101000000123456</IBAN></DettaglioPagamento>\\n    </DatiPagamento>\\n  </FatturaElettronicaBody>\\n</p:FatturaElettronica>\\n"
}' |
apify call hardreset83/fatturapa-to-excel --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,hardreset83/fatturapa-to-excel"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/TJBh1au64HW0miRWA/builds/uvIhzYi0dheR7S2Ef/openapi.json
