Récupérer une commande d’une organisation
curl --request GET \
--url https://server.chataigne.ai/v1/organizations/{organization_id}/orders/{order_id} \
--header 'x-api-key: <api-key>'import requests
url = "https://server.chataigne.ai/v1/organizations/{organization_id}/orders/{order_id}"
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://server.chataigne.ai/v1/organizations/{organization_id}/orders/{order_id}', 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://server.chataigne.ai/v1/organizations/{organization_id}/orders/{order_id}",
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://server.chataigne.ai/v1/organizations/{organization_id}/orders/{order_id}"
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://server.chataigne.ai/v1/organizations/{organization_id}/orders/{order_id}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://server.chataigne.ai/v1/organizations/{organization_id}/orders/{order_id}")
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{
"id": "<string>",
"object": "order",
"short_id": "<string>",
"location_id": "<string>",
"status": "received",
"status_version": 1,
"service_type": "delivery",
"channel": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"expected_time": "2023-11-07T05:31:56Z",
"expected_pickup_time": "2023-11-07T05:31:56Z",
"expected_delivery_time": "2023-11-07T05:31:56Z",
"customer": {
"first_name": "<string>",
"last_name": "<string>",
"phone": "<string>",
"email": "<string>",
"language": "<string>"
},
"fulfillment": {
"type": "<string>",
"address": {
"line_1": "<string>",
"line_2": "<string>",
"postal_code": "<string>",
"city": "<string>",
"country": "<string>",
"latitude": 123,
"longitude": 123
},
"customer_notes": "<string>",
"delivery_notes": "<string>",
"collection_code": "<string>"
},
"items": [
{
"type": "product",
"id": "<string>",
"name": "<string>",
"quantity": 2,
"unit_price": {
"amount": 12.5,
"currency": "EUR"
},
"customer_notes": "<string>",
"modifier_groups": [
{
"id": "<string>",
"name": "<string>",
"modifiers": [
{
"id": "<string>",
"name": "<string>",
"quantity": 2,
"unit_price": {
"amount": 12.5,
"currency": "EUR"
},
"free_quantity": 1
}
]
}
]
}
],
"discounts": [
{
"id": "<string>",
"name": "<string>",
"amount": {
"amount": 12.5,
"currency": "EUR"
}
}
],
"charges": [
{
"type": "delivery",
"amount": {
"amount": 12.5,
"currency": "EUR"
}
}
],
"payment": {
"status": "authorized",
"amount": {
"amount": 12.5,
"currency": "EUR"
}
},
"total": {
"amount": 12.5,
"currency": "EUR"
}
}{
"error": {
"type": "invalid_request_error",
"code": "resource_missing",
"message": "<string>",
"request_id": "req_8f2c…",
"param": "<string>",
"details": {}
}
}Commandes
Récupérer une commande d’une organisation
GET
/
v1
/
organizations
/
{organization_id}
/
orders
/
{order_id}
Récupérer une commande d’une organisation
curl --request GET \
--url https://server.chataigne.ai/v1/organizations/{organization_id}/orders/{order_id} \
--header 'x-api-key: <api-key>'import requests
url = "https://server.chataigne.ai/v1/organizations/{organization_id}/orders/{order_id}"
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://server.chataigne.ai/v1/organizations/{organization_id}/orders/{order_id}', 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://server.chataigne.ai/v1/organizations/{organization_id}/orders/{order_id}",
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://server.chataigne.ai/v1/organizations/{organization_id}/orders/{order_id}"
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://server.chataigne.ai/v1/organizations/{organization_id}/orders/{order_id}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://server.chataigne.ai/v1/organizations/{organization_id}/orders/{order_id}")
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{
"id": "<string>",
"object": "order",
"short_id": "<string>",
"location_id": "<string>",
"status": "received",
"status_version": 1,
"service_type": "delivery",
"channel": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"expected_time": "2023-11-07T05:31:56Z",
"expected_pickup_time": "2023-11-07T05:31:56Z",
"expected_delivery_time": "2023-11-07T05:31:56Z",
"customer": {
"first_name": "<string>",
"last_name": "<string>",
"phone": "<string>",
"email": "<string>",
"language": "<string>"
},
"fulfillment": {
"type": "<string>",
"address": {
"line_1": "<string>",
"line_2": "<string>",
"postal_code": "<string>",
"city": "<string>",
"country": "<string>",
"latitude": 123,
"longitude": 123
},
"customer_notes": "<string>",
"delivery_notes": "<string>",
"collection_code": "<string>"
},
"items": [
{
"type": "product",
"id": "<string>",
"name": "<string>",
"quantity": 2,
"unit_price": {
"amount": 12.5,
"currency": "EUR"
},
"customer_notes": "<string>",
"modifier_groups": [
{
"id": "<string>",
"name": "<string>",
"modifiers": [
{
"id": "<string>",
"name": "<string>",
"quantity": 2,
"unit_price": {
"amount": 12.5,
"currency": "EUR"
},
"free_quantity": 1
}
]
}
]
}
],
"discounts": [
{
"id": "<string>",
"name": "<string>",
"amount": {
"amount": 12.5,
"currency": "EUR"
}
}
],
"charges": [
{
"type": "delivery",
"amount": {
"amount": 12.5,
"currency": "EUR"
}
}
],
"payment": {
"status": "authorized",
"amount": {
"amount": 12.5,
"currency": "EUR"
}
},
"total": {
"amount": 12.5,
"currency": "EUR"
}
}{
"error": {
"type": "invalid_request_error",
"code": "resource_missing",
"message": "<string>",
"request_id": "req_8f2c…",
"param": "<string>",
"details": {}
}
}Autorisations
Clé API d’établissement ou d’organisation.
Réponse
La commande.
Identifiant de commande Chataigne.
Options disponibles:
order Numéro de commande lisible par le restaurant.
Options disponibles:
received, accepted, in_preparation, awaiting_shipment, awaiting_collection, in_delivery, completed, rejected, cancelled, delivery_failed Plage requise:
x >= 0Options disponibles:
delivery, collection, eat_in, null Show child attributes
Show child attributes
Show child attributes
Show child attributes
- Option 1
- Option 2
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Seuls les frais publics de livraison et de service sont listés. Le total peut inclure des frais privés ou propres au fournisseur.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Total canonique de la commande, y compris les frais privés ou propres au fournisseur absents du tableau public des frais.
Show child attributes
Show child attributes