When you need to deal with an e-invoice, we provide a handful of methods that you can use to fulfill your needs: you can verify the XML of your e-invoice, download it, send it to the SDI and eventually obtain the rejection reason.
🔍 Verify the E-Invoice XML
With the Verify e-invoice XML method, you can verify your e-invoice XML before sending it to the SDI. If your XML contains an error or it is missing some fields, you can patch it by editing the invoice. A list of the most common validation errors can be found here.
Below you can find an example of a failed XML verification:
"message": "Validation XML",
"Nei dati generali del documento, il contenuto \"0000-00-00\" del campo Data non è nel formato valido"
⬇️ Download the E-Invoice XML
With the Get e-invoice XML method you can download your e-invoice XML if you need to.
HTTP/1.1 200 OK
<p:FatturaElettronica xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:p="http://ivaservizi.agenziaentrate.gov.it/docs/xsd/fatture/v1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" versione="FPR12">
📬 Send the E-Invoice
If your e-invoice XML is valid you can now send it to the SDI using the Send e-invoice method.
After the invoice has been sent, you can check its status by making a Get Issued Document request: the ei_status field will contain the status of your e-invoice.
To show the ei_status field, you need to customize the response, selecting the detailed fieldset or including it in the fields list.
🏴☠️ The Dry-Run Flag
If you are developing an integration and you want to test the Send e-invoice method without actually sending the invoice to the SDI we offer a proper field for this purpose, the options.dry_run flag.
The flag is optional, and the default is false; if you use it and you set it as true, all the e-invoice checks will be run but the actual dispatch.
🚨 Get the E-Invoice rejection reason
For example, you could get an error like the following one:
"reason": "Il Codice Fiscale del cliente risulta sbagliato.",