getInvoices()
Metodo per ottenere la lista delle proprie fatture inviate al SDI.
Endpoint
Method |
URI |
GET |
https://fatture.keliweb.it/api/invoices |
Request Parameters
Parameter |
Type |
Description |
Required |
HTTP headers: Authorization |
string |
Bearer + the token to access APIs |
Yes |
Response Parameters
Parameter |
Type |
Description |
data |
array |
lista delle fatture inviate (paginate), in formato JSON |
Example Request (BASH Curl)
curl --location --request GET 'https://fatture.keliweb.it/api/invoices' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjJmZTQ2NTMzZWZhMmMxZ'
Example Request (PHP Curl)
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://fatture.keliweb.it/api/invoices',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjJmZTQ2NTMzZWZhMmMxZjFkN2JlY2N'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Example Request (jQuery AJAX)
var form = new FormData();
var settings = {
url: "https://fatture.keliweb.it/api/invoices",
method: "GET",
timeout: 0,
headers: {
Authorization:
"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjJmZTQ2NTMzZWZhMmMxZjFkN2JlY2Nh"
},
processData: false,
mimeType: "multipart/form-data",
contentType: false,
data: form
};
$.ajax(settings).done(function(response) {
console.log(response);
});
Example Request (Python - Requests)
import requests
url = "https://fatture.keliweb.it/api/invoices"
payload={}
files={}
headers = {
'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImYxYTAzNzMzYzY'
}
response = requests.request("GET", url, headers=headers, data=payload, files=files)
print(response.text)
Example Response (JSON payload)
{
"data": {
"current_page": 1,
"data": [
{
"id": 1,
"user_id": 1,
"client_id": 1,
"numero": "1",
"base36": "00001",
"sezionale": null,
"version": "FPA12",
"type": "TD01",
"currency": "EUR",
"causale": null,
"date": "30/09/2021",
"includedBollo": false,
"importoBollo": null,
"totaleBeniServizi": null,
"totaleDocumento": 15.85,
"totaleImposta": null,
"totalePagare": null,
"visitor": "192.168.10.1",
"package_path": "invoices/info@keliweb.it/2021/1",
"filename": "IT03281320782_00001.xml",
"cedente": "Keliweb SRL",
"cessionario": "ENTE PARCO NAZIONALE - Uff_eFatturaPA",
"codiceDestinatario": "UF1234",
"pecDestinatario": null,
"identificativoSdI": 25702397,
"dataOraRicezioneSdi": "2021-10-20T11:35:01.785+02:00",
"erroreSdi": null,
"created_at": "30/09/2021 (11:05)",
"updated_at": "20/10/2021 (11:35)",
"draft": false,
"status": "INVIATA",
"errors": null,
"esito": null,
"scarto": null,
"production": false,
"mode": "cron",
"notifications": [],
"histories": [
{
"id": 1,
"invoice_id": 1,
"identificativoSdI": null,
"xml": null,
"status": "PRESA IN CARICO",
"created_at": "2021-09-30 11:05:08",
"updated_at": "2021-09-30 11:05:08",
"errors": null,
"descrizione": null,
"note": null,
"mode": null
}
],
"outcomes": []
}
],
"first_page_url": "https://fatture.keliweb.it/api/invoices?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "https://fatture.keliweb.it/api/invoices?page=1",
"next_page_url": null,
"path": "https://fatture.keliweb.it/api/invoices",
"per_page": 25,
"prev_page_url": null,
"to": 8,
"total": 8
},
"version": "v2.0.0",
"copyright": "2009-2021 - Keliweb Srl",
"documentation": "https://fatture.keliweb.it/docs",
"valid_as_of": "21/10/2021 (11:36)"
}