Skip to main content

Catering Orders

PUT Upsert Catering Orders /catering-orders/upsert

Update an exisitng order if the id the provided exists already, otherwise creates a new order.

Body & Response

NameValueDescriptionRequired
idstringUnique Idtrue
datestringDate of order (format: YYYY-MM-DD)true
channelstringCatering Platform Channels (See list of available channels)true
orderDatestringFull date UTC in ISO formattrue
locationstringLocation nametrue
locationIdstringLocation idtrue
finalizedOrderbooleanSpecifies whether order has been finalizedtrue
restaurantstringRestaurant namefalse
restaurantIdstringRestaurant idfalse
mealsEstimatenumberIf order is not finalized, you can specify an estimate of mealsfalse
filesobjectAn object with keys as file names and values of the files urlfalse
orderIdstringOrder id provided by channelfalse
utensilsbooleanSpecifies whether order requires utensilsfalse
totalMealsnumberTotal meals for orderfalse
mealsobject arrayArray of meals with itemName, quantity, modfiers[]false
headCountnumberTotal Headcount for orderfalse
customerNamestringName of customer for orderfalse
cancelledbooleanSpecifies whether order has been cancelledfalse
totalCostnumberGrand total for order in dollarsfalse
orderTotalnumberTotal for just order in dollarsfalse
taxnumberTax total in dollarsfalse
totalPreTaxnumberOrder Total Pre-Tax in dollarsfalse
deliveryFeenumberDelivery Fee for order in dollarsfalse
serviceFeenumberService fee in dollarsfalse
gratuitynumberGratuity in dollarsfalse
discountnumberDiscount by channel in dollarsfalse
additionalFeesnumberAny additional fees for order in dollarsfalse
comissionnumberCommission for location in dollarsfalse
tipnumberTips in dollarsfalse
deliveryPhonestringDelivery phone to contact in case of problems with delivering
(format: +XXXXXXXXXXX)
false
deliveryInstructionsstringDelivery Instructionsfalse
deliveryAddressstringDelivery Address
(ex. 123 Street Ave, San Francisco CA 12345, USA)
false

Authorization Bearer Token

Token                             API_Key

Headers

Content-Type                 application/json

Example

import axios from "axios"; 

const headers = {
"Authorization": `Bearer ${your_api_key}`,
"Content-Type": "application/json"
};

const order = {
"id": "3d151e13-fd3e-4bbb-8066-4faf076899f4",
"date": "2024-01-04",
"channel": "Forkable",
"orderDate": "2024-01-04T01:30:00.000+05:00",
"location": "Houston",
"locationId": "59a87f79-2219-43d0-b607-dc0c4f3fc09b",
"finalizedOrder": true,
"restaurant": "Burger Palace",
"restaurantId": "b4eb9c2a-861c-4273-81b7-85beedba86e3",
"mealsEstimate": 8,
"files": {
"receipt": "https://example.com/labels/example.pdf"
},
"orderId": "order-zeimpatzp",
"utensils": "true",
"totalMeals": 10,
"meals": [
{
"itemName": "Pizza",
"quantity": 3,
"modifiers": [
{
"modifierName": "Gluten-Free",
"quantity": 3
},
]
},
{
"itemName": "Pasta",
"quantity": 7,
"modifiers": [
{
"modifierName": "No Onions",
"quantity": 3
}
]
}
],
"headCount": 6,
"customerName": "Jorge Reyes",
"cancelled": true,
"totalCost": 91.46,
"tax": 5.73,
"totalPreTax": 71.63,
"orderTotal": 32.78,
"deliveryFee": 2.41,
"serviceFee": 3.84,
"gratuity": 10.74,
"discount": 8.8,
"additionalFees": 1.52,
"commission": 7.16,
"tip": 4.38,
"deliveryPhone": "+12345678912",
"deliveryInstructions": "Leave at the door",
"deliveryAddress": "123 Street Ave, San Francisco CA 12345, USA"
}

const rootUrl = "https://us-central1-checklist-admin-d0013.cloudfunctions.net/api/v1";

const request = axios(rootUrl+`/catering-orders/upsert`, { headers, data: order });

Body Response JSON

{
"id": "3d151e13-fd3e-4bbb-8066-4faf076899f4",
"date": "2024-01-04",
"channel": "Forkable",
"orderDate": "2024-01-04T01:30:00.000+05:00",
"location": "Houston",
"locationId": "59a87f79-2219-43d0-b607-dc0c4f3fc09b",
"finalizedOrder": true,
"restaurant": "Burger Palace",
"restaurantId": "b4eb9c2a-861c-4273-81b7-85beedba86e3",
"mealsEstimate": 8,
"files": {
"receipt": "https://example.com/labels/example.pdf"
},
"orderId": "order-zeimpatzp",
"utensils": "true",
"totalMeals": 10,
"meals": [
{
"itemName": "Pizza",
"quantity": 3,
"modifiers": [
{
"modifierName": "Gluten-Free",
"quantity": 3
},
]
},
{
"itemName": "Pasta",
"quantity": 7,
"modifiers": [
{
"modifierName": "No Onions",
"quantity": 3
}
]
}
],
"headCount": 6,
"customerName": "Jorge Reyes",
"cancelled": true,
"totalCost": 91.46,
"tax": 5.73,
"totalPreTax": 71.63,
"orderTotal": 32.78,
"deliveryFee": 2.41,
"serviceFee": 3.84,
"gratuity": 10.74,
"discount": 8.8,
"additionalFees": 1.52,
"commission": 7.16,
"tip": 4.38,
"deliveryPhone": "+12345678912",
"deliveryInstructions": "Leave at the door",
"deliveryAddress": "123 Street Ave, San Francisco CA 12345, USA"
}