Elenco ordini
Recupera un elenco paginato di ordini del ristorante. È possibile filtrare gli ordini per intervallo di date.
curl --request GET \
--url https://app.xmenu.it/api/orders/list \
--header 'X-Api-Key: <api-key>'import requests
url = "https://app.xmenu.it/api/orders/list"
headers = {"X-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://app.xmenu.it/api/orders/list', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.xmenu.it/api/orders/list",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.xmenu.it/api/orders/list"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.xmenu.it/api/orders/list")
.header("X-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.xmenu.it/api/orders/list")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"error": "<string>",
"message": "<string>",
"page": 123,
"pagesize": 123,
"total_count": 123,
"more": true,
"orders": [
{
"uid": "<string>",
"token": "<string>",
"date": "<string>",
"date_iso": "2023-11-07T05:31:56Z",
"number": 123,
"order_number": "<string>",
"client": {
"uid": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"phone": "<string>",
"email": "jsmith@example.com"
},
"details": [
{
"product": {
"uid": "<string>",
"name": "<string>",
"price": 123,
"category": "<string>",
"category_uid": "<string>",
"offline_uid": "<string>",
"ext_id": "<string>"
},
"options": [
{
"uid": "<string>",
"name": "<string>",
"type": "single",
"values": [
{
"uid": "<string>",
"name": "<string>",
"price_operator": "+",
"price_operand": 123,
"quantity": 123,
"offline_uid": "<string>",
"ext_id": "<string>"
}
],
"ext_id": "<string>"
}
],
"price": 123,
"price_options": 123,
"quantity": 123,
"total": 123,
"free_quantity": 123,
"notes": "<string>"
}
],
"dmethod": "0",
"payment_method": "cash",
"paid": true,
"total": 123,
"currency": "<string>",
"closed": true,
"subrestaurant_code": "<string>",
"subrestaurant_uid": "<string>",
"customfields": [
{
"uid": "<string>",
"name": "<string>",
"type": "text",
"value": "<string>",
"display_value": "<string>"
}
],
"notes": "<string>",
"pickup": {
"date": "<string>",
"date_iso": "2023-11-07T05:31:56Z"
},
"delivery": {
"date": "<string>",
"address": {
"street": "<string>",
"number": "<string>",
"city": "<string>",
"province": "<string>",
"zip": "<string>",
"country": "<string>",
"place_id": "<string>",
"lat": 123,
"lng": 123,
"kms": 123,
"doorbell": "<string>",
"floor": "<string>",
"quarter": "<string>"
},
"fee": 123,
"date_iso": "2023-11-07T05:31:56Z",
"deliverypoint": {
"name": "<string>",
"full_address": "<string>"
}
},
"payment_method_sub": "cash",
"coupon": {
"code": "<string>",
"description": "<string>",
"discount": 123,
"auto": true
},
"confirmation": {
"confirmed": true,
"countdown_time": 123,
"countdown_started": "<string>",
"closed": true,
"date": "<string>",
"date_iso": "2023-11-07T05:31:56Z",
"text": "<string>",
"countdown_started_iso": "2023-11-07T05:31:56Z",
"countdown_end": "<string>",
"countdown_end_iso": "2023-11-07T05:31:56Z",
"timeout": true
}
}
]
}Autorizzazioni
Chiave API del ristorante. Può essere ottenuta da Strumenti > Accesso API nella dashboard xMenu.
Parametri della query
Identificatore univoco ristorante (non richiesto con autenticazione X-Client-Id)
Numero di pagina da recuperare
x >= 1Numero di risultati per pagina (default: 100, massimo: 100)
1 <= x <= 100Ordini dalla data specificata (formato: YYYY-MM-dd)
Ordini fino alla data specificata (formato: YYYY-MM-dd)
Risposta
Lista ordini recuperata con successo
Risultato dell'operazione: true se ha avuto successo, false se è fallita
Codice errore se l'operazione è fallita.
Vedi Codici errore per i codici errore generali che possono verificarsi.
Descrizione leggibile dell'errore se l'operazione è fallita
Numero di pagina corrente (1-n)
Numero massimo di elementi per pagina
Conteggio totale dei risultati
false = ultima pagina; true = esistono ulteriori risultati
Array di oggetti ordine
Show child attributes
Show child attributes
curl --request GET \
--url https://app.xmenu.it/api/orders/list \
--header 'X-Api-Key: <api-key>'import requests
url = "https://app.xmenu.it/api/orders/list"
headers = {"X-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://app.xmenu.it/api/orders/list', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.xmenu.it/api/orders/list",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.xmenu.it/api/orders/list"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.xmenu.it/api/orders/list")
.header("X-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.xmenu.it/api/orders/list")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"error": "<string>",
"message": "<string>",
"page": 123,
"pagesize": 123,
"total_count": 123,
"more": true,
"orders": [
{
"uid": "<string>",
"token": "<string>",
"date": "<string>",
"date_iso": "2023-11-07T05:31:56Z",
"number": 123,
"order_number": "<string>",
"client": {
"uid": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"phone": "<string>",
"email": "jsmith@example.com"
},
"details": [
{
"product": {
"uid": "<string>",
"name": "<string>",
"price": 123,
"category": "<string>",
"category_uid": "<string>",
"offline_uid": "<string>",
"ext_id": "<string>"
},
"options": [
{
"uid": "<string>",
"name": "<string>",
"type": "single",
"values": [
{
"uid": "<string>",
"name": "<string>",
"price_operator": "+",
"price_operand": 123,
"quantity": 123,
"offline_uid": "<string>",
"ext_id": "<string>"
}
],
"ext_id": "<string>"
}
],
"price": 123,
"price_options": 123,
"quantity": 123,
"total": 123,
"free_quantity": 123,
"notes": "<string>"
}
],
"dmethod": "0",
"payment_method": "cash",
"paid": true,
"total": 123,
"currency": "<string>",
"closed": true,
"subrestaurant_code": "<string>",
"subrestaurant_uid": "<string>",
"customfields": [
{
"uid": "<string>",
"name": "<string>",
"type": "text",
"value": "<string>",
"display_value": "<string>"
}
],
"notes": "<string>",
"pickup": {
"date": "<string>",
"date_iso": "2023-11-07T05:31:56Z"
},
"delivery": {
"date": "<string>",
"address": {
"street": "<string>",
"number": "<string>",
"city": "<string>",
"province": "<string>",
"zip": "<string>",
"country": "<string>",
"place_id": "<string>",
"lat": 123,
"lng": 123,
"kms": 123,
"doorbell": "<string>",
"floor": "<string>",
"quarter": "<string>"
},
"fee": 123,
"date_iso": "2023-11-07T05:31:56Z",
"deliverypoint": {
"name": "<string>",
"full_address": "<string>"
}
},
"payment_method_sub": "cash",
"coupon": {
"code": "<string>",
"description": "<string>",
"discount": 123,
"auto": true
},
"confirmation": {
"confirmed": true,
"countdown_time": 123,
"countdown_started": "<string>",
"closed": true,
"date": "<string>",
"date_iso": "2023-11-07T05:31:56Z",
"text": "<string>",
"countdown_started_iso": "2023-11-07T05:31:56Z",
"countdown_end": "<string>",
"countdown_end_iso": "2023-11-07T05:31:56Z",
"timeout": true
}
}
]
}