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

# SDI Italy

> Issue and receive invoices through Italy's SDI system.

<Tabs>
  <Tab title="Description">
    <Columns cols="2">
      <div class="flex flex-col grow items-center justify-center">
        <Card title="SDI Sending" icon="https://assets.invopop.com/apps/sdi-italy/icon.svg" href="/guides/it-sdi-sending" horizontal>
          View implementation guide ›
        </Card>

        <Card title="SDI Receiving" icon="https://assets.invopop.com/apps/sdi-italy/icon.svg" href="/guides/it-sdi-receiving" horizontal>
          View implementation guide ›
        </Card>
      </div>

      |           |                                |
      | --------- | ------------------------------ |
      | Developer | [Invopop](https://invopop.com) |
      | Category  | Government                     |
      | Scope     | B2B                            |
      | Country   | [Italy](/compliance/italy)     |
    </Columns>

    The [SDI](https://www.agenziaentrate.gov.it) (*Sistema di Interscambio*) is Italy's central hub for transmitting, validating, and delivering all electronic invoices throughout the country. It is managed by the Italian tax authority (*Agenzia delle Entrate*).

    Electronic invoicing is mandatory for all businesses in Italy. The SDI system operates using a standardized XML format called FatturaPA, which ensures all invoices contain the required information and comply with the strict validation rules established by the Italian tax authority.

    Invopop simplifies SDI integration by allowing you to work with GOBL format instead of XML, providing synchronous validation before submission, and offering a simple API integration with automatic handling of SDI notifications and status updates. Invopop has partnered with [A-Cube](https://www.acubeapi.com) to provide SDI integration services.

    **Key Features**

    * **Workflow Automation:** This app provides automated workflows for sending and receiving invoices through the SDI system.
    * **FatturaPA XML Generation:** Automatically converts GOBL documents into compliant FatturaPA XML format.
    * **Real-Time Status Updates:** Automatically handles SDI notifications and status updates, including delivery confirmations and acceptance/rejection notifications.
    * **Bidirectional Support:** Send invoices to SDI and receive invoices from suppliers through the same app.
    * **Customer Registration:** Register companies to receive invoices through SDI with a simple workflow step.
    * **GOBL FatturaPA Integration:** Uses the open-source [GOBL FatturaPA](https://github.com/invopop/gobl.fatturapa) library for conversions.

    Make sure to check out our [SDI Italy Sending Guide](/guides/it-sdi-sending) and [SDI Italy Receiving Guide](/guides/it-sdi-receiving) for instructions on how to issue and receive invoices.

    ## FAQ

    Invoicing questions

    <AccordionGroup>
      <Accordion title="How do I configure my workspace for Italian invoicing?">
        Install the SDI Italy app for B2B/B2G/B2C structured invoicing, or the Smart Receipts app for B2C-only AdE CF receipts. Run invoices through the Generate FatturaPA + Send to SDI workflow.
      </Accordion>

      <Accordion title="Where do I find Italy-specific GOBL documentation?">
        See the [Italy tax regime in GOBL](https://docs.gobl.org/regimes/it) for tax categories, codice fiscale rules, and SDI-specific extensions. The [`it-sdi-v1`](https://docs.gobl.org/addons/it-sdi-v1) addon documents required FatturaPA fields.
      </Accordion>

      <Accordion title="Why is my invoice processing taking so long?">
        The SDI system can take up to 24 hours to process invoices, especially during peak periods. While waiting, the "Send to SDI" step will remain in the `QUEUED` state. The system will automatically check for updates, and the status will change once SDI has processed the invoice.
      </Accordion>

      <Accordion title="How do I know if my invoice was delivered successfully?">
        Once the SDI process is complete, the workflow will show one of several status codes:

        * `delivered` - The invoice was successfully delivered to a B2B recipient
        * `accepted-pa` - The invoice was accepted by a Public Administration
        * `not-delivered` - The invoice couldn't be delivered, but was processed correctly by SDI

        Check the workflow history to see the exact status.
      </Accordion>

      <Accordion title="Can I use the same workflow for both sending and receiving invoices?">
        No, sending and receiving invoices require different workflows:

        * For sending invoices, a workflow with the Generate FatturaPA and Send to SDI steps is needed
        * For receiving invoices, two workflows are required:
          1. A Customer Registration workflow (run once for each company that needs to receive invoices)
          2. An Import Invoices workflow (configured to run automatically)

        For more information on receiving invoices, see our [Italy - SDI: Receiving Invoices](/guides/it-sdi-receiving) guide.
      </Accordion>

      <Accordion title="How do I add codice fiscale and Partita IVA?">
        Invopop handles both Italian tax identification numbers in the supplier and customer sections of invoices:

        * **Partita IVA** (VAT number): Automatically extracted from the `tax_id/code` field.
        * **Codice Fiscale** (fiscal code): Must be specified as an identity with the key `it-fiscal-code`.

        Here's an example showing both identifiers in a supplier object:

        ```json Supplier with Partita IVA and Codice Fiscale theme={"system"}
        {
            "supplier": {
                "name": "MªF. Services",
                "tax_id": {
                    "country": "IT",
                    "code": "12345678903"
                },
                "identities": [
                    {
                        "key": "it-fiscal-code",
                        "code": "MRTMTT91D08F205J"
                    }
                ],
            }
        }
        ```

        For more information on receiving invoices, see our [Italy - SDI: Receiving Invoices](/guides/it-sdi-receiving) guide.
      </Accordion>
    </AccordionGroup>

    Registering supplier questions

    <AccordionGroup>
      <Accordion title="How do I onboard a new supplier in Italy?">
        Provide the supplier's Partita IVA and Codice Fiscale (where different) in their party configuration. No certificate upload is needed — Invopop signs and submits to SDI as the supplier's intermediary.
      </Accordion>

      <Accordion title="How are supplier credentials stored in Invopop for Italy?">
        No supplier certificates are required. Invopop signs FatturaPA submissions with its own Agenzia delle Entrate-recognized intermediary credentials. Only the Partita IVA and routing metadata are stored.
      </Accordion>

      <Accordion title="How do I register a supplier with SDI?">
        Just configure the supplier's Partita IVA in their party. SDI does not require explicit supplier registration to issue — Invopop signs and submits as intermediary the moment the workflow runs.
      </Accordion>

      <Accordion title="What certificates does SDI require to authenticate a supplier?">
        None — Invopop submits via its intermediary credentials (a server-to-server channel with Agenzia delle Entrate). Suppliers don't manage any certificates for SDI.
      </Accordion>
    </AccordionGroup>

    Receiving questions

    <AccordionGroup>
      <Accordion title="How do I import received invoices in Italy?">
        Register the recipient with SDI using Invopop's Recipient Code (`JKKZDGR`) and run the Customer Registration workflow. Invopop automatically receives matching invoices and routes them through the configured Import workflow.
      </Accordion>

      <Accordion title="How does Invopop convert received Italian invoices into GOBL?">
        Inbound FatturaPA XMLs are parsed via [`gobl.fatturapa`](https://github.com/invopop/gobl.fatturapa). The original signed XML is preserved as a silo entry attachment alongside the GOBL representation.
      </Accordion>

      <Accordion title="What happens if a received invoice contains errors?">
        If an invoice received through SDI contains errors:

        1. The import process will still attempt to convert it to [GOBL](https://docs.gobl.org) format
        2. Any validation errors will be logged, and the rescue steps in your workflow will be triggered
        3. You can review the errors and decide how to handle the invoice

        If the invoice has significant structural issues that prevent conversion, you may need to contact the sender to request a corrected invoice.
      </Accordion>

      <Accordion title="How quickly are invoices received after being sent by suppliers?">
        Invoices are typically received within minutes after being sent by suppliers through SDI. The automatic import process in Invopop processes them as soon as they are received by our system.
      </Accordion>

      <Accordion title="Can I register multiple companies to receive invoices?">
        Yes, multiple companies can be registered to receive invoices through a single Invopop workspace. For each company, you must:

        1. Register the Recipient Code `JKKZDGR` with the Italian tax authority for that specific company
        2. Have its tax ID registered using the Customer Registration workflow in Invopop
        3. Use the same Import Invoices workflow configured in the app settings

        This two-step registration process (with the tax authority and with Invopop) must be completed for each company you want to register. This is particularly useful for white-labeling scenarios where a user manages multiple entities.
      </Accordion>

      <Accordion title="What is the difference between registering with the tax authority and registering with Invopop?">
        The two-step registration process serves different purposes:

        1. **Registering with the Italian tax authority** - Tells SDI to route invoices addressed to your company to Invopop's system using the *Codice Destinatario* `JKKZDGR`.

        2. **Registering with Invopop** (Customer Registration workflow) - Tells Invopop's system which invoices to accept and process for your workspace.

        Both steps are necessary: the first routes the invoices to Invopop, and the second ensures Invopop knows which workspace should receive those invoices.
      </Accordion>

      <Accordion title="What format do received SDI invoices arrive in?">
        Signed FatturaPA XML (versions 1.2.x), conforming to the Agenzia delle Entrate schema. The signature is XAdES; SDI's own *Notifica di Esito Committente* envelopes the document during transmission.
      </Accordion>
    </AccordionGroup>

    More answers in our [Italy FAQ](/faq/italy) section
  </Tab>

  <Tab title="Actions">
    The following workflow actions will be available once you install and enable this app:

    <Card title="Send invoice to SDI" icon="https://assets.invopop.com/apps/sdi-italy/icon.svg" horizontal>
      <div class="pop-count"><Icon icon="https://assets.invopop.com/icons/pops.svg" /> 3</div>
      Issue GOBL invoices in the Italian SDI using the FatturaPA format.
    </Card>

    <Card title="Register supplier with SDI" icon="https://assets.invopop.com/apps/sdi-italy/icon.svg" horizontal>
      Register a GOBL party to receive invoices to the Italian SDI.
    </Card>

    <Card title="Import invoice from SDI" icon="https://assets.invopop.com/apps/sdi-italy/icon.svg" horizontal>
      <div class="pop-count"><Icon icon="https://assets.invopop.com/icons/pops.svg" /> 3</div>
      Import invoices from the Italian SDI using the FatturaPA format.
    </Card>
  </Tab>

  <Tab title="Workflows">
    The following workflows are available to make your integration easier. Use them as templates to build upon.

    <AccordionGroup>
      <Accordion title="SDI Italy send invoice workflow">
        This workflow automates FatturaPA invoice generation and submission to SDI.

        ```json Example SDI issue invoice workflow theme={"system"}
        {
          "name": "SDI issue invoice",
          "description": "Issue an invoice through SDI",
          "schema": "bill/invoice",
          "steps": [
            {
              "id": "1a692ae0-cd12-11ef-998c-e97f18c9212e",
              "name": "Set state",
              "provider": "silo.state",
              "summary": "Set state to `processing`{.state .processing}",
              "config": {
                "state": "processing"
              }
            },
            {
              "id": "1855b430-cd12-11ef-998c-e97f18c9212e",
              "name": "Sign envelope",
              "provider": "silo.close"
            },
            {
              "id": "2042f860-cd12-11ef-998c-e97f18c9212e",
              "name": "Send invoice to SDI",
              "provider": "sdi-it.send",
              "summary": "Sandbox · Accepted by PA (Notifica esito)",
              "config": {
                "environment": "sandbox",
                "response": "NE"
              }
            },
            {
              "id": "236965b0-cd12-11ef-998c-e97f18c9212e",
              "name": "Generate PDF",
              "provider": "pdf",
              "summary": "Italian · A4",
              "config": {
                "date_format": "%Y-%m-%d",
                "locale": "it",
                "logo_height": 40
              }
            },
            {
              "id": "2b6db450-cd12-11ef-998c-e97f18c9212e",
              "name": "Set state",
              "provider": "silo.state",
              "summary": "Set state to `sent`{.state .sent}",
              "config": {
                "state": "sent"
              }
            }
          ],
          "rescue": [
            {
              "id": "2d5d7660-cd12-11ef-998c-e97f18c9212e",
              "name": "Set state",
              "provider": "silo.state",
              "summary": "Set state to `error`{.state .error}",
              "config": {
                "state": "error"
              }
            }
          ]
        }

        ```

        [Add to my workspace →](https://console.invopop.com/redirect/workflows/new?template=it-sdi-send)
      </Accordion>

      <Accordion title="SDI Italy register customer workflow">
        This workflow registers a company to receive invoices through SDI.

        ```json Example SDI register customer workflow theme={"system"}
        {
          "name": "SDI register customer",
          "description": "Register a customer with SDI to receive invoices",
          "schema": "org/party",
          "steps": [
            {
              "id": "2a34f560-fd13-11ef-998c-e97f18c9212e",
              "name": "Set state",
              "provider": "silo.state",
              "summary": "Set state to `processing`{.state .processing}",
              "config": {
                "state": "processing"
              }
            },
            {
              "id": "3b5c7890-fd13-11ef-998c-e97f18c9212e",
              "name": "Register party with SDI",
              "provider": "sdi-it.register",
              "summary": "Register company as receiver",
              "config": {
                "environment": "production"
              }
            },
            {
              "id": "4c6d8910-fd13-11ef-998c-e97f18c9212e",
              "name": "Set state",
              "provider": "silo.state",
              "summary": "Set state to `registered`{.state .registered}",
              "config": {
                "state": "registered"
              }
            }
          ],
          "rescue": [
            {
              "id": "5d7e9a20-fd13-11ef-998c-e97f18c9212e",
              "name": "Set state",
              "provider": "silo.state",
              "summary": "Set state to `error`{.state .error}",
              "config": {
                "state": "error"
              }
            }
          ]
        }
        ```

        [Add to my workspace →](https://console.invopop.com/redirect/workflows/new?template=it-sdi-register-customer)
      </Accordion>

      <Accordion title="SDI Italy import invoices workflow">
        This workflow imports and processes invoices received through SDI.

        ```json Example SDI import invoice workflow theme={"system"}
        {
          "name": "SDI import invoice",
          "description": "Import an invoice received through SDI",
          "schema": "bill/invoice",
          "steps": [
            {
              "id": "6e8f0b30-fd13-11ef-998c-e97f18c9212e",
              "name": "Import invoice from SDI",
              "provider": "sdi-it.import",
              "summary": "Convert received FatturaPA to GOBL",
              "config": {
                "environment": "production"
              }
            },
            {
              "id": "7f9a1c40-fd13-11ef-998c-e97f18c9212e",
              "name": "Generate PDF",
              "provider": "pdf",
              "summary": "Italian · A4",
              "config": {
                "date_format": "%Y-%m-%d",
                "locale": "it",
                "logo_height": 40
              }
            },
            {
              "id": "8a0b2d50-fd13-11ef-998c-e97f18c9212e",
              "name": "Set state",
              "provider": "silo.state",
              "summary": "Set state to `sent`{.state .sent}",
              "config": {
                "state": "sent"
              }
            }
          ],
          "rescue": [
            {
              "id": "9b1c3e60-fd13-11ef-998c-e97f18c9212e",
              "name": "Set state",
              "provider": "silo.state",
              "summary": "Set state to `error`{.state .error}",
              "config": {
                "state": "error"
              }
            }
          ]
        }
        ```

        [Add to my workspace →](https://console.invopop.com/redirect/workflows/new?template=it-sdi-import-invoices)
      </Accordion>
    </AccordionGroup>
  </Tab>

  <Tab title="Documents">
    <AccordionGroup>
      <Accordion title="B2C Standard Invoice">
        In this example, we're issuing a standard B2C invoice from an Italian supplier to a consumer.

        Notice:

        * `"$tags": ["b2g"]`  scenario will set the `it-sdi-format` to FPA12 (vs. FPR12 default for private parties) and the document type to TD01.
        * The recipient Codice Univoco for PA goes in customer.inboxes with key `it-sdi-code`.
        * The customer tax\_id for a PA entity is the Codice Fiscale (11 digits for the example *Comune di Roma*).
        * RF01 ordinary fiscal regime on the supplier, required by FatturaPA.
        * Example has CIG/CUP codes for public tender or funded project (not required otherwise.

                  <CodeGroup>
                    ```json SDI B2C Invoice theme={"system"}
                    {
                      "$schema": "https://gobl.org/draft-0/bill/invoice",
                      "$regime": "IT",
                      "$addons": [
                        "it-sdi-v1"
                      ],
                      "series": "FT",
                      "code": "020",
                      "issue_date": "2024-07-12",
                      "currency": "EUR",
                      "tax": {
                        "prices_include": "VAT"
                      },
                      "supplier": {
                        "name": "Company Name S.r.l.",
                        "tax_id": {
                          "country": "IT",
                          "code": "12345678903"
                        },
                        "addresses": [
                          {
                            "num": "102",
                            "street": "Via California",
                            "locality": "Palermo",
                            "region": "PA",
                            "code": "33213",
                            "country": "IT"
                          }
                        ],
                        "registration": {
                          "capital": "50000.00",
                          "currency": "EUR",
                          "office": "RM",
                          "entry": "123456"
                        },
                        "ext": {
                          "it-sdi-fiscal-regime": "RF01"
                        }
                      },
                      "customer": {
                        "name": "Customer Name S.r.l.",
                        "tax_id": {
                          "country": "IT"
                        },
                        "identities": [
                          {
                            "key": "it-fiscal-code",
                            "code": "RSSGNN60R30H501U"
                          }
                        ],
                        "addresses": [
                          {
                            "num": "23",
                            "street": "Via dei Mille",
                            "locality": "Firenze",
                            "region": "FI",
                            "code": "00100",
                            "country": "IT"
                          }
                        ]
                      },
                      "lines": [
                        {
                          "quantity": "1",
                          "item": {
                            "name": "Cleaning services",
                            "price": "125.00"
                          },
                          "taxes": [
                            {
                              "cat": "VAT",
                              "rate": "standard"
                            }
                          ]
                        }
                      ]
                    }

                    ```

                    ```json Built version theme={"system"}
                    {
                    	"$schema": "https://gobl.org/draft-0/bill/invoice",
                    	"$regime": "IT",
                    	"$addons": [
                    		"it-sdi-v1"
                    	],
                    	"type": "standard",
                    	"series": "FT",
                    	"code": "020",
                    	"issue_date": "2024-07-12",
                    	"currency": "EUR",
                    	"tax": {
                    		"prices_include": "VAT",
                    		"ext": {
                    			"it-sdi-document-type": "TD01",
                    			"it-sdi-format": "FPR12"
                    		}
                    	},
                    	"supplier": {
                    		"name": "Company Name S.r.l.",
                    		"tax_id": {
                    			"country": "IT",
                    			"code": "12345678903"
                    		},
                    		"addresses": [
                    			{
                    				"num": "102",
                    				"street": "Via California",
                    				"locality": "Palermo",
                    				"region": "PA",
                    				"code": "33213",
                    				"country": "IT"
                    			}
                    		],
                    		"registration": {
                    			"capital": "50000.00",
                    			"currency": "EUR",
                    			"office": "RM",
                    			"entry": "123456"
                    		},
                    		"ext": {
                    			"it-sdi-fiscal-regime": "RF01"
                    		}
                    	},
                    	"customer": {
                    		"name": "Customer Name S.r.l.",
                    		"tax_id": {
                    			"country": "IT"
                    		},
                    		"identities": [
                    			{
                    				"key": "it-fiscal-code",
                    				"code": "RSSGNN60R30H501U"
                    			}
                    		],
                    		"addresses": [
                    			{
                    				"num": "23",
                    				"street": "Via dei Mille",
                    				"locality": "Firenze",
                    				"region": "FI",
                    				"code": "00100",
                    				"country": "IT"
                    			}
                    		]
                    	},
                    	"lines": [
                    		{
                    			"i": 1,
                    			"quantity": "1",
                    			"item": {
                    				"name": "Cleaning services",
                    				"price": "125.00"
                    			},
                    			"sum": "125.00",
                    			"taxes": [
                    				{
                    					"cat": "VAT",
                    					"key": "standard",
                    					"rate": "general",
                    					"percent": "22.0%"
                    				}
                    			],
                    			"total": "125.00"
                    		}
                    	],
                    	"totals": {
                    		"sum": "125.00",
                    		"tax_included": "22.54",
                    		"total": "102.46",
                    		"taxes": {
                    			"categories": [
                    				{
                    					"code": "VAT",
                    					"rates": [
                    						{
                    							"key": "standard",
                    							"base": "102.46",
                    							"percent": "22.0%",
                    							"amount": "22.54"
                    						}
                    					],
                    					"amount": "22.54"
                    				}
                    			],
                    			"sum": "22.54"
                    		},
                    		"tax": "22.54",
                    		"total_with_tax": "125.00",
                    		"payable": "125.00"
                    	}
                    }
                    ```
                  </CodeGroup>
      </Accordion>

      <Accordion title="B2B Invoice">
        In this example, we're issuing a standard B2B invoice from an Italian supplier to another Italian business customer.

        Notice:

        * both supplier and customer have their Partita IVA (VAT number) and Codice Fiscale properly specified,
        * the minimal version contains only essential fields; `gobl build` handles all calculations,
        * when running `gobl build`, the system automatically calculates totals, applies IVA rates, and normalizes the document according to SDI requirements,
        * the built version shows all calculated fields including tax breakdowns, line totals, payment terms, and final amounts,
        * the [`it-sdi-v1`](https://docs.gobl.org/addons/it-sdi-v1) addon validates the document structure for B2B transactions, and,
        * the invoice will be transmitted through the SDI system and delivered to the customer's designated channel.

        <CodeGroup>
          ```json SDI B2B Invoice theme={"system"}
          {
            "$schema": "https://gobl.org/draft-0/bill/invoice",
            "$regime": "IT",
            "$addons": [
              "it-sdi-v1"
            ],
            "series": "SAMPLE",
            "code": "002",
            "issue_date": "2023-05-21",
            "currency": "EUR",
            "tax": {
              "prices_include": "VAT"
            },
            "supplier": {
              "name": "Hotel California",
              "tax_id": {
                "country": "IT",
                "code": "12345678903"
              },
              "addresses": [
                {
                  "num": "102",
                  "street": "Via California",
                  "locality": "Palermo",
                  "region": "PA",
                  "code": "33213",
                  "country": "IT"
                }
              ],
              "registration": {
                "capital": "50000.00",
                "currency": "EUR",
                "office": "RM",
                "entry": "123456"
              },
              "ext": {
                "it-sdi-fiscal-regime": "RF01"
              }
            },
            "customer": {
              "name": "Mela S.r.l.",
              "tax_id": {
                "country": "IT",
                "code": "13029381004"
              },
              "inboxes": [
                {
                  "key": "it-sdi-code",
                  "code": "M5UXCR5"
                }
              ],
              "addresses": [
                {
                  "num": "23",
                  "street": "Via dei Mille",
                  "locality": "Firenze",
                  "region": "FI",
                  "code": "00100",
                  "country": "IT"
                }
              ]
            },
            "lines": [
              {
                "quantity": "1",
                "item": {
                  "name": "Tassa di Soggiorno",
                  "price": "1.00"
                },
                "taxes": [
                  {
                    "cat": "VAT",
                    "rate": "exempt",
                    "ext": {
                      "it-sdi-exempt": "N4"
                    }
                  }
                ]
              },
              {
                "quantity": "1",
                "item": {
                  "name": "Camera Matrimoniale",
                  "price": "125.00"
                },
                "taxes": [
                  {
                    "cat": "VAT",
                    "rate": "intermediate"
                  }
                ]
              }
            ]
          }

          ```

          ```json Built version theme={"system"}
          {
          	"$schema": "https://gobl.org/draft-0/bill/invoice",
          	"$regime": "IT",
          	"$addons": [
          		"it-sdi-v1"
          	],
          	"type": "standard",
          	"series": "SAMPLE",
          	"code": "002",
          	"issue_date": "2023-05-21",
          	"currency": "EUR",
          	"tax": {
          		"prices_include": "VAT",
          		"ext": {
          			"it-sdi-document-type": "TD01",
          			"it-sdi-format": "FPR12"
          		}
          	},
          	"supplier": {
          		"name": "Hotel California",
          		"tax_id": {
          			"country": "IT",
          			"code": "12345678903"
          		},
          		"addresses": [
          			{
          				"num": "102",
          				"street": "Via California",
          				"locality": "Palermo",
          				"region": "PA",
          				"code": "33213",
          				"country": "IT"
          			}
          		],
          		"registration": {
          			"capital": "50000.00",
          			"currency": "EUR",
          			"office": "RM",
          			"entry": "123456"
          		},
          		"ext": {
          			"it-sdi-fiscal-regime": "RF01"
          		}
          	},
          	"customer": {
          		"name": "Mela S.r.l.",
          		"tax_id": {
          			"country": "IT",
          			"code": "13029381004"
          		},
          		"inboxes": [
          			{
          				"key": "it-sdi-code",
          				"code": "M5UXCR5"
          			}
          		],
          		"addresses": [
          			{
          				"num": "23",
          				"street": "Via dei Mille",
          				"locality": "Firenze",
          				"region": "FI",
          				"code": "00100",
          				"country": "IT"
          			}
          		]
          	},
          	"lines": [
          		{
          			"i": 1,
          			"quantity": "1",
          			"item": {
          				"name": "Tassa di Soggiorno",
          				"price": "1.00"
          			},
          			"sum": "1.00",
          			"taxes": [
          				{
          					"cat": "VAT",
          					"key": "exempt",
          					"ext": {
          						"it-sdi-exempt": "N4"
          					}
          				}
          			],
          			"total": "1.00"
          		},
          		{
          			"i": 2,
          			"quantity": "1",
          			"item": {
          				"name": "Camera Matrimoniale",
          				"price": "125.00"
          			},
          			"sum": "125.00",
          			"taxes": [
          				{
          					"cat": "VAT",
          					"key": "standard",
          					"rate": "intermediate",
          					"percent": "10.0%"
          				}
          			],
          			"total": "125.00"
          		}
          	],
          	"totals": {
          		"sum": "126.00",
          		"tax_included": "11.36",
          		"total": "114.64",
          		"taxes": {
          			"categories": [
          				{
          					"code": "VAT",
          					"rates": [
          						{
          							"key": "exempt",
          							"ext": {
          								"it-sdi-exempt": "N4"
          							},
          							"base": "1.00",
          							"amount": "0.00"
          						},
          						{
          							"key": "standard",
          							"base": "113.64",
          							"percent": "10.0%",
          							"amount": "11.36"
          						}
          					],
          					"amount": "11.36"
          				}
          			],
          			"sum": "11.36"
          		},
          		"tax": "11.36",
          		"total_with_tax": "126.00",
          		"payable": "126.00"
          	}
          }
          ```
        </CodeGroup>
      </Accordion>

      <Accordion title="B2G Invoice">
        In this example, we're issuing a B2G invoice from an Italian supplier to the italian Government.

        Notice:

        * both supplier and customer have their Partita IVA (VAT number) and Codice Fiscale properly specified,
        * the minimal version contains only essential fields; `gobl build` handles all calculations,
        * when running `gobl build`, the system automatically calculates totals, applies IVA rates, and normalizes the document according to SDI requirements,
        * the built version shows all calculated fields including tax breakdowns, line totals, payment terms, and final amounts,
        * the [`it-sdi-v1`](https://docs.gobl.org/addons/it-sdi-v1) addon validates the document structure for B2B transactions, and,
        * the invoice will be transmitted through the SDI system and delivered to the customer's designated channel.

        <CodeGroup>
          ```json SDI B2G Invoice theme={"system"}
          {
            "$schema": "https://gobl.org/draft-0/bill/invoice",
            "$regime": "IT",
            "$addons": ["it-sdi-v1"],
            "$tags": ["b2g"],
            "series": "PA",
            "code": "2026-001",
            "issue_date": "2026-05-08",
            "currency": "EUR",
            "supplier": {
              "name": "Esempio Fornitore SRL",
              "tax_id": {
                "country": "IT",
                "code": "12345678903"
              },
              "ext": {
                "it-sdi-fiscal-regime": "RF01"
              },
              "addresses": [
                {
                  "num": "10",
                  "street": "Via Roma",
                  "locality": "Milano",
                  "region": "MI",
                  "code": "20121",
                  "country": "IT"
                }
              ],
              "emails": [
                {"addr": "amministrazione@esempio-fornitore.it"}
              ]
            },
            "customer": {
              "name": "Comune di Roma",
              "tax_id": {
                "country": "IT",
                "code": "02438750586"
              },
              "addresses": [
                {
                  "num": "1",
                  "street": "Piazza del Campidoglio",
                  "locality": "Roma",
                  "region": "RM",
                  "code": "00186",
                  "country": "IT"
                }
              ],
              "inboxes": [
                {
                  "key": "it-sdi-code",
                  "code": "UF9DN8"
                }
              ]
            },
            "lines": [
              {
                "quantity": "20",
                "item": {
                  "name": "Servizi di consulenza informatica",
                  "price": "150.00",
                  "unit": "h"
                },
                "taxes": [
                  {
                    "cat": "VAT",
                    "rate": "standard"
                  }
                ]
              },
              {
                "quantity": "1",
                "item": {
                  "name": "Licenza software annuale",
                  "price": "1200.00"
                },
                "taxes": [
                  {
                    "cat": "VAT",
                    "rate": "standard"
                  }
                ]
              }
            ],
            "payment": {
              "instructions": {
                "key": "credit-transfer",
                "ext": {
                  "it-sdi-payment-means": "MP05"
                },
                "credit_transfer": [
                  {
                    "iban": "IT60X0542811101000000123456",
                    "name": "Banca Esempio SpA",
                    "bic": "BPMOIT22XXX"
                  }
                ]
              },
              "terms": {
                "due_dates": [
                  {
                    "date": "2026-06-07",
                    "percent": "100%"
                  }
                ]
              }
            },
            "notes": [
              {
                "key": "general",
                "text": "Fattura emessa verso Pubblica Amministrazione tramite SDI. CIG: Z1A2B3C4D5 - CUP: F81B12000000001"
              }
            ]
          }
          ```

          ```json Built version theme={"system"}
          {
          	"$schema": "https://gobl.org/draft-0/bill/invoice",
          	"$regime": "IT",
          	"$addons": [
          		"it-sdi-v1"
          	],
          	"$tags": [
          		"b2g"
          	],
          	"type": "standard",
          	"series": "PA",
          	"code": "2026-001",
          	"issue_date": "2026-05-08",
          	"currency": "EUR",
          	"tax": {
          		"ext": {
          			"it-sdi-document-type": "TD01",
          			"it-sdi-format": "FPA12"
          		}
          	},
          	"supplier": {
          		"name": "Esempio Fornitore SRL",
          		"tax_id": {
          			"country": "IT",
          			"code": "12345678903"
          		},
          		"addresses": [
          			{
          				"num": "10",
          				"street": "Via Roma",
          				"locality": "Milano",
          				"region": "MI",
          				"code": "20121",
          				"country": "IT"
          			}
          		],
          		"emails": [
          			{
          				"addr": "amministrazione@esempio-fornitore.it"
          			}
          		],
          		"ext": {
          			"it-sdi-fiscal-regime": "RF01"
          		}
          	},
          	"customer": {
          		"name": "Comune di Roma",
          		"tax_id": {
          			"country": "IT",
          			"code": "02438750586"
          		},
          		"inboxes": [
          			{
          				"key": "it-sdi-code",
          				"code": "UF9DN8"
          			}
          		],
          		"addresses": [
          			{
          				"num": "1",
          				"street": "Piazza del Campidoglio",
          				"locality": "Roma",
          				"region": "RM",
          				"code": "00186",
          				"country": "IT"
          			}
          		]
          	},
          	"lines": [
          		{
          			"i": 1,
          			"quantity": "20",
          			"item": {
          				"name": "Servizi di consulenza informatica",
          				"price": "150.00",
          				"unit": "h"
          			},
          			"sum": "3000.00",
          			"taxes": [
          				{
          					"cat": "VAT",
          					"key": "standard",
          					"rate": "general",
          					"percent": "22.0%"
          				}
          			],
          			"total": "3000.00"
          		},
          		{
          			"i": 2,
          			"quantity": "1",
          			"item": {
          				"name": "Licenza software annuale",
          				"price": "1200.00"
          			},
          			"sum": "1200.00",
          			"taxes": [
          				{
          					"cat": "VAT",
          					"key": "standard",
          					"rate": "general",
          					"percent": "22.0%"
          				}
          			],
          			"total": "1200.00"
          		}
          	],
          	"payment": {
          		"terms": {
          			"due_dates": [
          				{
          					"date": "2026-06-07",
          					"amount": "5124.00",
          					"percent": "100%"
          				}
          			]
          		},
          		"instructions": {
          			"key": "credit-transfer",
          			"credit_transfer": [
          				{
          					"iban": "IT60X0542811101000000123456",
          					"bic": "BPMOIT22XXX",
          					"name": "Banca Esempio SpA"
          				}
          			],
          			"ext": {
          				"it-sdi-payment-means": "MP05"
          			}
          		}
          	},
          	"totals": {
          		"sum": "4200.00",
          		"total": "4200.00",
          		"taxes": {
          			"categories": [
          				{
          					"code": "VAT",
          					"rates": [
          						{
          							"key": "standard",
          							"base": "4200.00",
          							"percent": "22.0%",
          							"amount": "924.00"
          						}
          					],
          					"amount": "924.00"
          				}
          			],
          			"sum": "924.00"
          		},
          		"tax": "924.00",
          		"total_with_tax": "5124.00",
          		"payable": "5124.00"
          	},
          	"notes": [
          		{
          			"key": "general",
          			"text": "Fattura emessa verso Pubblica Amministrazione tramite SDI. CIG: Z1A2B3C4D5 - CUP: F81B12000000001"
          		}
          	]
          }
          ```
        </CodeGroup>
      </Accordion>

      <Accordion title="Stamp Duty Invoice (Marca da Bollo)">
        This example matches the **B2B invoice** above but adds a **€2.00 Marca da bollo** (stamp duty) as a document-level charge.

        **Flat-rate scheme (*forfettario*):** taxpayers using the *regime forfettario* do **not** charge VAT on their invoices. When the document total goes **above €77.47**, they must account for **imposta di bollo**—typically by adding a **€2.00** stamp duty line, as in this sample. (Thresholds and rules can change; confirm with your adviser or the Agenzia delle Entrate if in doubt.)

        Notice:

        * the `charges` array includes an entry with `"key": "stamp-duty"`, amount `"2.00"`, and reason `Imposta di bollo`,
        * the minimal version is otherwise the same as the B2B example; `gobl build` recalculates totals including the charge,
        * the built version shows `totals.charge` and a higher `payable` / `total_with_tax` than the plain B2B invoice,
        * the [`it-sdi-v1`](https://docs.gobl.org/addons/it-sdi-v1) addon continues to validate the document for SDI transmission.

        <CodeGroup>
          ```json SDI Stamp duty invoice (Marca da Bollo) theme={"system"}
          {
            "$schema": "https://gobl.org/draft-0/bill/invoice",
            "$regime": "IT",
            "$addons": [
              "it-sdi-v1"
            ],
            "series": "SAMPLE",
            "code": "002",
            "issue_date": "2023-05-21",
            "currency": "EUR",
            "tax": {
              "prices_include": "VAT"
            },
            "supplier": {
              "name": "Hotel California",
              "tax_id": {
                "country": "IT",
                "code": "12345678903"
              },
              "addresses": [
                {
                  "num": "102",
                  "street": "Via California",
                  "locality": "Palermo",
                  "region": "PA",
                  "code": "33213",
                  "country": "IT"
                }
              ],
              "registration": {
                "capital": "50000.00",
                "currency": "EUR",
                "office": "RM",
                "entry": "123456"
              },
              "ext": {
                "it-sdi-fiscal-regime": "RF01"
              }
            },
            "customer": {
              "name": "Mela S.r.l.",
              "tax_id": {
                "country": "IT",
                "code": "13029381004"
              },
              "inboxes": [
                {
                  "key": "it-sdi-code",
                  "code": "M5UXCR5"
                }
              ],
              "addresses": [
                {
                  "num": "23",
                  "street": "Via dei Mille",
                  "locality": "Firenze",
                  "region": "FI",
                  "code": "00100",
                  "country": "IT"
                }
              ]
            },
            "lines": [
              {
                "quantity": "1",
                "item": {
                  "name": "Tassa di Soggiorno",
                  "price": "1.00"
                },
                "taxes": [
                  {
                    "cat": "VAT",
                    "rate": "exempt",
                    "ext": {
                      "it-sdi-exempt": "N4"
                    }
                  }
                ]
              },
              {
                "quantity": "1",
                "item": {
                  "name": "Camera Matrimoniale",
                  "price": "125.00"
                },
                "taxes": [
                  {
                    "cat": "VAT",
                    "rate": "intermediate"
                  }
                ]
              }
            ],
            "charges": [
              {
                "key": "stamp-duty",
                "i": 1,
                "amount": "2.00",
                "reason": "Imposta di bollo"
              }
            ]
          }

          ```

          ```json Built version theme={"system"}
          {
          	"$schema": "https://gobl.org/draft-0/bill/invoice",
          	"$regime": "IT",
          	"$addons": [
          		"it-sdi-v1"
          	],
          	"type": "standard",
          	"series": "SAMPLE",
          	"code": "002",
          	"issue_date": "2023-05-21",
          	"currency": "EUR",
          	"tax": {
          		"prices_include": "VAT",
          		"ext": {
          			"it-sdi-document-type": "TD01",
          			"it-sdi-format": "FPR12"
          		}
          	},
          	"supplier": {
          		"name": "Hotel California",
          		"tax_id": {
          			"country": "IT",
          			"code": "12345678903"
          		},
          		"addresses": [
          			{
          				"num": "102",
          				"street": "Via California",
          				"locality": "Palermo",
          				"region": "PA",
          				"code": "33213",
          				"country": "IT"
          			}
          		],
          		"registration": {
          			"capital": "50000.00",
          			"currency": "EUR",
          			"office": "RM",
          			"entry": "123456"
          		},
          		"ext": {
          			"it-sdi-fiscal-regime": "RF01"
          		}
          	},
          	"customer": {
          		"name": "Mela S.r.l.",
          		"tax_id": {
          			"country": "IT",
          			"code": "13029381004"
          		},
          		"inboxes": [
          			{
          				"key": "it-sdi-code",
          				"code": "M5UXCR5"
          			}
          		],
          		"addresses": [
          			{
          				"num": "23",
          				"street": "Via dei Mille",
          				"locality": "Firenze",
          				"region": "FI",
          				"code": "00100",
          				"country": "IT"
          			}
          		]
          	},
          	"lines": [
          		{
          			"i": 1,
          			"quantity": "1",
          			"item": {
          				"name": "Tassa di Soggiorno",
          				"price": "1.00"
          			},
          			"sum": "1.00",
          			"taxes": [
          				{
          					"cat": "VAT",
          					"key": "exempt",
          					"ext": {
          						"it-sdi-exempt": "N4"
          					}
          				}
          			],
          			"total": "1.00"
          		},
          		{
          			"i": 2,
          			"quantity": "1",
          			"item": {
          				"name": "Camera Matrimoniale",
          				"price": "125.00"
          			},
          			"sum": "125.00",
          			"taxes": [
          				{
          					"cat": "VAT",
          					"key": "standard",
          					"rate": "intermediate",
          					"percent": "10.0%"
          				}
          			],
          			"total": "125.00"
          		}
          	],
          	"charges": [
          		{
          			"i": 1,
          			"key": "stamp-duty",
          			"reason": "Imposta di bollo",
          			"amount": "2.00"
          		}
          	],
          	"totals": {
          		"sum": "126.00",
          		"charge": "2.00",
          		"tax_included": "11.36",
          		"total": "116.64",
          		"taxes": {
          			"categories": [
          				{
          					"code": "VAT",
          					"rates": [
          						{
          							"key": "exempt",
          							"ext": {
          								"it-sdi-exempt": "N4"
          							},
          							"base": "1.00",
          							"amount": "0.00"
          						},
          						{
          							"key": "standard",
          							"base": "113.64",
          							"percent": "10.0%",
          							"amount": "11.36"
          						}
          					],
          					"amount": "11.36"
          				}
          			],
          			"sum": "11.36"
          		},
          		"tax": "11.36",
          		"total_with_tax": "128.00",
          		"payable": "128.00"
          	}
          }
          ```
        </CodeGroup>
      </Accordion>

      <Accordion title="B2B Invoice with Additional Fields">
        In this example, we're issuing a comprehensive B2B invoice with additional optional fields such as ordering information, payment details, and document references.

        Notice:

        * this invoice demonstrates advanced SDI features like CIG/CUP codes, payment methods, and bank details,
        * the minimal version includes ordering and payment details; `gobl build` calculates all totals,
        * when running `gobl build`, the system validates all additional fields according to SDI specifications and calculates totals,
        * the built version shows the complete document with all calculated fields, tax breakdowns, and properly formatted additional information,
        * additional fields like `ordering`, `payment`, and document references are important for public administration invoices (B2G), and,
        * the addon ensures all optional fields are properly validated and formatted for SDI transmission.

        <CodeGroup>
          ```json SDI B2B Invoice with additional fields theme={"system"}
          {
            "$schema": "https://gobl.org/draft-0/bill/invoice",
            "$regime": "IT",
            "$addons": [
              "it-sdi-v1"
            ],
            "$tags": [
              "freelance"
            ],
            "series": "SAMPLE",
            "code": "001",
            "issue_date": "2023-03-02",
            "currency": "EUR",
            "supplier": {
              "name": "MªF. Services",
              "tax_id": {
                "country": "IT",
                "code": "12345678903"
              },
              "people": [
                {
                  "name": {
                    "given": "GIANCARLO",
                    "surname": "ROSSI"
                  }
                }
              ],
              "addresses": [
                {
                  "num": "1",
                  "street": "VIALE DELLA LIBERTÀ",
                  "locality": "ROMA",
                  "region": "RM",
                  "code": "00100",
                  "country": "IT"
                }
              ],
              "emails": [
                {
                  "addr": "billing@example.com"
                }
              ],
              "telephones": [
                {
                  "num": "999999999"
                }
              ],
              "registration": {
                "capital": "50000.00",
                "currency": "EUR",
                "office": "RM",
                "entry": "123456"
              },
              "ext": {
                "it-sdi-fiscal-regime": "RF02"
              }
            },
            "customer": {
              "name": "MARIO LEONI",
              "tax_id": {
                "country": "IT",
                "code": "09876543217"
              },
              "people": [
                {
                  "name": {
                    "prefix": "Dott.",
                    "given": "MARIO",
                    "surname": "LEONI"
                  }
                }
              ],
              "inboxes": [
                {
                  "key": "it-sdi-code",
                  "code": "M5UXCR5"
                }
              ],
              "addresses": [
                {
                  "num": "1",
                  "street": "VIALE DELI LAVORATORI",
                  "locality": "ROMA",
                  "region": "RM",
                  "code": "00100",
                  "country": "IT"
                }
              ],
              "emails": [
                {
                  "addr": "mario@example.com"
                }
              ]
            },
            "lines": [
              {
                "quantity": "20",
                "item": {
                  "name": "Development of accounting software",
                  "price": "10.00",
                  "unit": "h"
                },
                "taxes": [
                  {
                    "cat": "VAT",
                    "rate": "standard"
                  }
                ]
              }
            ],
            "payment": {
              "instructions": {
                "key": "credit-transfer",
                "credit_transfer": [
                  {
                    "iban": "IT60X0542811101000000123456",
                    "name": "MªF. Services"
                  }
                ]
              },
              "terms": {
                "due_dates": [
                  {
                    "date": "2023-09-01",
                    "percent": "100%"
                  }
                ]
              }
            }
          }

          ```

          ```json Built version theme={"system"}
          {
          	"$schema": "https://gobl.org/draft-0/bill/invoice",
          	"$regime": "IT",
          	"$addons": [
          		"it-sdi-v1"
          	],
          	"$tags": [
          		"freelance"
          	],
          	"type": "standard",
          	"series": "SAMPLE",
          	"code": "001",
          	"issue_date": "2023-03-02",
          	"currency": "EUR",
          	"tax": {
          		"ext": {
          			"it-sdi-document-type": "TD06",
          			"it-sdi-format": "FPR12"
          		}
          	},
          	"supplier": {
          		"name": "MªF. Services",
          		"tax_id": {
          			"country": "IT",
          			"code": "12345678903"
          		},
          		"people": [
          			{
          				"name": {
          					"given": "GIANCARLO",
          					"surname": "ROSSI"
          				}
          			}
          		],
          		"addresses": [
          			{
          				"num": "1",
          				"street": "VIALE DELLA LIBERTÀ",
          				"locality": "ROMA",
          				"region": "RM",
          				"code": "00100",
          				"country": "IT"
          			}
          		],
          		"emails": [
          			{
          				"addr": "billing@example.com"
          			}
          		],
          		"telephones": [
          			{
          				"num": "999999999"
          			}
          		],
          		"registration": {
          			"capital": "50000.00",
          			"currency": "EUR",
          			"office": "RM",
          			"entry": "123456"
          		},
          		"ext": {
          			"it-sdi-fiscal-regime": "RF02"
          		}
          	},
          	"customer": {
          		"name": "MARIO LEONI",
          		"tax_id": {
          			"country": "IT",
          			"code": "09876543217"
          		},
          		"people": [
          			{
          				"name": {
          					"prefix": "Dott.",
          					"given": "MARIO",
          					"surname": "LEONI"
          				}
          			}
          		],
          		"inboxes": [
          			{
          				"key": "it-sdi-code",
          				"code": "M5UXCR5"
          			}
          		],
          		"addresses": [
          			{
          				"num": "1",
          				"street": "VIALE DELI LAVORATORI",
          				"locality": "ROMA",
          				"region": "RM",
          				"code": "00100",
          				"country": "IT"
          			}
          		],
          		"emails": [
          			{
          				"addr": "mario@example.com"
          			}
          		]
          	},
          	"lines": [
          		{
          			"i": 1,
          			"quantity": "20",
          			"item": {
          				"name": "Development of accounting software",
          				"price": "10.00",
          				"unit": "h"
          			},
          			"sum": "200.00",
          			"taxes": [
          				{
          					"cat": "VAT",
          					"key": "standard",
          					"rate": "general",
          					"percent": "22.0%"
          				}
          			],
          			"total": "200.00"
          		}
          	],
          	"payment": {
          		"terms": {
          			"due_dates": [
          				{
          					"date": "2023-09-01",
          					"amount": "244.00",
          					"percent": "100%"
          				}
          			]
          		},
          		"instructions": {
          			"key": "credit-transfer",
          			"credit_transfer": [
          				{
          					"iban": "IT60X0542811101000000123456",
          					"name": "MªF. Services"
          				}
          			],
          			"ext": {
          				"it-sdi-payment-means": "MP05"
          			}
          		}
          	},
          	"totals": {
          		"sum": "200.00",
          		"total": "200.00",
          		"taxes": {
          			"categories": [
          				{
          					"code": "VAT",
          					"rates": [
          						{
          							"key": "standard",
          							"base": "200.00",
          							"percent": "22.0%",
          							"amount": "44.00"
          						}
          					],
          					"amount": "44.00"
          				}
          			],
          			"sum": "44.00"
          		},
          		"tax": "44.00",
          		"total_with_tax": "244.00",
          		"payable": "244.00"
          	}
          }
          ```
        </CodeGroup>
      </Accordion>

      <Accordion title="VAT Exempt Invoice">
        In this example, we're issuing an invoice for goods or services that are exempt from VAT (IVA).

        Notice:

        * the line item includes a tax with `"key": "exempt"` indicating this is a VAT-exempt transaction,
        * the minimal version omits the exemption code extension (`it-sdi-exempt`), which will be automatically added during `gobl build`,
        * when running `gobl build`, the system calculates totals with zero VAT and validates the exemption structure,
        * the built version shows the complete document with the exemption code extension (e.g., `"it-sdi-exempt": "N4"`) applied to the tax rate,
        * exemption codes must comply with SDI requirements—consult the [complete list of exemption reasons](https://docs.gobl.org/addons/it-sdi-v1#it-sdi-exempt) in the GOBL documentation,
        * common exemption codes include N4 (exempt), N3.1 (exports), N3.2 (intra-community supplies), and N6.x (reverse charge scenarios), and,
        * the SDI validates that exempt invoices include proper exemption codes before transmission.

        <CodeGroup>
          ```json SDI Exempt Invoice theme={"system"}

          {
              "$schema": "https://gobl.org/draft-0/bill/invoice",
              "$regime": "IT",
              "$addons": [
                  "it-sdi-v1"
              ],
              "code": "INVOICE-001",
              "supplier": {
                  "name": "Example IT Supplier S.r.l.",
                  "tax_id": {
                      "country": "IT",
                      "code": "12345678903"
                  },
                  "addresses": [
                      {
                          "street": "Via Roma, 123",
                          "locality": "Milan",
                          "code": "20121",
                          "country": "IT"
                      }
                  ],
                  "emails": [
                      {
                          "addr": "info@supplier.it"
                      }
                  ]
              },
              "customer": {
                  "name": "Example IT Customer S.p.A.",
                  "tax_id": {
                      "country": "IT",
                      "code": "13029381004"
                  },
                  "addresses": [
                      {
                          "street": "Via Dante, 456",
                          "locality": "Rome",
                          "code": "00100",
                          "country": "IT"
                      }
                  ]
              },
              "lines": [
                  {
                      "quantity": "10",
                      "item": {
                          "name": "Tax Exempt Service",
                          "price": "100.00"
                      },
                      "taxes": [
                          {
                              "cat": "VAT",
                              "key": "exempt"
                          }
                      ]
                  }
              ]
          }
          ```

          ```json Built version theme={"system"}
          {
          	"$schema": "https://gobl.org/draft-0/bill/invoice",
          	"$regime": "IT",
          	"$addons": [
          		"it-sdi-v1"
          	],
          	"type": "standard",
          	"code": "INVOICE-001",
          	"issue_date": "2026-04-20",
          	"currency": "EUR",
          	"tax": {
          		"ext": {
          			"it-sdi-document-type": "TD01",
          			"it-sdi-format": "FPR12"
          		}
          	},
          	"supplier": {
          		"name": "Example IT Supplier S.r.l.",
          		"tax_id": {
          			"country": "IT",
          			"code": "12345678903"
          		},
          		"addresses": [
          			{
          				"street": "Via Roma, 123",
          				"locality": "Milan",
          				"code": "20121",
          				"country": "IT"
          			}
          		],
          		"emails": [
          			{
          				"addr": "info@supplier.it"
          			}
          		],
          		"ext": {
          			"it-sdi-fiscal-regime": "RF01"
          		}
          	},
          	"customer": {
          		"name": "Example IT Customer S.p.A.",
          		"tax_id": {
          			"country": "IT",
          			"code": "13029381004"
          		},
          		"addresses": [
          			{
          				"street": "Via Dante, 456",
          				"locality": "Rome",
          				"code": "00100",
          				"country": "IT"
          			}
          		]
          	},
          	"lines": [
          		{
          			"i": 1,
          			"quantity": "10",
          			"item": {
          				"name": "Tax Exempt Service",
          				"price": "100.00"
          			},
          			"sum": "1000.00",
          			"taxes": [
          				{
          					"cat": "VAT",
          					"key": "exempt",
          					"ext": {
          						"it-sdi-exempt": "N4"
          					}
          				}
          			],
          			"total": "1000.00"
          		}
          	],
          	"totals": {
          		"sum": "1000.00",
          		"total": "1000.00",
          		"taxes": {
          			"categories": [
          				{
          					"code": "VAT",
          					"rates": [
          						{
          							"key": "exempt",
          							"ext": {
          								"it-sdi-exempt": "N4"
          							},
          							"base": "1000.00",
          							"amount": "0.00"
          						}
          					],
          					"amount": "0.00"
          				}
          			],
          			"sum": "0.00"
          		},
          		"tax": "0.00",
          		"total_with_tax": "1000.00",
          		"payable": "1000.00"
          	}
          }
          ```
        </CodeGroup>
      </Accordion>

      <Accordion title="Credit Note">
        In this example, we're issuing a credit note (nota di credito) to correct or refund a previously issued invoice.

        Notice:

        * the `type` field is set to `credit-note` to indicate this is a corrective document,
        * the `preceding` field references the original invoice being corrected,
        * the minimal version contains only essential correction details; `gobl build` calculates negative amounts,
        * when running `gobl build`, the system automatically calculates negative totals, IVA refunds, validates the credit note structure, and applies SDI rules,
        * the built version shows all calculated fields including negative amounts for the refund and proper tax adjustments,
        * credit notes must be properly linked to the original invoice and transmitted through SDI, and,
        * the SDI system validates the credit note format before accepting and forwarding it to the recipient.

        <CodeGroup>
          ```json SDI Credit Note theme={"system"}
          {
            "$schema": "https://gobl.org/draft-0/bill/invoice",
            "$regime": "IT",
            "$addons": [
              "it-sdi-v1"
            ],
            "$tags": [
              "freelance"
            ],
            "type": "credit-note",
            "series": "CN",
            "code": "001",
            "issue_date": "2024-10-09",
            "currency": "EUR",
            "preceding": [
              {
                "uuid": "0190c0ec-8109-756b-a4f0-88c4b542ab6e",
                "type": "standard",
                "issue_date": "2023-03-02",
                "series": "SAMPLE",
                "code": "001"
              }
            ],
            "supplier": {
              "name": "MªF. Services",
              "tax_id": {
                "country": "IT",
                "code": "12345678903"
              },
              "people": [
                {
                  "name": {
                    "given": "GIANCARLO",
                    "surname": "ROSSI"
                  }
                }
              ],
              "addresses": [
                {
                  "num": "1",
                  "street": "VIALE DELLA LIBERTÀ",
                  "locality": "ROMA",
                  "region": "RM",
                  "code": "00100",
                  "country": "IT"
                }
              ],
              "registration": {
                "capital": "50000.00",
                "currency": "EUR",
                "office": "RM",
                "entry": "123456"
              },
              "ext": {
                "it-sdi-fiscal-regime": "RF02"
              }
            },
            "customer": {
              "name": "MARIO LEONI",
              "tax_id": {
                "country": "IT",
                "code": "09876543217"
              },
              "people": [
                {
                  "name": {
                    "prefix": "Dott.",
                    "given": "MARIO",
                    "surname": "LEONI"
                  }
                }
              ],
              "inboxes": [
                {
                  "key": "it-sdi-code",
                  "code": "M5UXCR5"
                }
              ],
              "addresses": [
                {
                  "num": "1",
                  "street": "VIALE DELI LAVORATORI",
                  "locality": "ROMA",
                  "region": "RM",
                  "code": "00100",
                  "country": "IT"
                }
              ],
              "emails": [
                {
                  "addr": "mario@example.com"
                }
              ]
            },
            "lines": [
              {
                "quantity": "20",
                "item": {
                  "name": "Development of accounting software",
                  "price": "10.00",
                  "unit": "h"
                },
                "taxes": [
                  {
                    "cat": "VAT",
                    "rate": "standard"
                  }
                ]
              }
            ],
            "payment": {
              "instructions": {
                "key": "credit-transfer",
                "credit_transfer": [
                  {
                    "iban": "IT60X0542811101000000123456",
                    "name": "MªF. Services"
                  }
                ]
              }
            }
          }

          ```

          ```json Built version theme={"system"}
          {
          	"$schema": "https://gobl.org/draft-0/bill/invoice",
          	"$regime": "IT",
          	"$addons": [
          		"it-sdi-v1"
          	],
          	"$tags": [
          		"freelance"
          	],
          	"type": "credit-note",
          	"series": "CN",
          	"code": "001",
          	"issue_date": "2024-10-09",
          	"currency": "EUR",
          	"preceding": [
          		{
          			"uuid": "0190c0ec-8109-756b-a4f0-88c4b542ab6e",
          			"type": "standard",
          			"issue_date": "2023-03-02",
          			"series": "SAMPLE",
          			"code": "001"
          		}
          	],
          	"tax": {
          		"ext": {
          			"it-sdi-document-type": "TD04",
          			"it-sdi-format": "FPR12"
          		}
          	},
          	"supplier": {
          		"name": "MªF. Services",
          		"tax_id": {
          			"country": "IT",
          			"code": "12345678903"
          		},
          		"people": [
          			{
          				"name": {
          					"given": "GIANCARLO",
          					"surname": "ROSSI"
          				}
          			}
          		],
          		"addresses": [
          			{
          				"num": "1",
          				"street": "VIALE DELLA LIBERTÀ",
          				"locality": "ROMA",
          				"region": "RM",
          				"code": "00100",
          				"country": "IT"
          			}
          		],
          		"registration": {
          			"capital": "50000.00",
          			"currency": "EUR",
          			"office": "RM",
          			"entry": "123456"
          		},
          		"ext": {
          			"it-sdi-fiscal-regime": "RF02"
          		}
          	},
          	"customer": {
          		"name": "MARIO LEONI",
          		"tax_id": {
          			"country": "IT",
          			"code": "09876543217"
          		},
          		"people": [
          			{
          				"name": {
          					"prefix": "Dott.",
          					"given": "MARIO",
          					"surname": "LEONI"
          				}
          			}
          		],
          		"inboxes": [
          			{
          				"key": "it-sdi-code",
          				"code": "M5UXCR5"
          			}
          		],
          		"addresses": [
          			{
          				"num": "1",
          				"street": "VIALE DELI LAVORATORI",
          				"locality": "ROMA",
          				"region": "RM",
          				"code": "00100",
          				"country": "IT"
          			}
          		],
          		"emails": [
          			{
          				"addr": "mario@example.com"
          			}
          		]
          	},
          	"lines": [
          		{
          			"i": 1,
          			"quantity": "20",
          			"item": {
          				"name": "Development of accounting software",
          				"price": "10.00",
          				"unit": "h"
          			},
          			"sum": "200.00",
          			"taxes": [
          				{
          					"cat": "VAT",
          					"key": "standard",
          					"rate": "general",
          					"percent": "22.0%"
          				}
          			],
          			"total": "200.00"
          		}
          	],
          	"payment": {
          		"instructions": {
          			"key": "credit-transfer",
          			"credit_transfer": [
          				{
          					"iban": "IT60X0542811101000000123456",
          					"name": "MªF. Services"
          				}
          			],
          			"ext": {
          				"it-sdi-payment-means": "MP05"
          			}
          		}
          	},
          	"totals": {
          		"sum": "200.00",
          		"total": "200.00",
          		"taxes": {
          			"categories": [
          				{
          					"code": "VAT",
          					"rates": [
          						{
          							"key": "standard",
          							"base": "200.00",
          							"percent": "22.0%",
          							"amount": "44.00"
          						}
          					],
          					"amount": "44.00"
          				}
          			],
          			"sum": "44.00"
          		},
          		"tax": "44.00",
          		"total_with_tax": "244.00",
          		"payable": "244.00"
          	}
          }
          ```
        </CodeGroup>
      </Accordion>
    </AccordionGroup>

    See also the [stamp duty (Marca da Bollo) regulation](/compliance/italy#regulation) for details on when the €2 *imposta di bollo* applies.
  </Tab>
</Tabs>

***

<AccordionGroup>
  <Accordion title="🇮🇹 Invopop resources for Italy">
    |            |                                                                                                                                                                                                                                                                                                                                                                                         |
    | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    | Compliance | <Icon icon="https://assets.invopop.com/flags/it.svg" /> [Invoicing compliance in Italy](/compliance/italy)<br /> <Icon icon="timeline" /> [Compliance timeline](/timelines/italy)                                                                                                                                                                                                       |
    | Apps       | <Icon icon="https://assets.invopop.com/apps/sdi-italy/icon.svg" /> [SDI Italy](/apps/sdi-italy)<br /><Icon icon="https://assets.invopop.com/apps/agenzia-entrate/icon.svg" /> [Smart Receipts Italy](/apps/smart-receipts-italy)                                                                                                                                                        |
    | Guides     | <Icon icon="book" /> [SDI Sending Guide](/guides/it-sdi-sending)<br /><Icon icon="book" /> [SDI Receiving Guide](/guides/it-sdi-receiving)<br /><Icon icon="book" /> [Ticket Guide](/guides/it-ticket)                                                                                                                                                                                  |
    | FAQ        | <Icon icon="square-question" /> [Italy FAQ](/faq/italy)                                                                                                                                                                                                                                                                                                                                 |
    | GOBL       | <Icon icon="https://assets.invopop.com/icons/gobl.svg" />  [Italy Tax Regime](https://docs.gobl.org/regimes/it)<br /> <Icon icon="https://assets.invopop.com/icons/gobl.svg" /> [Italy SDI FatturaPA Addon](https://docs.gobl.org/addons/it-sdi-v1)<br /> <Icon icon="https://assets.invopop.com/icons/gobl.svg" /> [Italy AdE Ticket Addon](https://docs.gobl.org/addons/it-ticket-v1) |
    | GitHub     | <Icon icon="github" /> [gobl.fatturapa](https://github.com/invopop/gobl.fatturapa)                                                                                                                                                                                                                                                                                                      |
  </Accordion>
</AccordionGroup>

***

<Card title="Participate in our community" icon="square-question" href="https://community.invopop.com" arrow="true" horizontal>
  Ask and answer questions about SDI Italy App →
</Card>
