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’stax_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
Private Invoice
Private Invoice
- (none)
- Extensions:
it-sdi-format:FPR12
Government Invoice
Government Invoice
- Tags:
b2g
- Extensions:
it-sdi-format:FPA12
Regular Invoice
Regular Invoice
- Types:
standard
- Extensions:
it-sdi-document-type:TD01
Advance or down payment on invoice
Advance or down payment on invoice
- Types:
standard - Tags:
partial
- Extensions:
it-sdi-document-type:TD02
Credit Note
Credit Note
- Types:
credit-note
- Extensions:
it-sdi-document-type:TD04
Debit Note
Debit Note
- Types:
debit-note
- Extensions:
it-sdi-document-type:TD05
Freelancer invoice with retained taxes
Freelancer invoice with retained taxes
- Types:
standard - Tags:
freelance
- Extensions:
it-sdi-document-type:TD06
Advance or down payment on freelance invoice
Advance or down payment on freelance invoice
- Types:
standard - Tags:
partial,freelance
- Extensions:
it-sdi-document-type:TD03
Simplified Invoice
Simplified Invoice
- Types:
standard - Tags:
simplified
- Extensions:
it-sdi-document-type:TD07
Simplified Credit Note
Simplified Credit Note
- Types:
credit-note - Tags:
simplified
- Extensions:
it-sdi-document-type:TD08
Simplified Debit Note
Simplified Debit Note
- Types:
debit-note - Tags:
simplified
- Extensions:
it-sdi-document-type:TD09
Self-billed for self consumption or for free transfer without recourse
Self-billed for self consumption or for free transfer without recourse
- Types:
standard - Tags:
self-billed
- Extensions:
it-sdi-document-type:TD27
Reverse charge
Reverse charge
- Types:
standard - Tags:
self-billed,reverse-charge
- Extensions:
it-sdi-document-type:TD16
Self-billed Import
Self-billed Import
- Types:
standard - Tags:
self-billed,import
- Extensions:
it-sdi-document-type:TD17
Self-billed EU Goods Import
Self-billed EU Goods Import
- Types:
standard - Tags:
self-billed,import,goods-eu
- Extensions:
it-sdi-document-type:TD18
Self-billed Goods Import
Self-billed Goods Import
- Types:
standard - Tags:
self-billed,import,goods
- Extensions:
it-sdi-document-type:TD19
Self-billed Regularization
Self-billed Regularization
- Types:
standard - Tags:
self-billed,regularization
- Extensions:
it-sdi-document-type:TD20
Self-billed invoice when ceiling exceeded
Self-billed invoice when ceiling exceeded
- Types:
standard - Tags:
self-billed,ceiling-exceeded
- Extensions:
it-sdi-document-type:TD21
Self-billed for goods extracted from VAT warehouse
Self-billed for goods extracted from VAT warehouse
- Types:
standard - Tags:
self-billed,goods-extracted
- Extensions:
it-sdi-document-type:TD22
Self-billed for goods extracted from VAT warehouse with VAT payment
Self-billed for goods extracted from VAT warehouse with VAT payment
- Types:
standard - Tags:
self-billed,goods-with-tax
- Extensions:
it-sdi-document-type:TD23
Deferred invoice ex art.21, c.4, lett. a) DPR 633/72
Deferred invoice ex art.21, c.4, lett. a) DPR 633/72
- Types:
standard - Tags:
deferred
- Extensions:
it-sdi-document-type:TD24
Deferred invoice ex art.21, c.4, third period lett. b) DPR 633/72
Deferred invoice ex art.21, c.4, third period lett. b) DPR 633/72
- Types:
standard - Tags:
deferred,third-period
- Extensions:
it-sdi-document-type:TD25
Sale of depreciable assets and for internal transfers (ex art.36 DPR 633/72)
Sale of depreciable assets and for internal transfers (ex art.36 DPR 633/72)
- Types:
standard - Tags:
depreciable-assets
- Extensions:
it-sdi-document-type:TD26
Purchases from San Marino with VAT (paper invoice)
Purchases from San Marino with VAT (paper invoice)
- Types:
standard - Tags:
self-billed,san-marino-paper
- 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.it-sdi-format
it-sdi-format
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.it-sdi-document-type
it-sdi-document-type
Fiscal Regime Code
it-sdi-fiscal-regime
it-sdi-fiscal-regime
Exemption Code
it-sdi-exempt
it-sdi-exempt
Retained Tax Payment Reason Code
it-sdi-retained
it-sdi-retained
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.it-sdi-retained-rate
it-sdi-retained-rate
^([0-9]{1,2}\.[0-9]{2}|100\.00)$Payment Means
it-sdi-payment-means
it-sdi-payment-means
VAT Liability
it-sdi-vat-liability
it-sdi-vat-liability
Fund Type
it-sdi-fund-type
it-sdi-fund-type
Liquidation State
Indicates whether the company is in liquidation, used in the IscrizioneREA block of a FatturaPA document as the StatoLiquidazione field.it-sdi-liquidation-state
it-sdi-liquidation-state
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.it-sdi-notification
it-sdi-notification
Validation Rules
bill.Invoice
bill.Invoice
bill.Charge
bill.Charge
bill.Status
bill.Status
bill.StatusLine
bill.StatusLine
org.Address
org.Address
org.Attribute
org.Attribute
tax.Combo
tax.Combo
pay.Instructions
pay.Instructions
pay.Record
pay.Record
pay.DueDate
pay.DueDate