Run with Postman

SDI

This service allows you to handle interactions with the Italian SDI (Sistema Di Interscambio)

You can configure your account to send invoices directly to the legal storage by setting the api_configuration to your needs

Before we begin

In order to operate, you should register our Recipient Code on the Italian Revenue Agency's website. Please follow this step-by-step guide and provide the following code when needed: JKKZDGR

Get started:

Reactivating a BusinessRegistryConfiguration

If you receive a callback but you have no credit left on your wallet, your account will be temporarily suspended: when this happens, you will be sent a reminder email immediately. In order to re-activate it after a wallet recharge, you would need to submit a PATCH request to /business_registry_configurations/{fiscal_id}/activate

Interacting with the Public Administration (PA)

Invoices to the Public Administration are automatically detected and signed.

ApiConfigurations

Create an ApiConfiguration for a fiscal_id

Create the configurations of your callback endpoints.

All the notifications received by SDI will be dispatched to your configured endpoints.
The fiscal_id is the unique identifier of the business that you want to configure.

You can create separate endpoints for each event: the event code can be one of supplier-invoice, customer-invoice, customer-notification, legal-storage-missing-vat, legal-storage-receipt

Authorizations:
Request Body schema: application/json
fiscal_id
string
Default: "<string>"
Array of objects 2 items [ items ]

Responses

Response Schema: application/json
Array of objects (ApiConfiguration-read) <= 2 items [ items ]

The list of ApiConfiguration created for this fiscal_id

message
string
success
boolean
error
string <nullable>

Callbacks

Request samples

Content type
application/json
{
  • "fiscal_id": "000133445566",
  • "callbacks": []
}

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "message": "string",
  • "success": true,
  • "error": "string"
}

Callback payload samples

Callback
POST: {your_url}
Content type
application/json
Example
{
  • "event": "customer-invoice",
  • "data": {
    }
}

Retrieve a list of ApiConfigurations

Authorizations:
query Parameters
fiscal_id
string
Default: "<string>"

Filters for a fiscal_id

Responses

Response Schema: application/json
Array of objects (ApiConfiguration-read) <= 2 items [ items ]
message
string
success
boolean
error
string <nullable>

Request samples

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "https://sdi.openapi.it/api_configurations?fiscal_id=SOME_STRING_VALUE");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Authorization: Bearer REPLACE_BEARER_TOKEN");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "message": "string",
  • "success": true,
  • "error": "string"
}

Delete of ApiConfigurations

Authorizations:
path Parameters
id
required
string
Default: "<string>"

The id of the ApiConfiguration

Responses

Response Schema: application/json
data
string
message
string
success
boolean
error
string <nullable>

Request samples

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "https://sdi.openapi.it/api_configurations/%7Bid%7D");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Authorization: Bearer REPLACE_BEARER_TOKEN");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);

Response samples

Content type
application/json
{
  • "data": null,
  • "message": "Deleted",
  • "success": true,
  • "error": "string"
}

Create invoices

Both standard and simplified invoices are supported, to private entities or to the Public Administration

Create an invoice

Create a new invoice and send it to the government channel. You should explicit the request body format using the content-type header. Your invoice will be queued instantly and you will get back the invoice UUID as a callback

Authorizations:
Request Body schema:
required
object (FatturaPAFatturaElettronicaHeader-read)
required
Array of objects (FatturaPAFatturaElettronicaBody-read) 2 items [ items ]

Responses

Response Schema: application/json
object
message
string
success
boolean
error
string <nullable>

Request samples

Content type
{
  • "fattura_elettronica_header": {
    },
  • "fattura_elettronica_body": [
    ]
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "message": "",
  • "success": true,
  • "error": "string"
}

Create an invoice applying the signature

Create a new invoice and send it to the government channel. You should explicit the request body format using the content-type header. Your invoice will be queued instantly and you will get back the invoice UUID as a callback

Authorizations:
Request Body schema: application/xml
required
object (FatturaPAFatturaElettronicaHeader-read)
required
Array of objects (FatturaPAFatturaElettronicaBody-read) 2 items [ items ]

Responses

Response Schema: application/json
object
message
string
success
boolean
error
string <nullable>

Request samples

