Skip to main content
Key: it-sdi-v1 Module: 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 GOBL documents carry the fields and extensions needed to produce valid FatturaPA files with gobl.fatturapa.

Customer identification

An Italian customer is identified by a partita IVA (VAT number, in the party’s tax_id) or a codice fiscale (an identity with the key it-fiscal-code), and routed by a codice destinatario (it-sdi-code inbox) or a PEC address (it-sdi-pec inbox). A customer outside Italy needs only the country in tax_id. Where a party has no code of its own, FatturaPA expects a placeholder rather than an empty field, and the conversion supplies it: 0000000 for a customer with no tax code, or an Italian customer with no inbox; XXXXXXX as the recipient code for a customer outside Italy; and OO99999999999 in place of a non-EU business’s own tax number, since only EU VAT numbers are meaningful to SDI. Leave the field out rather than writing these values yourself.

Scenarios

bill/invoice

Filters:
  • (none)
Output:
  • Extensions: it-sdi-format:FPR12
Filters:
  • Tags: b2g
Output:
  • Extensions: it-sdi-format:FPA12
Filters:
  • Types: standard
Output:
  • Extensions: it-sdi-document-type:TD01
Filters:
  • Types: standard
  • Tags: partial
Output:
  • Extensions: it-sdi-document-type:TD02
Filters:
  • Types: credit-note
Output:
  • Extensions: it-sdi-document-type:TD04
Filters:
  • Types: debit-note
Output:
  • Extensions: it-sdi-document-type:TD05
Filters:
  • Types: standard
  • Tags: freelance
Output:
  • Extensions: it-sdi-document-type:TD06
Filters:
  • Types: standard
  • Tags: partial, freelance
Output:
  • Extensions: it-sdi-document-type:TD03
Filters:
  • Types: standard
  • Tags: simplified
Output:
  • Extensions: it-sdi-document-type:TD07
Filters:
  • Types: credit-note
  • Tags: simplified
Output:
  • Extensions: it-sdi-document-type:TD08
Filters:
  • Types: debit-note
  • Tags: simplified
Output:
  • Extensions: it-sdi-document-type:TD09
Filters:
  • Types: standard
  • Tags: self-billed
Output:
  • Extensions: it-sdi-document-type:TD27
Filters:
  • Types: standard
  • Tags: self-billed, reverse-charge
Output:
  • Extensions: it-sdi-document-type:TD16
Filters:
  • Types: standard
  • Tags: self-billed, import
Output:
  • Extensions: it-sdi-document-type:TD17
Filters:
  • Types: standard
  • Tags: self-billed, import, goods-eu
Output:
  • Extensions: it-sdi-document-type:TD18
Filters:
  • Types: standard
  • Tags: self-billed, import, goods
Output:
  • Extensions: it-sdi-document-type:TD19
Filters:
  • Types: standard
  • Tags: self-billed, regularization
Output:
  • Extensions: it-sdi-document-type:TD20
Filters:
  • Types: standard
  • Tags: self-billed, ceiling-exceeded
Output:
  • Extensions: it-sdi-document-type:TD21
Filters:
  • Types: standard
  • Tags: self-billed, goods-extracted
Output:
  • Extensions: it-sdi-document-type:TD22
Filters:
  • Types: standard
  • Tags: self-billed, goods-with-tax
Output:
  • Extensions: it-sdi-document-type:TD23
Filters:
  • Types: standard
  • Tags: deferred
Output:
  • Extensions: it-sdi-document-type:TD24
Filters:
  • Types: standard
  • Tags: deferred, third-period
Output:
  • Extensions: it-sdi-document-type:TD25
Filters:
  • Types: standard
  • Tags: depreciable-assets
Output:
  • Extensions: it-sdi-document-type:TD26
Filters:
  • Types: standard
  • Tags: self-billed, san-marino-paper
Output:
  • Extensions: it-sdi-document-type:TD28

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, and “FPR12” otherwise.

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.

Fiscal Regime Code

Exemption Code

Retained Tax Payment Reason Code

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.
Pattern: ^([0-9]{1,2}\.[0-9]{2}|100\.00)$

Payment Means

VAT Liability

Fund Type

Liquidation State

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

Shareholder State

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

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.

Validation Rules