> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gobl.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Italy SDI FatturaPA v1.x

Key: `it-sdi-v1`

Module: [github.com/invopop/gobl.it.sdi](https://github.com/invopop/gobl.it.sdi)

Italy exchanges electronic invoices in the FatturaPA XML format through the tax
authority's Sistema di Interscambio (SDI). This addon ensures a GOBL document has
the fields and extensions needed to produce a valid FatturaPA file with
[gobl.fatturapa](https://github.com/invopop/gobl.it.sdi).

## Customer identification

Every customer needs a `tax_id`, and what you put in it depends on who they are. For
an Italian business, use their partita IVA (VAT number). An Italian private
individual has no VAT number, so give the country alone and put their codice
fiscale in an identity with the key `it-fiscal-code`. For a customer outside Italy,
give the country, and their VAT number if they have one.

In your GOBL document you can declare two kinds of inbox to tell SDI where the
invoice should be delivered: `it-sdi-code` for a codice destinatario, and
`it-sdi-pec` for a PEC address, which goes in the inbox's `email` field. You can
declare both. A FatturaPA document supports only one destination field, so the
conversion prioritises the codice destinatario when it is available, and omits the
PEC.

FatturaPA always asks for a recipient code, and for a tax number when the party is
a business. Some customers have neither, so the format defines a fixed value for
each case and the conversion writes it for you.

A codice destinatario names a channel accredited with SDI, so only recipients in
Italy have one. An Italian customer who receives by PEC, or who has not given you
a code, gets `0000000`. A customer outside Italy has none, and SDI cannot deliver
there anyway, so they get `XXXXXXX`. The conversion takes it from the country, and
any inbox on that customer makes no difference.

The tax number follows the same idea. A party outside Italy with no VAT number
gets `0000000`. A business outside the EU has a tax number, but SDI can only check
EU VAT numbers, so the conversion replaces it with `OO99999999999`, on suppliers
as much as customers. An Italian private individual needs no placeholder: their
codice fiscale identifies them, and the conversion writes no tax number for them.

## Simplified invoices

Add the `simplified` tag to issue a fattura semplificata (format `FSM10`,
document types `TD07`, `TD08` and `TD09`). The customer then needs only a partita
IVA or codice fiscale; a name is sent only together with an address. The total may
not exceed 400.00 EUR unless the supplier is in regime `RF19` or `RF20` or it is a
credit or debit note correcting a preceding invoice, and every charge and discount
needs a VAT combo,
since the format lists them as entries alongside the lines. A credit or debit note
must identify the invoice it corrects, with its date and the reason. Simplified invoices
cannot go to a public administration, carry retained taxes or fund contributions,
or cover intra-EU supplies (art. 21-bis DPR 633/72). Sales to a habitual exporter
(`N3.5`) and stamp duty exemptions (`NB1`, `NB2`, `NB3`) need the ordinary format,
the only one that carries the declaration of intent and those codes.

## Scenarios

### bill/invoice

<Accordion title="Private Invoice">
  **Filters:**

  * *(none)*

  **Output:**

  * **Extensions:** `it-sdi-format:FPR12`
</Accordion>

<Accordion title="Government Invoice">
  **Filters:**

  * **Tags:** `b2g`

  **Output:**

  * **Extensions:** `it-sdi-format:FPA12`
</Accordion>

<Accordion title="Simplified Invoice">
  **Filters:**

  * **Tags:** `simplified`

  **Output:**

  * **Extensions:** `it-sdi-format:FSM10`
</Accordion>

<Accordion title="Regular Invoice">
  **Filters:**

  * **Types:** `standard`

  **Output:**

  * **Extensions:** `it-sdi-document-type:TD01`
</Accordion>

<Accordion title="Advance or down payment on invoice">
  **Filters:**

  * **Types:** `standard`
  * **Tags:** `partial`

  **Output:**

  * **Extensions:** `it-sdi-document-type:TD02`
</Accordion>

<Accordion title="Credit Note">
  **Filters:**

  * **Types:** `credit-note`

  **Output:**

  * **Extensions:** `it-sdi-document-type:TD04`
</Accordion>

<Accordion title="Debit Note">
  **Filters:**

  * **Types:** `debit-note`

  **Output:**

  * **Extensions:** `it-sdi-document-type:TD05`
</Accordion>

<Accordion title="Freelancer invoice with retained taxes">
  **Filters:**

  * **Types:** `standard`
  * **Tags:** `freelance`

  **Output:**

  * **Extensions:** `it-sdi-document-type:TD06`
</Accordion>

<Accordion title="Advance or down payment on freelance invoice">
  **Filters:**

  * **Types:** `standard`
  * **Tags:** `partial`, `freelance`

  **Output:**

  * **Extensions:** `it-sdi-document-type:TD03`
</Accordion>

<Accordion title="Simplified Invoice">
  **Filters:**

  * **Types:** `standard`
  * **Tags:** `simplified`

  **Output:**

  * **Extensions:** `it-sdi-document-type:TD07`
</Accordion>

<Accordion title="Simplified Credit Note">
  **Filters:**

  * **Types:** `credit-note`
  * **Tags:** `simplified`

  **Output:**

  * **Extensions:** `it-sdi-document-type:TD08`
</Accordion>

<Accordion title="Simplified Debit Note">
  **Filters:**

  * **Types:** `debit-note`
  * **Tags:** `simplified`

  **Output:**

  * **Extensions:** `it-sdi-document-type:TD09`
</Accordion>

<Accordion title="Self-billed for self consumption or for free transfer without recourse">
  **Filters:**

  * **Types:** `standard`
  * **Tags:** `self-billed`

  **Output:**

  * **Extensions:** `it-sdi-document-type:TD27`
</Accordion>

<Accordion title="Reverse charge">
  **Filters:**

  * **Types:** `standard`
  * **Tags:** `self-billed`, `reverse-charge`

  **Output:**

  * **Extensions:** `it-sdi-document-type:TD16`, `it-sdi-issuer-type:CC`
</Accordion>

<Accordion title="Self-billed Import">
  **Filters:**

  * **Types:** `standard`
  * **Tags:** `self-billed`, `import`

  **Output:**

  * **Extensions:** `it-sdi-document-type:TD17`, `it-sdi-issuer-type:CC`
</Accordion>

<Accordion title="Self-billed EU Goods Import">
  **Filters:**

  * **Types:** `standard`
  * **Tags:** `self-billed`, `import`, `goods-eu`

  **Output:**

  * **Extensions:** `it-sdi-document-type:TD18`, `it-sdi-issuer-type:CC`
</Accordion>

<Accordion title="Self-billed Goods Import">
  **Filters:**

  * **Types:** `standard`
  * **Tags:** `self-billed`, `import`, `goods`

  **Output:**

  * **Extensions:** `it-sdi-document-type:TD19`, `it-sdi-issuer-type:CC`
</Accordion>

<Accordion title="Self-billed Regularization">
  **Filters:**

  * **Types:** `standard`
  * **Tags:** `self-billed`, `regularization`

  **Output:**

  * **Extensions:** `it-sdi-document-type:TD20`, `it-sdi-issuer-type:CC`
</Accordion>

<Accordion title="Self-billed invoice when ceiling exceeded">
  **Filters:**

  * **Types:** `standard`
  * **Tags:** `self-billed`, `ceiling-exceeded`

  **Output:**

  * **Extensions:** `it-sdi-document-type:TD21`
</Accordion>

<Accordion title="Self-billed for goods extracted from VAT warehouse">
  **Filters:**

  * **Types:** `standard`
  * **Tags:** `self-billed`, `goods-extracted`

  **Output:**

  * **Extensions:** `it-sdi-document-type:TD22`, `it-sdi-issuer-type:CC`
</Accordion>

<Accordion title="Self-billed for goods extracted from VAT warehouse with VAT payment">
  **Filters:**

  * **Types:** `standard`
  * **Tags:** `self-billed`, `goods-with-tax`

  **Output:**

  * **Extensions:** `it-sdi-document-type:TD23`, `it-sdi-issuer-type:CC`
</Accordion>

<Accordion title="Deferred invoice ex art.21, c.4, lett. a) DPR 633/72">
  **Filters:**

  * **Types:** `standard`
  * **Tags:** `deferred`

  **Output:**

  * **Extensions:** `it-sdi-document-type:TD24`
</Accordion>

<Accordion title="Deferred invoice ex art.21, c.4, third period lett. b) DPR 633/72">
  **Filters:**

  * **Types:** `standard`
  * **Tags:** `deferred`, `third-period`

  **Output:**

  * **Extensions:** `it-sdi-document-type:TD25`
</Accordion>

<Accordion title="Sale of depreciable assets and for internal transfers (ex art.36 DPR 633/72)">
  **Filters:**

  * **Types:** `standard`
  * **Tags:** `depreciable-assets`

  **Output:**

  * **Extensions:** `it-sdi-document-type:TD26`
</Accordion>

<Accordion title="Purchases from San Marino with VAT (paper invoice)">
  **Filters:**

  * **Types:** `standard`
  * **Tags:** `self-billed`, `san-marino-paper`

  **Output:**

  * **Extensions:** `it-sdi-document-type:TD28`, `it-sdi-issuer-type:CC`
</Accordion>

## Extensions

### SDI Transmission Format

Code used to describe the transmission format of the invoice. It is set
during calculation from the invoice's tags: "FPA12" when the invoice
carries the "b2g" tag, "FSM10" when it carries the "simplified" tag,
and "FPR12" otherwise.

<Accordion title="it-sdi-format">
  | Code | Name |
  | - | - |
  | `FPA12` | Public Administration |
  | `FPR12` | Private Parties (default) |
  | `FSM10` | Private Parties, Simplified |
</Accordion>

### SDI Document Type

Code used to describe the type of document being sent to the SDI. This is
used to determine the correct schema to use when validating the document.

<Accordion title="it-sdi-document-type">
  | Code | Name |
  | - | - |
  | `TD01` | Regular Invoice |
  | `TD02` | Advance or down payment on invoice |
  | `TD03` | Advance or down payment on freelance invoice |
  | `TD04` | Credit Note |
  | `TD05` | Debit Note |
  | `TD06` | Freelancer invoice with retained taxes |
  | `TD07` | Simplified Invoice |
  | `TD08` | Simplified Credit Note |
  | `TD09` | Simplified Debit Note |
  | `TD16` | Reverse charge |
  | `TD17` | Self-billed Import |
  | `TD18` | Self-billed EU Goods Import |
  | `TD19` | Self-billed Goods Import |
  | `TD20` | Self-billed Regularization |
  | `TD21` | Self-billed invoice when ceiling exceeded |
  | `TD22` | Self-billed for goods extracted from VAT warehouse |
  | `TD23` | Self-billed for goods extracted from VAT warehouse with VAT payment |
  | `TD24` | Deferred invoice ex art.21, c.4, lett. a) DPR 633/72 |
  | `TD25` | Deferred invoice ex art.21, c.4, third period lett. b) DPR 633/72 |
  | `TD26` | Sale of depreciable assets and for internal transfers (ex art.36 DPR 633/72) |
  | `TD27` | Self-billed for self consumption or for free transfer without recourse |
  | `TD28` | Purchases from San Marino with VAT (paper invoice) |