Content type
application/xml
<?xml version="1.0" encoding="UTF-8"?>
<p:FatturaElettronica versione="FPR12" >
    <FatturaElettronicaHeader>
        <DatiTrasmissione>
            <IdTrasmittente>
                <IdPaese>IT</IdPaese>
                <IdCodice>10442360961</IdCodice>
            </IdTrasmittente>
            <ProgressivoInvio>06V27</ProgressivoInvio>
            <FormatoTrasmissione>FPR12</FormatoTrasmissione>
            <CodiceDestinatario>Codice destinatario</CodiceDestinatario>
        </DatiTrasmissione>
        <CedentePrestatore>
            <DatiAnagrafici>
                <IdFiscaleIVA>
                    <IdPaese>IT</IdPaese>
                    <IdCodice>Codice destinatario</IdCodice>
                </IdFiscaleIVA>
                <Anagrafica>
                    <Denominazione>John Doe</Denominazione>
                </Anagrafica>
                <RegimeFiscale>RF01</RegimeFiscale>
            </DatiAnagrafici>
            <Sede>
                <Indirizzo>Via di Qua, 1</Indirizzo>
                <CAP>20145</CAP>
                <Comune>Milano</Comune>
                <Provincia>MI</Provincia>
                <Nazione>IT</Nazione>
            </Sede>
        </CedentePrestatore>
        <CessionarioCommittente>
            <DatiAnagrafici>
                <IdFiscaleIVA>
                    <IdPaese>IT</IdPaese>
                    <IdCodice>09876543211</IdCodice>
                </IdFiscaleIVA>
                <Anagrafica>
                    <Denominazione>Jane Doe</Denominazione>
                </Anagrafica>
            </DatiAnagrafici>
            <Sede>
                <Indirizzo>Via di La, 2</Indirizzo>
                <CAP>20145</CAP>
                <Comune>Milano</Comune>
                <Provincia>MI</Provincia>
                <Nazione>IT</Nazione>
            </Sede>
        </CessionarioCommittente>
    </FatturaElettronicaHeader>
    <FatturaElettronicaBody>
        <DatiGenerali>
            <DatiGeneraliDocumento>
                <TipoDocumento>TD01</TipoDocumento>
                <Divisa>EUR</Divisa>
                <Data>2018-07-10</Data>
                <Numero>1</Numero>
            </DatiGeneraliDocumento>
        </DatiGenerali>
        <DatiBeniServizi>
            <DettaglioLinee>
                <NumeroLinea>1</NumeroLinea>
                <Descrizione>Descrizione articolo</Descrizione>
                <PrezzoUnitario>10.00</PrezzoUnitario>
                <PrezzoTotale>10.00</PrezzoTotale>
                <AliquotaIVA>22.00</AliquotaIVA>
            </DettaglioLinee>
            <DatiRiepilogo>
                <AliquotaIVA>22.00</AliquotaIVA>
                <ImponibileImporto>10.00</ImponibileImporto>
                <Imposta>2.20</Imposta>
            </DatiRiepilogo>
        </DatiBeniServizi>
    </FatturaElettronicaBody>
</p:FatturaElettronica>

Response samples

Content type
application/json
{
  • "data": {
    },
  • "message": "",
  • "success": true,
  • "error": "string"
}

Invoices

Retrieve collection of Invoice resources.

Authorizations:
query Parameters
createdAt[before]
string
Default: "<string>"
createdAt[strictly_before]
string
Default: "<string>"
createdAt[after]
string
Default: "<string>"
createdAt[strictly_after]
string
Default: "<string>"
signed
boolean
Default: "<boolean>"
downloaded
boolean
Default: "<boolean>"
toPa
string
Default: "<string>"

Search invoices that was sent to PA.

type
string
Default: "<string>"

When type is 0 search for invoices sent to a customer, when type is 1 search for invoice received by a supplier

sender
string
Default: "<string>"

Search by sender (vat number OR fiscal code). You can specify more values at once comma separated.

recipient
string
Default: "<string>"

Search by recipient (vat number OR fiscal code). You can specify more values at once comma separated.

