Invoice

Retrieves the collection of Invoice resources.

Currently the Invoice resource contains a notification index with a list of notification for the invoice. The notification index is deprecated in favour of using the endpoint /invoices/{uuid}/notifications

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

  • application/json, default, you get some metadata information together with the json payload that represent the invoice
  • application/zip, get a zip file with invoices collection (ZIP format)
SecurityBearer
Request
query Parameters
created_at[before]
string
created_at[strictly_before]
string
created_at[after]
string
created_at[strictly_after]
string
invoice_date[before]
string
invoice_date[strictly_before]
string
invoice_date[after]
string
invoice_date[strictly_after]
string
invoice_number
string
signed
boolean
downloaded
boolean
stamp
boolean
toPa
string

Search invoices that was sent to PA.

type
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

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

recipient
string

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

rejectedToFix
boolean

Filter invoices that have been rejected and have not been fixed yet.

sender.business_name
string

Filter by sender business name, first name or last name.

recipient.business_name
string

Filter by recipient business name, first name or last name.

recipient.business_vat_number_code
string
recipient.business_vat_number_code[]
Array of strings
recipient.business_fiscal_code
string
recipient.business_fiscal_code[]
Array of strings
sender.business_vat_number_code
string
sender.business_vat_number_code[]
Array of strings
sender.business_fiscal_code
string
sender.business_fiscal_code[]
Array of strings
marking
string
marking[]
Array of strings
document_type
string
document_type[]
Array of strings
order[invoice_date]
string
order[invoice_number]
string
page
integer

The collection page number

Responses
200

Invoice collection response

get/invoices
Request samples
Response samples
[
  • {
    }
]

Creates a Invoice resource.

Create a new invoice and send it to the government channel

SecurityBearer
Request
Request Body schema:

The new Invoice resource

required
object (FatturaPAFatturaElettronicaHeader-read)
required
Array of objects (FatturaPAFatturaElettronicaBody-read)
Responses
202

Accepted

400

Invalid input

post/invoices
Request samples
{
  • "fattura_elettronica_header": {
    },
  • "fattura_elettronica_body": [
    ]
}
Response samples
{
  • "uuid": "string"
}

Convert an invoice between supported formats

Convert an invoice between supported formats.

Sending header Content-Type: application/json you will receive back the XML file, while sending Content-Type: application/xml you will receive the JSON content.

SecurityBearer
Responses
200

OK

400

Invalid input

post/invoices/convert
Request samples

Setup the downloaded flag for a collection of invoices.

Setup the downloaded flag for a collection of invoices.
Note: the downloaded flag is automatically set when an invoice is successfully received with the web-hook

SecurityBearer
Request
Request Body schema:

The new DownloadedEntity resource

uuids
Array of strings
downloaded
required
boolean
Responses
200

The downloaded flag has been set

400

Invalid input

404

Resource not found

post/invoices/downloaded
Request samples
{
  • "uuids": [
    ],
  • "downloaded": true
}

Get the collection of draft invoices

Get the collection of draft invoices

SecurityBearer
Request
query Parameters
created_at[before]
string
created_at[strictly_before]
string
created_at[after]
string
created_at[strictly_after]
string
invoice_date[before]
string
invoice_date[strictly_before]
string
invoice_date[after]
string
invoice_date[strictly_after]
string
invoice_number
string
signed
boolean
downloaded
boolean
stamp
boolean
toPa
string

Search invoices that was sent to PA.

type
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

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

recipient
string

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

rejectedToFix
boolean

Filter invoices that have been rejected and have not been fixed yet.

sender.business_name
string

Filter by sender business name, first name or last name.

recipient.business_name
string

Filter by recipient business name, first name or last name.

recipient.business_vat_number_code
string
recipient.business_vat_number_code[]
Array of strings
recipient.business_fiscal_code
string
recipient.business_fiscal_code[]
Array of strings
sender.business_vat_number_code
string
sender.business_vat_number_code[]
Array of strings
sender.business_fiscal_code
string
sender.business_fiscal_code[]
Array of strings
marking
string
marking[]
Array of strings
document_type
string
document_type[]
Array of strings
order[invoice_date]
string
order[invoice_number]
string
page
integer

The collection page number

Responses
200

Invoice collection response

get/invoices/draft
Request samples
Response samples
[
  • {
    }
]

Creates a new Invoice resource in draft mode

Creates a new invoice in draft mode. The invoice will not be sent to the SDI until it is explicitly requested.

SecurityBearer
Request
Request Body schema:

The new Invoice resource

object (FatturaPADraftFatturaElettronicaHeader-read)
Array of objects (FatturaPADraftFatturaElettronicaBody-read)
Responses
201

Accepted

400

Invalid input

post/invoices/draft
Request samples
{
  • "fattura_elettronica_header": {
    },
  • "fattura_elettronica_body": [
    ]
}
Response samples
{
  • "uuid": "string"
}

Get the single draft invoice with the given id

Get the single draft invoices with the given id

SecurityBearer
Request
path Parameters
id
required
string
Responses
200

Invoice resource response

404

Resource not found

get/invoices/draft/{id}
Request samples
Response samples
{
  • "created_at": "2019-08-24T14:15:22Z",
  • "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
  • "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": [
    ],
  • "transmission_format": "string",
  • "document_type": "string",
  • "to_pa": true
}

Update the content of a draft invoice

Update the content of a draft invoice.

SecurityBearer
Request
path Parameters
id
required
string
Request Body schema:

The updated Invoice resource

object (FatturaPADraftFatturaElettronicaHeader-read)
Array of objects (FatturaPADraftFatturaElettronicaBody-read)
Responses
200

