> ## 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.

# Invoice lifecycle status in Italy

> How SDI reports what happened to an invoice you sent, and what each notification means.

export const itImportStatusWorkflow = {
  "name": "Import invoice status",
  "description": "Record an SDI notification about an invoice you sent",
  "schema": "bill/status",
  "steps": [{
    "id": "92d923d7-0d5a-4ee2-a7f9-f9fbd89f1650",
    "name": "Import status from SDI",
    "provider": "gov-it.sdi.import.status",
    "summary": "Turn the SDI notification into a status entry"
  }],
  "rescue": []
};

export const WorkflowDiagram = ({workflow}) => {
  const stateColors = {
    processing: "yellow",
    sent: "blue",
    received: "blue",
    registered: "green",
    completed: "green",
    error: "red"
  };
  const StateChip = ({state, label}) => <Badge size="sm" color={stateColors[state] || "gray"} icon="square-small" iconType="solid">
      {label.charAt(0).toUpperCase() + label.slice(1)}
    </Badge>;
  const providerIcons = {
    "silo.state": "https://silo.invopop.com/images/status.svg",
    "silo.close": "https://silo.invopop.com/images/check-badge.svg",
    "silo.if": "https://assets.invopop.com/apps/silo/if.svg",
    "silo.folder": "https://silo.invopop.com/images/folder.svg",
    "silo.modify": "https://silo.invopop.com/images/modify.svg",
    "silo.correct": "https://silo.invopop.com/images/replace.svg",
    "silo.sleep": "https://assets.invopop.com/icons/sleep.svg",
    silo: "https://assets.invopop.com/apps/silo/icon.svg",
    "sequence.enumerate": "https://sequence.invopop.com/images/enumerate.svg",
    "transform.job.create": "https://transform.invopop.com/images/jobs.svg",
    webhook: "https://webhook.invopop.com/icon.svg",
    lookup: "https://lookup.invopop.com/icon.png",
    dropbox: "https://dropbox.invopop.com/icon.png",
    pdf: "https://pdf.invopop.com/file-pdf.svg",
    peppol: "https://assets.invopop.com/apps/peppol/icon.svg",
    ubl: "https://assets.invopop.com/apps/ubl/logo.svg",
    cii: "https://assets.invopop.com/apps/cii/logo.svg",
    "gov-dk": "https://assets.invopop.com/flags/dk.svg",
    "gov-fi": "https://assets.invopop.com/flags/fi.svg",
    "gov-fr": "https://assets.invopop.com/flags/fr.svg",
    "chorus-pro": "https://assets.invopop.com/apps/chroruspro/icon.svg",
    "gov-es": "https://assets.invopop.com/apps/gov-es/icon.svg",
    "gov-es.sii": "https://assets.invopop.com/apps/sii/icon.svg",
    "gov-es.ticketbai": "https://assets.invopop.com/apps/ticketbai/icon.svg",
    "gov-es.facturae": "https://assets.invopop.com/apps/facturae/icon.svg",
    verifactu: "https://assets.invopop.com/apps/verifactu/icon.svg",
    "gov-pl": "https://assets.invopop.com/apps/ksef/icon.svg",
    "gov-sa": "https://assets.invopop.com/apps/zatca/icon.svg",
    "gov-ar": "https://assets.invopop.com/apps/arca/icon.svg",
    "at-pt": "https://assets.invopop.com/apps/at-pt/icon.svg",
    "sat-mx": "https://assets.invopop.com/apps/sat-mexico/icon.svg",
    "sw-sapien": "https://assets.invopop.com/apps/sw-sapien/icon.svg",
    "sdi-it": "https://assets.invopop.com/apps/sdi-italy/icon.svg",
    "ticket-it": "https://assets.invopop.com/apps/agenzia-entrate/icon.svg",
    "nfe-br": "https://assets.invopop.com/apps/notas-fiscais-eletronicas-brazil/icon.svg",
    chargebee: "https://assets.invopop.com/apps/chargebee/icon.svg",
    stripe: "https://assets.invopop.com/apps/stripe/icon.svg",
    email: "https://assets.invopop.com/apps/email/icon.svg",
    cron: "https://assets.invopop.com/apps/cron/icon.svg",
    ilyda: "https://assets.invopop.com/apps/ilyda/icon.svg",
    invoicexpress: "https://assets.invopop.com/apps/invoicexpress/icon.svg",
    plemsi: "https://assets.invopop.com/flags/co.svg"
  };
  const iconFor = provider => {
    const parts = (provider || "").split(".");
    for (let i = parts.length; i > 0; i--) {
      const url = providerIcons[parts.slice(0, i).join(".")];
      if (url) return url;
    }
    return null;
  };
  const StepIcon = ({provider}) => {
    const url = iconFor(provider);
    return <span title={provider} className="flex h-7 w-7 shrink-0 items-center justify-center rounded-md border border-gray-950/10 bg-white dark:border-white/10 dark:bg-white/5">
        {url ? <img src={url} alt="" className="h-4 w-4" /> : null}
      </span>;
  };
  const renderSummary = summary => {
    const nodes = [];
    const re = /`([^`]+)`(\{[^}]*\})?/g;
    let last = 0;
    let m;
    let k = 0;
    while ((m = re.exec(summary)) !== null) {
      if (m.index > last) nodes.push(summary.slice(last, m.index));
      const attrs = m[2] || "";
      if (attrs.indexOf(".state") >= 0) {
        const state = (attrs.match(/\.state\s+\.([\w-]+)/) || [])[1] || m[1];
        nodes.push(<StateChip key={k++} state={state} label={m[1]} />);
      } else if (attrs) {
        nodes.push(<span key={k++} className="text-sm font-medium text-gray-700 dark:text-gray-300">
            {m[1]}
          </span>);
      } else {
        nodes.push(<code key={k++} className="text-sm rounded bg-gray-100 px-1 font-mono text-sm dark:bg-white/10">
            {m[1]}
          </code>);
      }
      last = m.index + m[0].length;
    }
    if (last < summary.length) nodes.push(summary.slice(last));
    return nodes;
  };
  const NoteRow = ({text}) => <div className="mt-4 mb-1 font-mono text-sm leading-5 text-gray-400 dark:text-gray-500">{"// " + text}</div>;
  const renderSteps = (steps, counter) => (steps || []).map(step => {
    counter.n += 1;
    const n = counter.n;
    const branches = (step.next || []).filter(b => b.steps && b.steps.length > 0);
    return <div key={step.id || "step-" + n}>
          {step.notes ? <NoteRow text={step.notes} /> : null}
          <div className="mt-2.5 flex items-center">
            <span className="absolute left-0 w-10 text-center font-mono text-sm text-gray-400 select-none dark:text-gray-500">
              {n}
            </span>
            <div className="flex min-w-0 flex-1 items-center gap-2 rounded-xl border border-gray-950/5 bg-white px-2 py-2 dark:border-white/10 dark:bg-gray-900">
              <StepIcon provider={step.provider} />
              <span className="text-sm shrink-0 font-medium text-gray-900 dark:text-gray-100">{step.name}</span>
              {step.summary ? <span className="text-sm min-w-0 truncate text-gray-500 dark:text-gray-400">{renderSummary(step.summary)}</span> : null}
            </div>
          </div>
          {branches.length > 0 ? <div className="ml-5 border-l border-gray-200 -my-1 py-1 pl-6 dark:border-white/10">
              {branches.map((branch, bi) => <div key={branch.code || branch.status || bi}>
                  <div className="mt-4">
                    <span className="rounded-md bg-gray-200/70 px-2 py-1 font-mono text-sm text-gray-600 dark:bg-white/10 dark:text-gray-300">
                      {branch.code || branch.status}
                    </span>
                  </div>
                  {renderSteps(branch.steps, counter)}
                </div>)}
            </div> : null}
        </div>;
  });
  const counter = {
    n: 0
  };
  const wf = workflow || ({});
  return <div className="not-prose relative my-5 rounded-2xl border border-gray-950/5 bg-gray-50 py-3 pr-4 pb-5 pl-12 dark:border-white/10 dark:bg-white/[0.03]">
      {renderSteps(wf.steps, counter)}
      {wf.rescue && wf.rescue.length > 0 ? <div className="mt-6 border-t border-dashed border-gray-300 dark:border-white/10">
          <NoteRow text="If any step fails" />
          {renderSteps(wf.rescue, counter)}
        </div> : null}
    </div>;
};

Sending an invoice to SDI happens in two phases. First, SDI answers the submission itself: it either takes charge of the file or refuses it outright. Everything after that is asynchronous — SDI works through validation and delivery on its own schedule and reports each outcome by posting a notification back.

Those notifications are what tell you whether the invoice actually reached the buyer, and for public administrations, whether the buyer accepted it. Each one becomes a [bill/status](https://docs.gobl.org/draft-0/bill/status#status) entry attached to the invoice.

## The lifecycle

```mermaid theme={"system"}
flowchart TD
    A["Send invoice to SDI"] --> B{"File accepted?"}
    B -->|"No"| BF["Errore EI01, EI02, EI03<br/>Not taken in charge"]
    B -->|"Yes"| C["Taken in charge"]

    C --> VAL{"SDI validation"}
    VAL -->|"Fail"| SC["NS<br/>Rejected by SDI"]
    VAL -->|"Pass"| RT{"Recipient"}

    RT -->|"Business"| BDEL{"Delivery"}
    BDEL -->|"Delivered"| BRC["RC<br/>Delivered"]
    BDEL -->|"Undeliverable"| BMC["MC<br/>Parked in cassetto fiscale"]

    RT -->|"Public administration"| GDEL{"Delivery"}
    GDEL -->|"Delivered"| GRC["RC<br/>Delivered to the PA"]
    GDEL -->|"Undeliverable"| GMC["MC<br/>SDI keeps retrying"]

    GMC -->|"Delivered"| GRC
    GMC -->|"Given up"| GAT["AT<br/>Transmission attested"]

    GRC --> GPA{"PA replies?"}
    GPA -->|"Accepts"| GEC01["NE / EC01<br/>Accepted"]
    GPA -->|"Rejects"| GEC02["NE / EC02<br/>Rejected"]
    GPA -->|"Silence"| GDT["DT<br/>Can no longer be rejected"]

    %% Invopop palette - skills/mermaid-style
    classDef actor fill:#ffffff,stroke:#169958,stroke-width:1px,color:#103830
    classDef system fill:#e8f5ee,stroke:#169958,stroke-width:1px,color:#103830
    classDef authority fill:#169958,stroke:#0f7a45,stroke-width:1.5px,color:#ffffff
    classDef decision fill:#f4faf6,stroke:#169958,stroke-width:1px,color:#103830
    classDef muted fill:#f4f4f5,stroke:#9ca3af,stroke-width:1px,color:#4b5563
    linkStyle default stroke:#94a3b8

    class A actor
    class C,BF,SC,BRC,BMC,GRC,GMC,GAT,GEC01,GEC02,GDT system
    class B,VAL,RT,BDEL,GDEL,GPA decision