</Accordion>

### Fiscal Regime Code

<Accordion title="it-sdi-fiscal-regime">
  | Code | Name |
  | - | - |
  | `RF01` | Ordinary |
  | `RF02` | Minimum taxpayers (Art. 1, section 96-117, Italian Law 244/07) |
  | `RF04` | Agriculture and connected activities and fishing (Arts. 34 and 34-bis, Italian Presidential Decree 633/72) |
  | `RF05` | Sale of salts and tobaccos (Art. 74, section 1, Italian Presidential Decree 633/72) |
  | `RF06` | Match sales (Art. 74, section 1, Italian Presidential Decree 633/72) |
  | `RF07` | Publishing (Art. 74, section 1, Italian Presidential Decree 633/72) |
  | `RF08` | Management of public telephone services (Art. 74, section 1, Italian Presidential Decree 633/72) |
  | `RF09` | Resale of public transport and parking documents (Art. 74, section 1, Italian Presidential Decree 633/72) |
  | `RF10` | Entertainment, gaming and other activities referred to by the tariff attached to Italian Presidential Decree 640/72 (Art. 74, section 6, Italian Presidential Decree 633/72) |
  | `RF11` | Travel and tourism agencies (Art. 74-ter, Italian Presidential Decree 633/72) |
  | `RF12` | Farmhouse accommodation/restaurants (Art. 5, section 2, Italian law 413/91) |
  | `RF13` | Door-to-door sales (Art. 25-bis, section 6, Italian Presidential Decree 600/73) |
  | `RF14` | Resale of used goods, artworks, antiques or collector's items (Art. 36, Italian Decree Law 41/95) |
  | `RF15` | Artwork, antiques or collector's items auction agencies (Art. 40-bis, Italian Decree Law 41/95) |
  | `RF16` | VAT paid in cash by P.A. (Art. 6, section 5, Italian Presidential Decree 633/72) |
  | `RF17` | VAT paid in cash by subjects with business turnover below Euro 200,000 (Art. 7, Italian Decree Law 185/2008) |
  | `RF19` | Flat rate (Art. 1, section 54-89, Italian Law 190/2014) |
  | `RF18` | Other |
  | `RF20` | Cross-border VAT franchise (EU Directive 2020/285) |
