Définir le statut d’une commande
curl --request PUT \
--url https://server.chataigne.ai/v1/locations/{location_id}/orders/{order_id}/status \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'x-api-key: <api-key>' \
--data '
{
"reason": "<string>"
}
'import requests
url = "https://server.chataigne.ai/v1/locations/{location_id}/orders/{order_id}/status"
payload = { "reason": "<string>" }
headers = {
"Idempotency-Key": "<idempotency-key>",
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'Idempotency-Key': '<idempotency-key>',
'x-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({reason: '<string>'})
};
fetch('https://server.chataigne.ai/v1/locations/{location_id}/orders/{order_id}/status', 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/locations/{location_id}/orders/{order_id}/status",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'reason' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://server.chataigne.ai/v1/locations/{location_id}/orders/{order_id}/status"
payload := strings.NewReader("{\n \"reason\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://server.chataigne.ai/v1/locations/{location_id}/orders/{order_id}/status")
.header("Idempotency-Key", "<idempotency-key>")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"reason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://server.chataigne.ai/v1/locations/{location_id}/orders/{order_id}/status")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reason\": \"<string>\"\n}"
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": {}
}
}{
"error": {
"type": "invalid_request_error",
"code": "resource_missing",
"message": "<string>",
"request_id": "req_8f2c…",
"param": "<string>",
"details": {}
}
}{
"error": {
"type": "invalid_request_error",
"code": "resource_missing",
"message": "<string>",
"request_id": "req_8f2c…",
"param": "<string>",
"details": {}
}
}Commandes
Définir le statut d’une commande
PUT
/
v1
/
locations
/
{location_id}
/
orders
/
{order_id}
/
status
Définir le statut d’une commande
curl --request PUT \
--url https://server.chataigne.ai/v1/locations/{location_id}/orders/{order_id}/status \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'x-api-key: <api-key>' \
--data '
{
"reason": "<string>"
}
'import requests
url = "https://server.chataigne.ai/v1/locations/{location_id}/orders/{order_id}/status"
payload = { "reason": "<string>" }
headers = {
"Idempotency-Key": "<idempotency-key>",
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'Idempotency-Key': '<idempotency-key>',
'x-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({reason: '<string>'})
};
fetch('https://server.chataigne.ai/v1/locations/{location_id}/orders/{order_id}/status', 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/locations/{location_id}/orders/{order_id}/status",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'reason' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://server.chataigne.ai/v1/locations/{location_id}/orders/{order_id}/status"
payload := strings.NewReader("{\n \"reason\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://server.chataigne.ai/v1/locations/{location_id}/orders/{order_id}/status")
.header("Idempotency-Key", "<idempotency-key>")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"reason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://server.chataigne.ai/v1/locations/{location_id}/orders/{order_id}/status")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reason\": \"<string>\"\n}"
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": {}
}
}{
"error": {
"type": "invalid_request_error",
"code": "resource_missing",
"message": "<string>",
"request_id": "req_8f2c…",
"param": "<string>",
"details": {}
}
}{
"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.
En-têtes
Clé unique pour cette mutation de statut.
Corps
application/json
Réponse
La commande mise à jour.
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