invoiceDate[before]
string
Default: "<string>"
invoiceDate[strictly_before]
string
Default: "<string>"
invoiceDate[after]
string
Default: "<string>"
invoiceDate[strictly_after]
string
Default: "<string>"
invoiceNumber
string
Default: "<string>"
recipient.businessName
string
Default: "<string>"
recipient.businessVatNumberCode
string
Default: "<string>"
recipient.businessVatNumberCode[]
Array of strings 2 items
recipient.businessFiscalCode
string
Default: "<string>"
recipient.businessFiscalCode[]
Array of strings 2 items
sender.businessName
string
Default: "<string>"
sender.businessVatNumberCode
string
Default: "<string>"
sender.businessVatNumberCode[]
Array of strings 2 items
sender.businessFiscalCode
string
Default: "<string>"
sender.businessFiscalCode[]
Array of strings 2 items
marking
string
Default: "<string>"
marking[]
Array of strings 2 items
page
integer
Default: "<integer>"

The collection page number

Responses

Response Schema: application/json
Array (<= 2 items)
created_at
string <date-time>
uuid
string
type
integer
payload
string
object (BusinessRegistry-read)
object (BusinessRegistry-read)
notifications
Array of strings 2 items
sdi_file_name
string
sdi_file_id
string
signed
boolean
legally_stored
boolean
object (PreservedDocument-read)
downloaded
boolean

The invoice was downloaded (automatically when received by webhook or manually for polling integrations).

downloaded_at
string <date-time>
marking
string

The marking represent the current status of the invoice.

notice
string
retry_information
string
transmission_format
string

Transmission format specified into the invoice.

to_pa
boolean

Request samples

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "https://sdi.openapi.it/invoices?createdAt%5Bbefore%5D=SOME_STRING_VALUE&createdAt%5Bstrictly_before%5D=SOME_STRING_VALUE&createdAt%5Bafter%5D=SOME_STRING_VALUE&createdAt%5Bstrictly_after%5D=SOME_STRING_VALUE&signed=SOME_BOOLEAN_VALUE&downloaded=SOME_BOOLEAN_VALUE&toPa=SOME_STRING_VALUE&type=SOME_STRING_VALUE&sender=SOME_STRING_VALUE&recipient=SOME_STRING_VALUE&invoiceDate%5Bbefore%5D=SOME_STRING_VALUE&invoiceDate%5Bstrictly_before%5D=SOME_STRING_VALUE&invoiceDate%5Bafter%5D=SOME_STRING_VALUE&invoiceDate%5Bstrictly_after%5D=SOME_STRING_VALUE&invoiceNumber=SOME_STRING_VALUE&recipient.businessName=SOME_STRING_VALUE&recipient.businessVatNumberCode=SOME_STRING_VALUE&recipient.businessVatNumberCode%5B%5D=SOME_ARRAY_VALUE&recipient.businessFiscalCode=SOME_STRING_VALUE&recipient.businessFiscalCode%5B%5D=SOME_ARRAY_VALUE&sender.businessName=SOME_STRING_VALUE&sender.businessVatNumberCode=SOME_STRING_VALUE&sender.businessVatNumberCode%5B%5D=SOME_ARRAY_VALUE&sender.businessFiscalCode=SOME_STRING_VALUE&sender.businessFiscalCode%5B%5D=SOME_ARRAY_VALUE&marking=SOME_STRING_VALUE&marking%5B%5D=SOME_ARRAY_VALUE&page=SOME_INTEGER_VALUE");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Authorization: Bearer REPLACE_BEARER_TOKEN");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);

Response samples

Content type
application/json
[
  • {
    }
]

Retrieve Invoice resource.

Get an invoice in application/json by default

Authorizations:
path Parameters
uuid
required
string
Default: "<string>"

Responses

Response Schema: application/json
created_at
string <date-time>
uuid
string
type
integer
payload
string
object (BusinessRegistry-read)
object (BusinessRegistry-read)
notifications
Array of strings 2 items
sdi_file_name
string
sdi_file_id
string
signed
boolean
legally_stored
boolean
object (PreservedDocument-read)
downloaded
boolean

The invoice was downloaded (automatically when received by webhook or manually for polling integrations).

downloaded_at
string <date-time>
marking
string

The marking represent the current status of the invoice.

notice
string
retry_information
string
transmission_format
string