</Accordion>

### Exemption Code

<Accordion title="it-sdi-exempt">
  | Code | Name |
  | - | - |
  | `N1` | Excluded pursuant to Art. 15, DPR 633/72 |
  | `N2.1` | Not subject pursuant to Art. 7, DPR 633/72 |
  | `N2.2` | Not subject - other |
  | `N3.1` | Not taxable - exports |
  | `N3.2` | Not taxable - intra-community supplies |
  | `N3.3` | Not taxable - transfers to San Marino |
  | `N3.4` | Not taxable - export supplies of goods and services |
  | `N3.5` | Not taxable - declaration of intent |
  | `N3.6` | Not taxable - other |
  | `N4` | Exempt |
  | `N5` | Margin regime / VAT not exposed |
  | `N6.1` | Reverse charge - Transfer of scrap and of other recyclable materials |
  | `N6.2` | Reverse charge - Transfer of gold and pure silver pursuant to law 7/2000 as well as used jewelery to OPO |
  | `N6.3` | Reverse charge - Construction subcontracting |
  | `N6.4` | Reverse charge - Transfer of buildings |
  | `N6.5` | Reverse charge - Transfer of mobile phones |
  | `N6.6` | Reverse charge - Transfer of electronic products |
  | `N6.7` | Reverse charge - provisions in the construction and related sectors |
  | `N6.8` | Reverse charge - transactions in the energy sector |
  | `N6.9` | Reverse charge - other cases |
  | `N7` | VAT paid in other EU countries (telecommunications, tele-broadcasting and electronic services provision pursuant to Art. 7 -octies letter a, b, art. 74-sexies Italian Presidential Decree 633/72) |
</Accordion>

### Retained Tax Payment Reason Code

