Lister les commandes d’une organisation
curl --request GET \
--url https://server.chataigne.ai/v1/organizations/{organization_id}/orders \
--header 'x-api-key: <api-key>'import requests
url = "https://server.chataigne.ai/v1/organizations/{organization_id}/orders"
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', 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",
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"
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")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://server.chataigne.ai/v1/organizations/{organization_id}/orders")
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{
"object": "list",
"data": [
{
"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"
}
}
],
"has_more": true,
"url": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "resource_missing",
"message": "<string>",
"request_id": "req_8f2c…",
"param": "<string>",
"details": {}
}
}Commandes
Lister les commandes d’une organisation
GET
/
v1
/
organizations
/
{organization_id}
/
orders
Lister les commandes d’une organisation
curl --request GET \
--url https://server.chataigne.ai/v1/organizations/{organization_id}/orders \
--header 'x-api-key: <api-key>'import requests
url = "https://server.chataigne.ai/v1/organizations/{organization_id}/orders"
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', 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",
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"
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")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://server.chataigne.ai/v1/organizations/{organization_id}/orders")
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{
"object": "list",
"data": [
{
"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"
}
}
],
"has_more": true,
"url": "<string>"
}{
"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.
Paramètres de chemin
Paramètres de requête
Taille de page (1–100).
Plage requise:
1 <= x <= 100Retourne les commandes après cet identifiant de commande.
Retourne les commandes avant cet identifiant de commande.
Retourne les commandes créées après cet horodatage ISO 8601.
Retourne les commandes créées avant cet horodatage ISO 8601.
Retourne les commandes mises à jour après cet horodatage ISO 8601. Pour la réconciliation, combinez-le à une borne haute updated_before fixe sur toutes les pages.
Retourne les commandes mises à jour avant cet horodatage ISO 8601. Conservez cette borne haute inchangée pendant toute la pagination d’une réconciliation.
Options disponibles:
received, accepted, in_preparation, awaiting_shipment, awaiting_collection, in_delivery, completed, rejected, cancelled, delivery_failed Options disponibles:
delivery, collection, eat_in Limite les résultats à un établissement de l’organisation.