Transmission format specified into the invoice.

to_pa
boolean

Request samples

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "https://sdi.openapi.it/invoices/%7Buuid%7D");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Authorization: Bearer REPLACE_BEARER_TOKEN");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);

Response samples

Content type
application/json
{
  • "created_at": "2019-08-24T14:15:22Z",
  • "uuid": "string",
  • "type": 0,
  • "payload": "string",
  • "sender": {
    },
  • "recipient": {
    },
  • "notifications": [
    ],
  • "sdi_file_name": "string",
  • "sdi_file_id": "string",
  • "signed": true,
  • "legally_stored": true,
  • "preserved_document": {
    },
  • "downloaded": true,
  • "downloaded_at": "2019-08-24T14:15:22Z",
  • "marking": "string",
  • "notice": "string",
  • "retry_information": "string",
  • "transmission_format": "string",
  • "to_pa": true
}

Download a Invoice resource.

You can get an invoice in many different formats just specifying a different Accept header:

  • application/xml, you get the XML format
  • text/html, you get the invoice formatted with the chosen stylesheet (via X-PrintTheme header, see below)
  • application/pdf, same as HTML but as a PDF file
  • application/octet-stream, get the raw file (P7M or XML format)
Authorizations:
path Parameters
uuid
required
string
Default: "<string>"

Responses

Response Schema:
created_at
string <date-time>
uuid
string
type
integer
payload
string
object (BusinessRegistry-read)
object (BusinessRegistry-read)
notifications
Array of strings 2 items
sdi_file_name
string
sdi_file_id
string
signed
boolean
legally_stored
boolean
object (PreservedDocument-read)
downloaded
boolean

The invoice was downloaded (automatically when received by webhook or manually for polling integrations).

downloaded_at
string <date-time>
marking
string

The marking represent the current status of the invoice.

notice
string
retry_information
string
transmission_format
string

Transmission format specified into the invoice.

to_pa
boolean

Request samples

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "https://sdi.openapi.it/invoices_download/%7Buuid%7D");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Authorization: Bearer REPLACE_BEARER_TOKEN");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);

Retrieve collection of Invoice notifications.

Retrieve the collection of notifications for a given invoice. You can have the notification message in JSON format or the original XML by sending the Accept HTTP header to either application/json or application/xml

Authorizations:
path Parameters
uuid
required
string
Default: "<string>"

Responses

Response Schema:
Array (<= 2 items)
uuid
string
invoice_uuid
string
created_at
string

The date the notification was received.

type
string

The notification type (2 letters code).

message
string

The notification message model.

downloaded
boolean

The notification was downloaded (automatically when received by webhook or manually for polling integrations).

downloaded_at
string <date-time>

Notification download date.

file_name
string

Request samples

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "https://sdi.openapi.it/invoices_notifications/%7Buuid%7D");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Authorization: Bearer REPLACE_BEARER_TOKEN");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);

Response samples

Content type
[
  • {
    }
]

BusinessRegistryConfiguration

Create a Business Registry Configuration

Authorizations:
Request Body schema: application/json
fiscal_id
string
Default: "<string>"

The fiscal code or the vat number WITHOUT the country prefix

name
string
Default: "<string>"

The owner's name for the fiscal id.

email
string
Default: "<string>"

The email where the owner of the fiscalId will receive communications from the platform.

apply_signature
boolean
Default: "<boolean>"

Apply digital signature before sending invoices to SDI.

apply_legal_storage
boolean
Default: "<boolean>"

Apply the legal storage for invoices sent/received by the fiscal id.

Responses

Response Schema: application/json
object (BusinessRegistryConfiguration-read)
message
string
success
boolean
error
string <nullable>

Request samples

Content type
application/json
{
  • "fiscal_id": "<string>",
  • "name": "<string>",
  • "email": "<string>",
  • "apply_signature": "<boolean>",
  • "apply_legal_storage": "<boolean>"
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "message": "string",
  • "success": true,
  • "error": "string"
}

Retrieve a list of Business Registry Configuration

Authorizations:

Responses

Response Schema: application/json
Array of objects (BusinessRegistryConfiguration-read) <= 2 items [ items ]
message
string
success
boolean
error
string <nullable>

