Update a specific order
curl --request PUT \
--url https://reimagined-journey-g45xxv4v6gwhvrrr-80.app.github.dev/orders/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"dish_ids": [
"692a4a34a46ecf001f35ac6f",
"6a4a857c022eb7001f9b8972",
"6b7c2441a0db43001f9bf377"
],
"priority": 3,
"status": "Received"
}
'import requests
url = "https://reimagined-journey-g45xxv4v6gwhvrrr-80.app.github.dev/orders/{id}"
payload = {
"dish_ids": ["692a4a34a46ecf001f35ac6f", "6a4a857c022eb7001f9b8972", "6b7c2441a0db43001f9bf377"],
"priority": 3,
"status": "Received"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
dish_ids: [
'692a4a34a46ecf001f35ac6f',
'6a4a857c022eb7001f9b8972',
'6b7c2441a0db43001f9bf377'
],
priority: 3,
status: 'Received'
})
};
fetch('https://reimagined-journey-g45xxv4v6gwhvrrr-80.app.github.dev/orders/{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://reimagined-journey-g45xxv4v6gwhvrrr-80.app.github.dev/orders/{id}",
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([
'dish_ids' => [
'692a4a34a46ecf001f35ac6f',
'6a4a857c022eb7001f9b8972',
'6b7c2441a0db43001f9bf377'
],
'priority' => 3,
'status' => 'Received'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://reimagined-journey-g45xxv4v6gwhvrrr-80.app.github.dev/orders/{id}"
payload := strings.NewReader("{\n \"dish_ids\": [\n \"692a4a34a46ecf001f35ac6f\",\n \"6a4a857c022eb7001f9b8972\",\n \"6b7c2441a0db43001f9bf377\"\n ],\n \"priority\": 3,\n \"status\": \"Received\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://reimagined-journey-g45xxv4v6gwhvrrr-80.app.github.dev/orders/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"dish_ids\": [\n \"692a4a34a46ecf001f35ac6f\",\n \"6a4a857c022eb7001f9b8972\",\n \"6b7c2441a0db43001f9bf377\"\n ],\n \"priority\": 3,\n \"status\": \"Received\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://reimagined-journey-g45xxv4v6gwhvrrr-80.app.github.dev/orders/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dish_ids\": [\n \"692a4a34a46ecf001f35ac6f\",\n \"6a4a857c022eb7001f9b8972\",\n \"6b7c2441a0db43001f9bf377\"\n ],\n \"priority\": 3,\n \"status\": \"Received\"\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"id": "674d0bf5c28b69001f8e03a1",
"created_at": "2024-04-22T10:00:00Z",
"updated_at": "2024-04-22T10:00:00Z",
"name": "John",
"table_number": 8,
"dish_ids": [
"692a4a34a46ecf001f35ac6f",
"6a4a857c022eb7001f9b8972",
"6b7c2441a0db43001f9bf377"
],
"special_requests": "<string>",
"priority": 3,
"scheduled_at": null,
"status": "Received"
}
],
"total_results": 1
}{
"title": "Human-readable error title.",
"detail": "Human-readable error details."
}{
"title": "Human-readable error title.",
"detail": "Human-readable error details."
}{
"title": "Human-readable error title.",
"detail": "Human-readable error details."
}Orders
Update a specific order
Add or remove dish_ids or update the order’s priority and status.
PUT
/
orders
/
{id}
Update a specific order
curl --request PUT \
--url https://reimagined-journey-g45xxv4v6gwhvrrr-80.app.github.dev/orders/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"dish_ids": [
"692a4a34a46ecf001f35ac6f",
"6a4a857c022eb7001f9b8972",
"6b7c2441a0db43001f9bf377"
],
"priority": 3,
"status": "Received"
}
'import requests
url = "https://reimagined-journey-g45xxv4v6gwhvrrr-80.app.github.dev/orders/{id}"
payload = {
"dish_ids": ["692a4a34a46ecf001f35ac6f", "6a4a857c022eb7001f9b8972", "6b7c2441a0db43001f9bf377"],
"priority": 3,
"status": "Received"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
dish_ids: [
'692a4a34a46ecf001f35ac6f',
'6a4a857c022eb7001f9b8972',
'6b7c2441a0db43001f9bf377'
],
priority: 3,
status: 'Received'
})
};
fetch('https://reimagined-journey-g45xxv4v6gwhvrrr-80.app.github.dev/orders/{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://reimagined-journey-g45xxv4v6gwhvrrr-80.app.github.dev/orders/{id}",
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([
'dish_ids' => [
'692a4a34a46ecf001f35ac6f',
'6a4a857c022eb7001f9b8972',
'6b7c2441a0db43001f9bf377'
],
'priority' => 3,
'status' => 'Received'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://reimagined-journey-g45xxv4v6gwhvrrr-80.app.github.dev/orders/{id}"
payload := strings.NewReader("{\n \"dish_ids\": [\n \"692a4a34a46ecf001f35ac6f\",\n \"6a4a857c022eb7001f9b8972\",\n \"6b7c2441a0db43001f9bf377\"\n ],\n \"priority\": 3,\n \"status\": \"Received\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://reimagined-journey-g45xxv4v6gwhvrrr-80.app.github.dev/orders/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"dish_ids\": [\n \"692a4a34a46ecf001f35ac6f\",\n \"6a4a857c022eb7001f9b8972\",\n \"6b7c2441a0db43001f9bf377\"\n ],\n \"priority\": 3,\n \"status\": \"Received\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://reimagined-journey-g45xxv4v6gwhvrrr-80.app.github.dev/orders/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dish_ids\": [\n \"692a4a34a46ecf001f35ac6f\",\n \"6a4a857c022eb7001f9b8972\",\n \"6b7c2441a0db43001f9bf377\"\n ],\n \"priority\": 3,\n \"status\": \"Received\"\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"id": "674d0bf5c28b69001f8e03a1",
"created_at": "2024-04-22T10:00:00Z",
"updated_at": "2024-04-22T10:00:00Z",
"name": "John",
"table_number": 8,
"dish_ids": [
"692a4a34a46ecf001f35ac6f",
"6a4a857c022eb7001f9b8972",
"6b7c2441a0db43001f9bf377"
],
"special_requests": "<string>",
"priority": 3,
"scheduled_at": null,
"status": "Received"
}
],
"total_results": 1
}{
"title": "Human-readable error title.",
"detail": "Human-readable error details."
}{
"title": "Human-readable error title.",
"detail": "Human-readable error details."
}{
"title": "Human-readable error title.",
"detail": "Human-readable error details."
}Authorizations
Body
application/json
The request body to update an order requires only the properties to be updated.
Order properties that can be updated: dish_ids, priority, and status.
Indicates the status of the order preparation.
The expeditor will use this field to sort incoming orders and determine what dishes are ready to be prepared and assembled by station.
Available options:
Draft, Received, In Progress, Ready for Assembly, On the Way, Ready for Pickup Example:
"Received"