<Accordion title="it-sdi-retained">
  | Code | Name |
  | - | - |
  | `A` | Self-employment services falling within the exercise of habitual art or profession |
  | `B` | Economic use of intellectual works, industrial patents, and processes, formulas or information related to experiences gained in the industrial, commercial or scientific field, by the author or inventor |
  | `C` | Profits deriving from contracts of association in participation and from contracts of co-interest, when the contribution consists exclusively of the provision of labor |
  | `D` | Profits due to the promoting partners and founding partners of capital companies |
  | `E` | Bills of exchange protests levied by municipal secretaries |
  | `F` | Allowances paid to honorary justices of the peace and honorary deputy prosecutors |
  | `G` | Allowances paid for the cessation of professional sports activities |
  | `H` | Allowances paid for the termination of agency relationships of individuals and partnerships, excluding amounts accrued up to December 31, 2003, already allocated for competence and taxed as business income |
  | `I` | Allowances paid for the cessation of notarial functions |
  | `J` | Fees paid to occasional truffle collectors not identified for value-added tax purposes, in relation to the sale of truffles |
  | `K` | Universal civil service checks referred to in Article 16 of Legislative Decree no. 40 of March 6, 2017 |
  | `L` | Income deriving from the economic use of intellectual works, industrial patents, and processes, formulas, and information related to experiences gained in the industrial, commercial or scientific field, which are received by those entitled free of charge (e.g. heirs and legatees of the author and inventor) |
  | `L1` | Income deriving from the economic use of intellectual works, industrial patents, and processes, formulas, and information related to experiences gained in the industrial, commercial or scientific field, which are received by subjects who have purchased the rights to their use for valuable consideration |
  | `M` | Self-employment services not carried out habitually |
  | `M1` | Income deriving from the assumption of obligations to do, not to do, or to allow |
  | `M2` | Self-employment services not carried out habitually for which there is an obligation to register with the Separate ENPAPI Management |
  | `N` | Travel allowances, flat-rate reimbursement of expenses, prizes, and fees paid: - in the direct exercise of amateur sports activities; - in relation to coordinated and continuous collaboration relationships of an administrative-managerial nature, not professional, provided in favor of amateur sports companies and associations, and choirs, bands, and amateur theater groups by the director and technical collaborators |
  | `O` | Self-employment services not carried out habitually, for which there is no obligation to register with the separate management (Circ. INPS n. 104/2001) |
  | `O1` | Income deriving from the assumption of obligations to do, not to do, or to allow, for which there is no obligation to register with the separate management (Circ. INPS n. 104/2001) |
  | `P` | Fees paid to non-resident subjects without a permanent establishment for the use or concession of use of industrial, commercial or scientific equipment located in the State's territory or to Swiss companies or permanent establishments of Swiss companies meeting the requirements of Article 15, paragraph 2 of the Agreement between the European Community and the Swiss Confederation of October 26, 2004 (published in G.U.C.E. of December 29, 2004, no. L385/30) |
  | `Q` | Commissions paid to a single-mandate agent or commercial representative |
  | `R` | Commissions paid to a multi-mandate agent or commercial representative |
  | `S` | Commissions paid to a commission agent |
  | `T` | Commissions paid to a broker |
  | `U` | Commissions paid to a business finder |
  | `V` | Commissions paid to a home sales agent; commissions paid to an agent for door-to-door and street sales of daily newspapers and periodicals (Law of February 25, 1987, no. 67) |
  | `V1` | Income deriving from non-habitual commercial activities (e.g. commissions paid for occasional services to agents or commercial representatives, brokers, business finders) |
  | `V2` | Income from non-habitual services provided by direct home sales agents |
  | `W` | Considerations paid in 2021 for services related to subcontracting contracts to which the provisions contained in Article 25-ter of Presidential Decree no. 600 of September 29, 1973, have been applied |
  | `X` | Fees paid in 2004 by resident companies or entities or by permanent establishments of foreign companies referred to in Article 26-quater, paragraph 1, letters a) and b) of Presidential Decree 600 of September 29, 1973, to companies or permanent establishments of companies located in another EU Member State meeting the requirements of the aforementioned Article 26-quater of Presidential Decree 600 of September 29, 1973, for which a refund of the withholding tax was made in 2006 pursuant to Article 4 of Legislative Decree no. 143 of May 30, 2005 |
  | `Y` | Fees paid from January 1, 2005, to July 26, 2005, by resident companies or entities or by permanent establishments of foreign companies referred to in Article 26-quater, paragraph 1, letters a) and b) of Presidential Decree no. 600 of September 29, 1973, to companies or permanent establishments of companies located in another EU Member State meeting the requirements of the aforementioned Article 26-quater of Presidential Decree 600 of September 29, 1973, for which a refund of the withholding tax was made in 2006 pursuant to Article 4 of Legislative Decree no. 143 of May 30, 2005 |
  | `ZO` | Different title from the previous ones |
</Accordion>

### Retained Tax Statutory Rate

Statutory rate of a withholding computed on a reduced taxable base, as
printed in AliquotaRitenuta. Italian withholdings often apply to a fraction
of the line total, such as the 23% withheld on 50% of an agent's commission
(art. 25-bis DPR 600/1973). GOBL has no taxable base per tax, so the combo's
percent must be the effective rate over the whole line (11.50% in that
example) and this extension keeps the statutory one. Set it when the two
differ; ImportoRitenuta is still calculated from the percent, and whether
the pair is coherent is up to the issuer.

<Accordion title="it-sdi-retained-rate">
  Pattern: `^([0-9]{1,2}\.[0-9]{2}|100\.00)$`
</Accordion>

### Payment Means

<Accordion title="it-sdi-payment-means">
  | Code | Name |
  | - | - |
  | `MP01` | Cash |
  | `MP02` | Check |
  | `MP03` | Banker's Draft |
  | `MP04` | Cash at Treasury |
  | `MP05` | Bank Transfer |
  | `MP06` | Promissory Note |
  | `MP07` | Bank payment slip |
  | `MP08` | Payment card |
  | `MP09` | Direct Debit (RID) |
  | `MP10` | Utilities Direct Debit (RID utenze) |
  | `MP11` | Fast Direct Debit (RID veloce) |
  | `MP12` | Direct Debit (RIBA) |
  | `MP13` | Debit Transfer (MAV) |
  | `MP14` | Tax Receipt |
  | `MP15` | Transfer on special account |
  | `MP16` | Direct Debit |
  | `MP17` | Direct Debit Post Office |
  | `MP18` | Post Office Cheque |
  | `MP19` | SEPA Direct Debit |
  | `MP20` | SEPA Core Direct Debit |
  | `MP21` | SEPA B2B Direct Debit |
  | `MP22` | Deductible Netting |
  | `MP23` | PagoPA |
</Accordion>

### VAT Liability

<Accordion title="it-sdi-vat-liability">
  | Code | Name |
  | - | - |
  | `I` | Immediate |
  | `D` | Deferred |
  | `S` | Split Payment |
</Accordion>

### Fund Type

