CSV to FatturaPA Mapping Reference
This document describes how the standard Transfer CSV fields are mapped to the Italian FatturaPA XML invoice format.
DatiTrasmissione
| FatturaPA Field | CSV Source | Req. | Default | Condition | Description |
|---|---|---|---|---|---|
| fatturaElettronicaHeader.datiTrasmissione.pecDestinatario | recipient_pec | No | recipient PEC address, lowercased. Computed: businessRegistry.pec. Converted to lowercase | ||
| fatturaElettronicaHeader.datiTrasmissione.codiceDestinatario | recipient_code | No | SDI recipient code, uppercased and stripped of spaces. Converted to uppercase. Transform: strReplace | ||
| fatturaElettronicaHeader.datiTrasmissione.formatoTrasmissione | No | FPR12 | private recipient transmission format | ||
| fatturaElettronicaHeader.soggettoEmittente | No | CC | the row is a self invoice, so seller and buyer swap source | CC, the buyer issues the document, on self invoices |
CedentePrestatore
| FatturaPA Field | CSV Source | Req. | Default | Condition | Description |
|---|---|---|---|---|---|
| fatturaElettronicaHeader.cedentePrestatore.datiAnagrafici.idFiscaleIva.idPaese | recipient_country | No | the seller VAT number is present in the source that applies | seller VAT country code, uppercased. Computed: businessRegistry.country. Converted to uppercase | |
| fatturaElettronicaHeader.cedentePrestatore.datiAnagrafici.idFiscaleIva.idCodice | recipient_vat_number | No | the seller VAT number is present in the source that applies | seller VAT number. Computed: businessRegistry.vatNumber | |
| fatturaElettronicaHeader.cedentePrestatore.datiAnagrafici.codiceFiscale | recipient_fiscal_code | No | seller fiscal code. Computed: businessRegistry.fiscalCode | ||
| fatturaElettronicaHeader.cedentePrestatore.datiAnagrafici.regimeFiscale | No | RF01 | seller tax regime, ordinary regime by default | ||
| fatturaElettronicaHeader.cedentePrestatore.datiAnagrafici.anagrafica.denominazione | recipient_business_name | No | seller company name. Computed: businessRegistry.businessName | ||
| fatturaElettronicaHeader.cedentePrestatore.datiAnagrafici.anagrafica.nome | recipient_name | No | the seller has no company name, first and last name are used instead | seller first name, when no company name is available. Computed: businessRegistry.name | |
| fatturaElettronicaHeader.cedentePrestatore.datiAnagrafici.anagrafica.cognome | recipient_last_name | No | the seller has no company name, first and last name are used instead | seller last name, when no company name is available. Computed: businessRegistry.lastName | |
| fatturaElettronicaHeader.cedentePrestatore.sede.indirizzo | recipient_address | No | seller street. Computed: businessRegistry.address | ||
| fatturaElettronicaHeader.cedentePrestatore.sede.comune | recipient_city | No | seller municipality. Computed: businessRegistry.city | ||
| fatturaElettronicaHeader.cedentePrestatore.sede.cAP | recipient_postal_code | No | seller postal code. Computed: businessRegistry.postalCode | ||
| fatturaElettronicaHeader.cedentePrestatore.sede.nazione | recipient_country | No | seller country. Computed: businessRegistry.country | ||
| fatturaElettronicaHeader.cedentePrestatore.sede.provincia | recipient_province | No | seller province. Computed: businessRegistry.province |
CessionarioCommittente
| FatturaPA Field | CSV Source | Req. | Default | Condition | Description |
|---|---|---|---|---|---|
| fatturaElettronicaHeader.cessionarioCommittente.datiAnagrafici.idFiscaleIva.idPaese | recipient_country | No | the buyer VAT number is present in the source that applies | buyer VAT country code. Computed: businessRegistry.country | |
| fatturaElettronicaHeader.cessionarioCommittente.datiAnagrafici.idFiscaleIva.idCodice | recipient_vat_number | No | the buyer VAT number is present in the source that applies | buyer VAT number. Computed: businessRegistry.vatNumber | |
| fatturaElettronicaHeader.cessionarioCommittente.datiAnagrafici.codiceFiscale | recipient_fiscal_code | No | buyer fiscal code. Computed: businessRegistry.fiscalCode | ||
| fatturaElettronicaHeader.cessionarioCommittente.datiAnagrafici.anagrafica.denominazione | recipient_business_name | No | buyer company name. Computed: businessRegistry.businessName | ||
| fatturaElettronicaHeader.cessionarioCommittente.datiAnagrafici.anagrafica.nome | recipient_name | No | the buyer has no company name, first and last name are used instead | buyer first name, when no company name is available. Computed: businessRegistry.name | |
| fatturaElettronicaHeader.cessionarioCommittente.datiAnagrafici.anagrafica.cognome | recipient_last_name | No | the buyer has no company name, first and last name are used instead | buyer last name, when no company name is available. Computed: businessRegistry.lastName | |
| fatturaElettronicaHeader.cessionarioCommittente.sede.indirizzo | recipient_address | No | buyer street. Computed: businessRegistry.address | ||
| fatturaElettronicaHeader.cessionarioCommittente.sede.cAP | recipient_postal_code | No | buyer postal code. Computed: businessRegistry.postalCode | ||
| fatturaElettronicaHeader.cessionarioCommittente.sede.nazione | recipient_country | No | buyer country. Computed: businessRegistry.country | ||
| fatturaElettronicaHeader.cessionarioCommittente.sede.comune | recipient_city | No | buyer municipality. Computed: businessRegistry.city | ||
| fatturaElettronicaHeader.cessionarioCommittente.sede.provincia | recipient_province | No | buyer province. Computed: businessRegistry.province |
DatiGeneraliDocumento
| FatturaPA Field | CSV Source | Req. | Default | Condition | Description |
|---|---|---|---|---|---|
| fatturaElettronicaBody[0].datiGenerali.datiGeneraliDocumento.tipoDocumento | document_type | No | document type, TD01 for an invoice and TD04 for a credit note | ||
| fatturaElettronicaBody[0].datiGenerali.datiGeneraliDocumento.data | invoice_date | No | invoice date, read as day/month/year. Formatted as date (d/m/Y) | ||
| fatturaElettronicaBody[0].datiGenerali.datiGeneraliDocumento.numero | invoice_number | No | getNumero({invoice_series}) | invoice number, generated from the series when the column is empty. Transform: substitute | |
| fatturaElettronicaBody[0].datiGenerali.datiGeneraliDocumento.causale | invoice_subject | No | the invoice subject column is filled | invoice subject, when the column is filled. Transform: cast | |
| fatturaElettronicaBody[0].datiGenerali.datiGeneraliDocumento.divisa | No | EUR | invoice currency |
DettaglioLinee
| FatturaPA Field | CSV Source | Req. | Default | Condition | Description |
|---|---|---|---|---|---|
| fatturaElettronicaBody[0].datiBeniServizi.dettaglioLinee | No | invoice lines, one group per line number. Grouped by line_number |
fatturaElettronicaBody[0].datiBeniServizi.dettaglioLinee
| FatturaPA Field | CSV Source | Req. | Default | Condition | Description |
|---|---|---|---|---|---|
| numeroLinea | line_number | No | line number | ||
| descrizione | line_description | No | line description | ||
| aliquotaIVA | line_vat_rate | No | VAT rate, two decimals. Transform: formatString | ||
| natura | line_vat_nature | No | the line VAT rate is zero | VAT exemption nature, required when the rate is zero | |
| quantita | line_quantity | No | quantity, two decimals. Transform: formatString | ||
| prezzoUnitario | line_unit_price | No | unit price, 2 to 8 decimals. Transform: numberFormat | ||
| prezzoTotale | No | 0 | line total, quantity multiplied by unit price. Computed: get(row, 'line_quantity') * get(row, 'line_unit_price'). Transform: numberFormat |
DatiRiepilogo
| FatturaPA Field | CSV Source | Req. | Default | Condition | Description |
|---|---|---|---|---|---|
| fatturaElettronicaBody[0].datiBeniServizi.datiRiepilogo | No | `` | VAT summary computed from the lines, split payment aware. Computed: getValue(output, "fatturaElettronicaBody[0].datiBeniServizi.dettaglioLinee"). Transform: calculateInvoiceItDatiRiepilogo | ||
| fatturaElettronicaBody[0].datiGenerali.datiGeneraliDocumento.importoTotaleDocumento | No | 0.00 | document total computed from the VAT summary. Computed: getValue(output, "fatturaElettronicaBody[0].datiBeniServizi.datiRiepilogo"). Transform: calculateInvoiceItTotalAmount |
DatiPagamento
| FatturaPA Field | CSV Source | Req. | Default | Condition | Description |
|---|---|---|---|---|---|
| fatturaElettronicaBody[0].datiPagamento[0].condizioniPagamento | No | TP02 | payment terms, full payment by default | ||
| fatturaElettronicaBody[0].datiPagamento[0].dettaglioPagamento[0].modalitaPagamento | payment | No | payment method | ||
| fatturaElettronicaBody[0].datiPagamento[0].dettaglioPagamento[0].importoPagamento | No | 0.00 | amount to pay, computed from the VAT summary and net of VAT under split payment. Computed: getValue(output, "fatturaElettronicaBody[0].datiBeniServizi.datiRiepilogo"). Transform: calculateInvoiceItTotalAmount | ||
| fatturaElettronicaBody[0].datiPagamento[0].dettaglioPagamento[0].iban | payment_iban | No | beneficiary IBAN | ||
| fatturaElettronicaBody[0].datiPagamento[0].dettaglioPagamento[0].data_scadenza_pagamento | payment_due_date | No | payment due date, read as day/month/year. Formatted as date (d/m/Y) |