Request samples

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "https://sdi.openapi.it/business_registry_configurations");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Authorization: Bearer REPLACE_BEARER_TOKEN");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "message": "string",
  • "success": true,
  • "error": "string"
}

Retrieve a Business Registry Configuration

Authorizations:
path Parameters
fiscal_id
required
string
Default: "<string>"

The fiscal id

Responses

Response Schema: application/json
object (BusinessRegistryConfiguration-read)
message
string
success
boolean
error
string <nullable>

Request samples

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "https://sdi.openapi.it/business_registry_configurations/%7Bfiscal_id%7D");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Authorization: Bearer REPLACE_BEARER_TOKEN");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);

Response samples

Content type
application/json
{
  • "data": {
    },
  • "message": "string",
  • "success": true,
  • "error": "string"
}

Delete a Business Registry Configuration

Authorizations:
path Parameters
fiscal_id
required
string
Default: "<string>"

The fiscal id

Responses

Response Schema: application/json
data
any or null
message
string
success
boolean
error
string or null

Request samples

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "https://sdi.openapi.it/business_registry_configurations/%7Bfiscal_id%7D");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Authorization: Bearer REPLACE_BEARER_TOKEN");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);

Response samples

Content type
application/json
{
  • "data": null,
  • "message": "Deleted",
  • "success": true,
  • "error": "string"
}

Re-activate a Business Registry Configuration

This method allows you to re-activate a Business Registry Configuration that was previously deactivated, either automatically or manually by the user.

Authorizations:
path Parameters
fiscal_id
required
string
Default: "<string>"

The fiscal id

Responses

Response Schema: application/json
object (BusinessRegistryConfiguration-read)
message
string
success
boolean
error
string <nullable>

Request samples

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "https://sdi.openapi.it/business_registry_configurations/%7Bfiscal_id%7D/activate");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Authorization: Bearer REPLACE_BEARER_TOKEN");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

CURLcode ret = curl_easy_perform(hnd);

Response samples

Content type
application/json
{
  • "data": {
    },
  • "message": "string",
  • "success": true,
  • "error": "string"
}

Import

Import customer invoice (fattura attiva)

Import a customer invoice that was already sent to SDI. The invoice will not be sent to SDI. You can disable webhook events by sending X-DisableEndpoints: true header.

Authorizations:
Request Body schema: application/json

The new CustomerInvoiceImport resource

invoice
required
string
Default: "<string>"

The base64 encoded invoice XML.

notifications
Array of strings 2 items

Notification type as key (RC, MC, NS, DT, NE, AT, EC), notification base64 as value. If at least one notification is not provided you must provide invoice_file_name and sdi_id.

invoice_file_name
string
Default: "<string>"

The invoice filename, to be provided only when there is not any notification.

sdi_id
string
Default: "<string>"

The invoice SDI ID, to be provided only when there is not any notification.

Responses

Response Schema: application/json
uuid
string

The UUID used to identify uniquely the invoice.

Request samples

Content type
application/json
{
  • "invoice": "<string>",
  • "notifications": {
    },
  • "invoice_file_name": "<string>",
  • "sdi_id": "<string>"
}

Response samples

Content type
application/json
{
  • "uuid": "string"
}

Import supplier invoice (fattura passiva)

Import a supplier invoice that was already received from SDI.

Authorizations:
Request Body schema:

The new SupplierInvoiceImport resource

invoice
required
string
Default: "<string>"

The base64 encoded invoice XML.

metadata
string
Default: "<string>"

The base64 encoded invoice metadata XML. If it is not provided you must provide invoice_file_name and sdi_id.

invoice_file_name
string
Default: "<string>"

The invoice filename, to be provided only when there is not metadata.

sdi_id
string
Default: "<string>"

he invoice SDI ID, to be provided only when there is not metadata.

Responses

Response Schema:
uuid
string

The UUID used to identify uniquely the invoice. In case the invoice XML embeds multiple bodies, you will get an array of UUIDs.

Request samples

Content type
{
  • "invoice": "<string>",
  • "metadata": "<string>",
  • "invoice_file_name": "<string>",
  • "sdi_id": "<string>"
}

Response samples

Content type
{
  • "uuid": "string"
}