<Accordion title="it-sdi-fund-type">
  | Code | Name |
  | - | - |
  | `TC01` | National Pension and Welfare Fund for Lawyers and Solicitors |
  | `TC02` | Pension fund for accountants |
  | `TC03` | Pension and welfare fund for surveyors |
  | `TC04` | National pension and welfare fund for self-employed engineers and architects |
  | `TC05` | National fund for solicitors |
  | `TC06` | National pension and welfare fund for bookkeepers and commercial experts |
  | `TC07` | National welfare board for sales agents and representatives (ENASARCO) |
  | `TC08` | National pension and welfare board for employment consultants (ENPACL) |
  | `TC09` | National pension and welfare board for doctors (ENPAM) |
  | `TC10` | National pension and welfare board for pharmacists (ENPAF) |
  | `TC11` | National pension and welfare board for veterinary physicians (ENPAV) |
  | `TC12` | National pension and welfare board for agricultural employees (ENPAIA) |
  | `TC13` | Pension fund for employees of shipping companies and maritime agencies |
  | `TC14` | National pension institute for Italian journalists (INPGI) |
  | `TC15` | National welfare board for orphans of Italian doctors (ONAOSI) |
  | `TC16` | Autonomous supplementary welfare fund for Italian journalists (CASAGIT) |
  | `TC17` | Pension board for industrial experts and graduate industrial experts (EPPI) |
  | `TC18` | National multi-category pension and welfare board (EPAP) |
  | `TC19` | National pension and welfare board for biologists (ENPAB) |
  | `TC20` | National pension and welfare board for the nursing profession (ENPAPI) |
  | `TC21` | National pension and welfare board for psychologists (ENPAP) |
  | `TC22` | National Social Security Institute (INPS) |
</Accordion>

### Issuer Type

Says who issued the invoice when it was not the supplier. FatturaPA
requires this in the `SoggettoEmittente` field whenever someone other
than the supplier issues the document (article 21 of DPR 633/1972).

When you name a third party as the ordering `issuer`, because that party
issues the invoice on the supplier's behalf, the addon sets `TZ`.

When your tags select a document the customer issues, the addon sets
`CC` and replaces any value you gave: TD16 to TD20, TD22, TD23 and TD28.
On these the customer sends the document to SDI and the supplier block
names the seller. TD21 and TD27 stay unset, because there the issuer is
both supplier and customer. For any other invoice the customer issued,
set `CC` yourself.

A `CC` invoice cannot also name an ordering `issuer`, because FatturaPA
keeps `TerzoIntermediarioOSoggettoEmittente` for a third party acting for
the supplier.

<Accordion title="it-sdi-issuer-type">
  | Code | Name |
  | - | - |
  | `CC` | Issued by Customer |
  | `TZ` | Issued by Third Party |
</Accordion>

### Liquidation State

Indicates whether the company is in liquidation, used in the
IscrizioneREA block of a FatturaPA document as the
StatoLiquidazione field.

<Accordion title="it-sdi-liquidation-state">
  | Code | Name |
  | - | - |
  | `LS` | In liquidation |
  | `LN` | Not in liquidation |
</Accordion>

### Shareholder State

Indicates the company's shareholder configuration, used in the
IscrizioneREA block of a FatturaPA document as the SocioUnico
field.

<Accordion title="it-sdi-shareholder-state">
  | Code | Name |
  | - | - |
  | `SU` | Sole shareholder |
  | `SM` | Multiple shareholders |
</Accordion>

### SDI Notification

Outcome SDI reports for a submitted invoice, recorded on a
bill.Status line. RC/NS/MC/AT/DT are the codes SDI emits
directly; EC01/EC02 are the recipient responses resolved from a
Notifica Esito.

<Accordion title="it-sdi-notification">
  | Code | Name |
  | - | - |
  | `RC` | Delivery receipt |
  | `NS` | Rejection notice |
  | `MC` | Failed delivery |
  | `AT` | Transmission attestation |
  | `DT` | Deadline expiry |
  | `EC01` | Acceptance |
  | `EC02` | Refusal |
</Accordion>

## Validation Rules