```

## Submission

The send step reports SDI's immediate answer. When SDI takes charge of the file it returns an identifier for the submission, and every later notification about that invoice refers to it. When SDI refuses the file outright it returns an error code instead, and the step fails with `KO`.

| Code   | Meaning                      |
| ------ | ---------------------------- |
| `EI01` | The file is empty            |
| `EI02` | The service is unavailable   |
| `EI03` | The sender is not authorised |

Being taken in charge is not the same as being accepted. Validation comes next, and an invoice can still be rejected minutes later.

## Business invoices

For invoices to businesses and consumers, the lifecycle is short: SDI validates, then either delivers or parks the invoice.

| Notification                  | Status         | Typically within | Meaning                                                                                            |
| ----------------------------- | -------------- | ---------------- | -------------------------------------------------------------------------------------------------- |
| `NS` — *notifica di scarto*   | `error`        | Minutes          | SDI's validators rejected the file                                                                 |
| `RC` — *ricevuta di consegna* | `acknowledged` | 5 days           | Delivered to the recipient                                                                         |
| `MC` — *mancata consegna*     | `acknowledged` | 5 days           | SDI could not deliver, so the invoice is parked in the recipient's tax drawer (*cassetto fiscale*) |

A rejected invoice has no legal existence. Correct it and send a fresh one — this is not a case for a credit note.

`MC` is not a failure. The invoice is filed and the recipient can collect it from their *cassetto fiscale*, which is why it counts as acknowledged rather than an error.

## Public administration invoices

<Note>
  Invoices to public administrations are not yet supported for sending. This section describes the lifecycle they follow, and applies once they are.
</Note>

Invoices to a public body carry a second act: after delivery, the buyer has 15 days to accept or reject.

| Notification                          | Status         | Typically within | Meaning                                                   |
| ------------------------------------- | -------------- | ---------------- | --------------------------------------------------------- |
| `NS` — *notifica di scarto*           | `error`        | Minutes          | SDI's validators rejected the file                        |
| `MC` — *mancata consegna*             | `processing`   | 5 days           | SDI could not deliver yet, and keeps retrying for 10 days |
| `RC` — *ricevuta di consegna*         | `acknowledged` | 15 days          | Delivered to the public body                              |
| `AT` — *attestazione di trasmissione* | `error`        | 15 days          | Delivery was given up. See below                          |
| `NE` / `EC01` — *notifica esito*      | `accepted`     | 30 days          | The public body accepted the invoice                      |
| `NE` / `EC02` — *notifica esito*      | `rejected`     | 30 days          | The public body rejected the invoice                      |
| `DT` — *decorrenza termini*           | `accepted`     | 30 days          | The public body did not reply. See below                  |

<AccordionGroup>
  <Accordion title="AT — the invoice never arrived, and you must deliver it yourself">
    SDI gave up delivering to the public body, and issues an attestation: legal proof that you transmitted the invoice and that the failure is not yours.

    This is not a fix-and-resubmit like `NS`. The invoice stands, but it is now on you to send both the invoice and the attestation to the public body directly, outside SDI. That direct delivery is required for the invoice to be payable — the attestation is what authorises the public body to process an invoice that did not reach it through SDI.

    It reports as an `error` because it needs you to act, not because anything is wrong with the invoice.
  </Accordion>

  <Accordion title="DT — silence, which in practice means accepted">
    The public body had 15 days to accept or reject and did neither, so SDI closes the process. From then on it discards any further communication about that invoice, which means the public body can no longer reject it.

    SDI does not call this an acceptance. In practice the invoice proceeds as one: rejection is off the table, and it appears as accepted in the PCC (*Piattaforma dei Crediti Commerciali*), which tracks what public administrations owe. Any remaining dispute is settled between you and the buyer, outside SDI.
  </Accordion>
</AccordionGroup>

## Receiving the notifications

Each notification runs the status workflow configured on the Italy app, which records it against the invoice it belongs to.

<Tabs>
  <Tab title="Workflow">
    <WorkflowDiagram workflow={itImportStatusWorkflow} />
  </Tab>

  <Tab title="Code">
    ```json Example import invoice status workflow theme={"system"}
    {
      "name": "Import invoice status",
      "description": "Record an SDI notification about an invoice you sent",
      "schema": "bill/status",
      "steps": [
        {
          "id": "92d923d7-0d5a-4ee2-a7f9-f9fbd89f1650",
          "name": "Import status from SDI",
          "provider": "gov-it.sdi.import.status",
          "summary": "Turn the SDI notification into a status entry"
        }
      ],
      "rescue": []
    }
    ```
  </Tab>
</Tabs>

Recording the status is where the app's job ends. What follows — updating the invoice, alerting someone, telling your own systems — is yours to build as steps after the import. The step reports the status it recorded as its result code, so your workflow can treat `acknowledged` differently from `rejected`.

### What a status entry holds

Every entry carries the `SDI` series and the SDI message identifier as its code, with the submission identifier in its metadata so it can be traced back to the invoice.

The status line records the outcome as one of GOBL's own keys — `acknowledged`, `accepted`, `rejected`, `error` or `processing` — with the exact Italian notification code preserved alongside it in the `it-sdi-notification` extension, and a plain-language description of what happened.

Entries are typed by who is speaking. Notifications from SDI are an `update`, since the platform is reporting; a `NE` is a `response`, because there the buyer is answering.

## FAQ

<AccordionGroup>
  <Accordion title="How do I configure my workspace for Italian invoicing?">
    Install the [Italy app](/apps/italy) for structured invoicing through SDI, or the Smart Receipts app for B2C-only AdE CF receipts. Run invoices through a workflow with the **Send invoice to SDI** step — see the [issuing guide](/guides/it-sdi-invoicing).
  </Accordion>

  <Accordion title="How do I issue a documento commerciale (scontrino)?">
    Retail receipts (*documento commerciale*, commonly called *scontrino*) are not SDI invoices — they are reported to the tax authority as *corrispettivi* through a separate channel. Use the [Smart Receipts Italy app](/apps/smart-receipts-italy) for those, and see the [Smart Receipts issuing guide](/guides/it-ticket).
  </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 **Send invoice to SDI** step completes as soon as SDI accepts the file — it doesn't wait for SDI's verdict. What takes time is SDI's own processing: a rejection usually arrives within minutes, but delivery confirmations can take up to 5 days. Each verdict is recorded against the invoice as a status entry, so nothing is stuck while you wait. See the [status guide](/guides/it-sdi-status) for the full lifecycle.
  </Accordion>

  <Accordion title="How do I know if my invoice was delivered successfully?">
    SDI confirms delivery with an `RC` (*ricevuta di consegna*) notification, recorded on the invoice as a status entry with the GOBL status `acknowledged`. A rejection arrives as `NS` with status `error`. Every notification and what it means is covered in the [status guide](/guides/it-sdi-status).
  </Accordion>

  <Accordion title="How do I test different SDI outcomes in the sandbox?">
    Set a reserved *codice destinatario* on the customer — for example `SIMNS00` to simulate a rejection. The sandbox simulates SDI end to end and feeds back the notifications a real exchange would produce; any ordinary code resolves to a successful delivery. The full list of reserved codes is in the [issuing guide](/guides/it-sdi-invoicing#testing-in-the-sandbox).
  </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"
                }
            ]
        }
    }
    ```
  </Accordion>
</AccordionGroup>

More available in our [Italy FAQ](/faq/italy) section

***

<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/flags/it.svg" /> [Italy](/apps/italy)<br /><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 — [Issuing invoices](/guides/it-sdi-invoicing) · [Status](/guides/it-sdi-status) · [Receiving invoices](/guides/it-sdi-reception) · [Archiving](/guides/it-sdi-archiving)<br /><Icon icon="book" /> [SDI sending guide (legacy)](/guides/it-sdi-sending)<br /><Icon icon="book" /> [SDI receiving guide (legacy)](/guides/it-sdi-receiving)<br /><Icon icon="book" /> [Smart Receipts supplier registration](/guides/it-ticket-supplier)<br /><Icon icon="book" /> [Smart Receipts issuing 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="forumbee" href="https://community.invopop.com" arrow="true" horizontal>
  Ask and answer questions about invoicing in Italy →
</Card>