OK

404

Not found

409

Invoice not in draft state

put/invoices/draft/{id}
Request samples
{
  • "fattura_elettronica_header": {
    },
  • "fattura_elettronica_body": [
    ]
}

Delete a draft invoice

Delete a draft invoice. All the contents will be completely removed from the platform.

SecurityBearer
Request
path Parameters
id
required
string
Responses
204

No content

404

Not found

409

Invoice not in draft state

delete/invoices/draft/{id}
Request samples

Accept and send a draft invoice to the SDI

Send a draft invoice to the SDI. The invoice will be validated and sent to the SDI.

SecurityBearer
Request
path Parameters
id
required
string
Responses
200

OK

404

Not found

409

Invoice not in draft state or cannot be sent to the SDI yet

post/invoices/draft/{id}/send
Request samples

Get a Report of Invoices.

SecurityBearer
Request
query Parameters
created_at[before]
string
created_at[strictly_before]
string
created_at[after]
string
created_at[strictly_after]
string
invoice_date[before]
string
invoice_date[strictly_before]
string
invoice_date[after]
string
invoice_date[strictly_after]
string
invoice_number
string
signed
boolean
downloaded
boolean
stamp
boolean
toPa
string

Search invoices that was sent to PA.

type
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

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

recipient
string

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

rejectedToFix
boolean

Filter invoices that have been rejected and have not been fixed yet.

sender.business_name
string

Filter by sender business name, first name or last name.

recipient.business_name
string

Filter by recipient business name, first name or last name.

recipient.business_vat_number_code
string
recipient.business_vat_number_code[]
Array of strings
recipient.business_fiscal_code
string
recipient.business_fiscal_code[]
Array of strings
sender.business_vat_number_code
string
sender.business_vat_number_code[]
Array of strings
sender.business_fiscal_code
string
sender.business_fiscal_code[]
Array of strings
marking
string
marking[]
Array of strings
document_type
string
document_type[]
Array of strings
order[invoice_date]
string
order[invoice_number]
string
page
integer

The collection page number

Responses
200

InvoiceReport collection response

get/invoices/report
Request samples

Validate an invoice

Validate an invoice without sending it to the government channel

SecurityBearer
Request
Request Body schema:

The new Invoice resource

required
object (FatturaPAFatturaElettronicaHeader-read)
required
Array of objects (FatturaPAFatturaElettronicaBody-read)
Responses
202

Accepted

400

Invalid input

post/invoices/validate
Request samples
{
  • "fattura_elettronica_header": {
    },
  • "fattura_elettronica_body": [
    ]
}

Retrieves a Invoice resource.

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

  • application/json, default, you get some metadata information together with the json payload that represent the invoice
  • 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)

In case of HTML and PDF you can choose the printing theme specifying the X-PrintTheme header:

  • standard, default printing theme
  • assosoftware, AssoSoftware printing theme
  • acube, A-Cube printing theme (derived from AssoSoftware theme)

In case you choose A-Cube printing theme, you can write dynamic text within the output file, at the very beginning or in the file footer: you must provide the URL query paramter dynamic[head-notes] or dynamic[foot-notes].

Example: GET /invoices/{uuid}?dynamic[head-notes]=some text in the header&dynamic[foot-notes]=some text in the footer

SecurityBearer
Request
path Parameters
id
required
string
Responses
200

Invoice resource response

404

Resource not found

get/invoices/{id}
Request samples
Response samples
{
  • "created_at": "2019-08-24T14:15:22Z",
  • "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
  • "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": [
    ],
  • "transmission_format": "string",
  • "document_type": "string",
  • "to_pa": true
}

Archive a rejected invoice

Mark invoice as archived and remove it from the rejected list to be fixed

SecurityBearer
Request
path Parameters
id
required
string
Responses
204

No content

404

Not found

409

Invoice not in rejected state

put/invoices/{id}/archive-rejected
Request samples

Notify your configured webhook for an invoice notifications

SecurityBearer
Request
path Parameters
id
required
string
Responses
200

OK

404

Not found

post/invoices/{id}/notifications/notify
Request samples

Notify your configured webhook for an invoice

SecurityBearer
Request
path Parameters
id
required
string
Responses
200

OK

404

Not found

post/invoices/{id}/notify
Request samples

Retrieves a PreservedDocument resource.

SecurityBearer
Request
path Parameters
id
required
string
Responses
200

PreservedDocument resource response

404

Resource not found

get/invoices/{id}/preserved-document
Request samples
Response samples
{
  • "created_at": "2019-08-24T14:15:22Z",
  • "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
  • "status": "string",
  • "receipt_received_at": "2019-08-24T14:15:22Z",
  • "object_type": "string",
  • "object_id": "string",
  • "message": "string",
  • "preserved_object_id": "string",
  • "weight": 0
}

Download an invoice attachment

Download the index-th attachment of the invoice with the given uuid

SecurityBearer
Request
path Parameters
uuid
required
string

Invoice uuid

index
required
integer

Attachment index (0 based) in the invoice

Responses
200

OK

404

Not found

get/invoices/{uuid}/attachments/{index}
Request samples

Preserve an invoice

Send an invoice to the legal storage.

The invoice must be eligible for preservation, otherwise a 400 error is returned.

If successful, the platform returns a 200 response code. Since conservation submission is asynchronous, check the outcome via webhook notifications.

SecurityBearer
Request
path Parameters
uuid
required
string

Invoice uuid

Responses
200

OK

400

Invoice not eligible for preservation

404

Not found

post/invoices/{uuid}/preserve
Request samples