<AccordionGroup>
  <Accordion title="bill.Invoice">
    | Field | Test | Validation Code / Message |
    | - | - | - |
    | <small>Invoice</small> | <ul class="gobl-test"><li>Can convert to \[EUR]</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-22`<br />Invoice must be in EUR or provide exchange rate for conversion |
    | <small>Invoice</small> | <ul class="gobl-test"><li>Invoice number fits</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-44`<br />Invoice number (series and code) must be 20 ASCII characters or fewer |
    | <small>Invoice</small> | <ul class="gobl-test"><li>Payment instructions check</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-21`<br />Payment instructions are required when terms with due dates are present |
    | <small>Invoice</small> | <ul class="gobl-test"><li>Issuer identification check</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-66`<br />Issuer tax ID code or fiscal code is required |
    | <small>Invoice</small> | <ul class="gobl-test"><li>Issuer name check</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-68`<br />Issuer name or people is required |
    | <small>Invoice</small> | <ul class="gobl-test"><li>Customer issuer names no third party</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-49`<br />Ordering issuer must be removed: the customer issued this invoice (issuer type CC, always set for TD16-TD20, TD22, TD23, TD28) |
    | <small>Invoice</small> | <ul class="gobl-test"><li>Ordering issuer is not the customer</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-63`<br />Ordering issuer must not be the customer: remove it and set the issuer type to CC |
    | <small>Invoice</small> | <ul class="gobl-test"><li>Supplier is the customer</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-65`<br />Supplier and customer must be the same party for document types TD21 and TD27 |
    | `tax` | <ul class="gobl-test"><li class="gobl-test-present">Present</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-01`<br />Tax is required |
    | `tax.ext` | <ul class="gobl-test"><li>Ext require \[it-sdi-format, it-sdi-document-type]</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-02`<br />Tax requires 'it-sdi-document-type' and 'it-sdi-format' extensions |
    | `supplier.name` | <ul class="gobl-test"><li>Latin1</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-03`<br />Supplier name must use Latin-1 characters |
    | `supplier.addresses` | <ul class="gobl-test"><li class="gobl-test-present">Present</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-04`<br />Supplier addresses are required |
    | `supplier.ext` | <ul class="gobl-test"><li>Ext require \[it-sdi-fiscal-regime]</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-05`<br />Supplier requires 'it-sdi-fiscal-regime' extension |
    | `supplier.registration.entry` | <ul class="gobl-test"><li class="gobl-test-present">Present</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-06`<br />Supplier registration entry is required when registration is present |
    | `supplier.registration.entry` | <ul class="gobl-test"><li>Matches ^\[\[:ascii:]]{0,20}\$</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-47`<br />Supplier registration entry must be 20 ASCII characters or fewer |
    | `supplier.registration.office` | <ul class="gobl-test"><li class="gobl-test-present">Present</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-07`<br />Supplier registration office is required when registration is present |
    | `supplier.telephones[*].num` | <ul class="gobl-test"><li>Supplier is Italian</li><li>Length between 5 and 12</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-08`<br />Italian telephone number length must be between 5 and 12 |
    | `customer` | <ul class="gobl-test"><li class="gobl-test-present">Present</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-09`<br />Customer is required |
    | `customer.name` | <ul class="gobl-test"><li>Latin1</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-10`<br />Customer name must use Latin-1 characters |
    | `customer.tax_id` | <ul class="gobl-test"><li class="gobl-test-present">Present</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-11`<br />Customer tax ID is required |
    | <small>Invoice</small> | <ul class="gobl-test"><li>Not (simplified invoice)</li><li>Customer name check</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-13`<br />Customer name is required |
    | <small>Invoice</small> | <ul class="gobl-test"><li>Not (simplified invoice)</li><li>Customer people check</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-14`<br />Customer people are required when name is empty |
    | `customer.addresses` | <ul class="gobl-test"><li>Not (simplified invoice)</li><li class="gobl-test-present">Present</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-12`<br />Customer addresses are required |
    | `preceding[*]` | <ul class="gobl-test"><li>Not (simplified invoice)</li><li>Document reference fits</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-45`<br />Preceding document number and item reference must be 20 ASCII characters or fewer |
    | `ordering` | <ul class="gobl-test"><li>Not (simplified invoice)</li><li>Ordering references fit</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-46`<br />Ordering document numbers and item references must be 20 ASCII characters or fewer |
    | `customer.tax_id.code` | <ul class="gobl-test"><li>Italian customer without fiscal code</li><li class="gobl-test-present">Present</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-15`<br />Customer tax ID code is required for Italian parties without fiscal code |
    | `customer.identities` | <ul class="gobl-test"><li>Italian customer without tax ID code</li><li>Has fiscal code</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-16`<br />Customer requires identity with key 'it-fiscal-code' |
    | `lines[*]` | <ul class="gobl-test"><li>Line has tax category VAT</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-17`<br />Line must have VAT tax category |
    | `lines[*].item.name` | <ul class="gobl-test"><li>Latin1</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-18`<br />Item name must use Latin-1 characters |
    | `ordering.despatch[*].issue_date` | <ul class="gobl-test"><li>Has deferred tag</li><li class="gobl-test-present">Present</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-19`<br />Despatch issue date is required |
    | `ordering.despatch` | <ul class="gobl-test"><li>No deferred tag</li><li>Empty</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-20`<br />Despatch can only be set when invoice has deferred tag |
    | `tax.ext` | <ul class="gobl-test"><li>Simplified format matches document type</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-23`<br />'it-sdi-format' FSM10 goes with document types TD07, TD08 and TD09 only |
    | <small>Invoice</small> | <ul class="gobl-test"><li>Simplified invoice</li><li>Not b2g</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-24`<br />Simplified invoice cannot be issued to a public administration |
    | <small>Invoice</small> | <ul class="gobl-test"><li>Simplified invoice</li><li>No ordinary document type tag</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-25`<br />Simplified invoice cannot use another document type tag |
    | <small>Invoice</small> | <ul class="gobl-test"><li>Simplified invoice</li><li>Simplified document type matches invoice type</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-43`<br />Simplified invoice document type must match its type: TD07 for a standard invoice, TD08 for a credit note, TD09 for a debit note |
    | <small>Invoice</small> | <ul class="gobl-test"><li>Simplified invoice</li><li>Within the simplified limit</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-26`<br />Simplified invoice total cannot exceed 400.00 EUR, unless the supplier is in regime RF19 or RF20 or it is a credit or debit note correcting a preceding invoice |
    | <small>Invoice</small> | <ul class="gobl-test"><li>Simplified invoice</li><li>Simplified exemption codes</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-27`<br />Simplified invoice VAT exemption must be N1, N2.1, N2.2, N3.1, N3.3, N3.4, N3.5, N3.6, N4 or N5 |
    | <small>Invoice</small> | <ul class="gobl-test"><li>Simplified invoice</li><li>No N2.1 to an EU business</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-28`<br />Simplified invoice cannot cover operations taxed on a business in another EU country (N2.1) |
    | <small>Invoice</small> | <ul class="gobl-test"><li>Simplified invoice</li><li>No stamp duty exemption</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-41`<br />Simplified invoice cannot declare a stamp duty exemption (NB1, NB2 or NB3), which only the ordinary format carries |
    | <small>Invoice</small> | <ul class="gobl-test"><li>Simplified invoice</li><li>No sale to a habitual exporter</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-42`<br />Simplified invoice cannot cover a sale to a habitual exporter (N3.5), whose declaration of intent only the ordinary format carries |
    | <small>Invoice</small> | <ul class="gobl-test"><li>Simplified invoice</li><li>No retained taxes</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-29`<br />Simplified invoice cannot carry retained taxes |
    | <small>Invoice</small> | <ul class="gobl-test"><li>Simplified invoice</li><li>Supplier is not the customer</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-38`<br />Simplified invoice supplier and customer must be different parties |
    | <small>Invoice</small> | <ul class="gobl-test"><li>Simplified invoice</li><li>A party in Italy</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-39`<br />Simplified invoice supplier and customer cannot both be outside Italy |
    | `charges[*]` | <ul class="gobl-test"><li>Simplified invoice</li><li>Not (is fund contribution)</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-30`<br />Simplified invoice cannot carry fund contributions |
    | `charges[*].taxes` | <ul class="gobl-test"><li>Simplified invoice</li><li>All of \[VAT]</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-31`<br />Simplified invoice charge requires a VAT tax combo |
    | `discounts[*].taxes` | <ul class="gobl-test"><li>Simplified invoice</li><li>All of \[VAT]</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-32`<br />Simplified invoice discount requires a VAT tax combo |
    | `totals.rounding`<br /><small class="gobl-field-calculated">Calculated</small> | <ul class="gobl-test"><li>Simplified invoice</li><li>No rounding</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-33`<br />Simplified invoice cannot carry a rounding amount |
    | <small>Invoice</small> | <ul class="gobl-test"><li>Simplified note</li><li>Issued after the preceding invoice</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-37`<br />Simplified invoice cannot be issued before the preceding invoice |
    | `preceding` | <ul class="gobl-test"><li>Simplified note</li><li class="gobl-test-present">Present</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-40`<br />Simplified credit or debit note requires the preceding invoice it corrects |
    | `preceding` | <ul class="gobl-test"><li>Simplified note</li><li>Length between 0 and 1</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-34`<br />Simplified invoice can refer to one preceding invoice only |
    | `preceding[*]` | <ul class="gobl-test"><li>Simplified note</li><li>Document number fits</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-48`<br />Simplified invoice preceding number must be 20 ASCII characters or fewer |
    | `preceding[*].issue_date` | <ul class="gobl-test"><li>Simplified note</li><li class="gobl-test-present">Present</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-35`<br />Simplified invoice preceding issue date is required |
    | `preceding[*].reason` | <ul class="gobl-test"><li>Simplified note</li><li class="gobl-test-present">Present</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-36`<br />Simplified invoice preceding reason is required |
    | `ordering.issuer` | <ul class="gobl-test"><li>Person full name</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-53`<br />Issuer person needs a given name and a surname when the issuer has no name |
    | `ordering.issuer` | <ul class="gobl-test"><li>Person latin1</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-54`<br />Issuer person name must use Latin-1 characters |
    | `ordering.issuer` | <ul class="gobl-test"><li>Person title</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-55`<br />Issuer person title must be 2 to 10 printable ASCII characters |
    | `ordering.issuer` | <ul class="gobl-test"><li>Name length</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-56`<br />Issuer name must be at most 80 characters |
    | `ordering.issuer` | <ul class="gobl-test"><li>Person name length</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-57`<br />Issuer person given name and surname must be at most 60 characters each |
    | `ordering.issuer.name` | <ul class="gobl-test"><li>Latin1</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-67`<br />Issuer name must use Latin-1 characters |
    | `ordering.issuer.tax_id.code` | <ul class="gobl-test"><li>Rune length between 0 and 28</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-64`<br />Issuer tax ID code must be at most 28 characters |
    | `tax.ext` | <ul class="gobl-test"><li>Ext 'it-sdi-issuer-type' in \[CC, TZ]</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-69`<br />Tax extension 'it-sdi-issuer-type' must have a valid code |
    | <small>Invoice</small> | <ul class="gobl-test"><li>Not (simplified invoice)</li><li>Third-party issuer named</li></ul> | `GOBL-IT-SDI-BILL-INVOICE-70`<br />Issuer is required when the issuer type is TZ |
  </Accordion>

  <Accordion title="bill.Charge">
    | Field | Test | Validation Code / Message |
    | - | - | - |
    | `percent` | <ul class="gobl-test"><li>Is fund contribution</li><li class="gobl-test-present">Present</li></ul> | `GOBL-IT-SDI-BILL-CHARGE-01`<br />Fund contribution charge requires a percentage |
    | `ext` | <ul class="gobl-test"><li>Is fund contribution</li><li>Ext require \[it-sdi-fund-type]</li></ul> | `GOBL-IT-SDI-BILL-CHARGE-02`<br />Fund contribution charge requires 'it-sdi-fund-type' extension |
    | `taxes` | <ul class="gobl-test"><li>Is fund contribution</li><li>All of \[VAT]</li></ul> | `GOBL-IT-SDI-BILL-CHARGE-03`<br />Fund contribution charge must have VAT tax category |
    | `code` | <ul class="gobl-test"><li>Is fund contribution</li><li>Matches ^\[\[:ascii:]]{0,20}\$</li></ul> | `GOBL-IT-SDI-BILL-CHARGE-04`<br />Fund contribution charge code must be 20 ASCII characters or fewer |
  </Accordion>

  <Accordion title="bill.Status">
    | Field | Test | Validation Code / Message |
    | - | - | - |
    | <small>Status</small> | <ul class="gobl-test"><li>Has one notification direction</li></ul> | `GOBL-IT-SDI-BILL-STATUS-01`<br />Notifications must not mix buyer responses with SDI updates |
  </Accordion>

  <Accordion title="bill.StatusLine">
    | Field | Test | Validation Code / Message |
    | - | - | - |
    | `ext` | <ul class="gobl-test"><li>Is a failed delivery</li><li>Ext require \[it-sdi-format]</li></ul> | `GOBL-IT-SDI-BILL-STATUSLINE-01`<br />Failed delivery requires the 'it-sdi-format' extension |
  </Accordion>

  <Accordion title="org.Address">
    | Field | Test | Validation Code / Message |
    | - | - | - |
    | <small>Address</small> | <ul class="gobl-test"><li>Street or postbox</li></ul> | `GOBL-IT-SDI-ORG-ADDRESS-01`<br />Address either street or post office box must be set |
    | `street` | <ul class="gobl-test"><li>Latin1</li></ul> | `GOBL-IT-SDI-ORG-ADDRESS-02`<br />Address street must use Latin-1 characters |
    | `po_box` | <ul class="gobl-test"><li>Latin1</li></ul> | `GOBL-IT-SDI-ORG-ADDRESS-03`<br />Address post office box must use Latin-1 characters |
    | `country` | <ul class="gobl-test"><li class="gobl-test-present">Present</li></ul> | `GOBL-IT-SDI-ORG-ADDRESS-04`<br />Address country is required |
    | `locality` | <ul class="gobl-test"><li class="gobl-test-present">Present</li></ul> | `GOBL-IT-SDI-ORG-ADDRESS-05`<br />Address locality is required |
    | `locality` | <ul class="gobl-test"><li>Latin1</li></ul> | `GOBL-IT-SDI-ORG-ADDRESS-06`<br />Address locality must use Latin-1 characters |
    | `code` | <ul class="gobl-test"><li>Italian address</li><li class="gobl-test-present">Present</li></ul> | `GOBL-IT-SDI-ORG-ADDRESS-07`<br />Italian address code is required |
    | `code` | <ul class="gobl-test"><li>Italian address</li><li>Matches ^\d{5}\$</li></ul> | `GOBL-IT-SDI-ORG-ADDRESS-08`<br />Italian address code must be 5 digits |
  </Accordion>

  <Accordion title="org.Attribute">
    | Field | Test | Validation Code / Message |
    | - | - | - |
    | `type` | <ul class="gobl-test"><li>Length between 0 and 10</li></ul> | `GOBL-IT-SDI-ORG-ATTRIBUTE-01`<br />Attribute type cannot be longer than 10 characters (TipoDato) |
  </Accordion>

  <Accordion title="tax.Combo">
    | Field | Test | Validation Code / Message |
    | - | - | - |
    | `ext` | <ul class="gobl-test"><li>VAT without percent</li><li>Ext require \[it-sdi-exempt]</li></ul> | `GOBL-IT-SDI-TAX-COMBO-01`<br />VAT tax combo without percent requires 'it-sdi-exempt' extension |
    | <small>Combo</small> | <ul class="gobl-test"><li>Is retained tax</li><li>Statutory rate exceeds the percent</li></ul> | `GOBL-IT-SDI-TAX-COMBO-04`<br />Retained tax combo 'it-sdi-retained-rate' extension must be greater than the percent |
    | `ext` | <ul class="gobl-test"><li>Is retained tax</li><li>Ext require \[it-sdi-retained]</li></ul> | `GOBL-IT-SDI-TAX-COMBO-02`<br />Retained tax combo requires 'it-sdi-retained' extension |
    | `ext` | <ul class="gobl-test"><li>Is retained tax</li><li>Ext 'it-sdi-retained-rate' matches pattern '^(\[0-9]{1,2}.\[0-9]{2}\|100.00)\$'</li></ul> | `GOBL-IT-SDI-TAX-COMBO-03`<br />Retained tax combo 'it-sdi-retained-rate' extension must be a percentage between 0.00 and 100.00 with two decimals |
    | `ext` | <ul class="gobl-test"><li>Not (is retained tax)</li><li>Ext exclude \[it-sdi-retained-rate]</li></ul> | `GOBL-IT-SDI-TAX-COMBO-05`<br />'it-sdi-retained-rate' extension is only for retained taxes |
  </Accordion>

  <Accordion title="pay.Instructions">
    | Field | Test | Validation Code / Message |
    | - | - | - |
    | `ext` | <ul class="gobl-test"><li>Ext require \[it-sdi-payment-means]</li></ul> | `GOBL-IT-SDI-PAY-INSTRUCTIONS-01`<br />Payment instructions require 'it-sdi-payment-means' extension |
  </Accordion>

  <Accordion title="pay.Record">
    | Field | Test | Validation Code / Message |
    | - | - | - |
    | `ext` | <ul class="gobl-test"><li>Ext require \[it-sdi-payment-means]</li></ul> | `GOBL-IT-SDI-PAY-RECORD-01`<br />Payment advance requires 'it-sdi-payment-means' extension |
  </Accordion>

  <Accordion title="pay.DueDate">
    | Field | Test | Validation Code / Message |
    | - | - | - |
    | `amount` | <ul class="gobl-test"><li class="gobl-test-present">Present</li><li>Not zero</li></ul> | `GOBL-IT-SDI-PAY-DUEDATE-01`<br />Amount is required |
  </Accordion>
</AccordionGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.