Suggest catering catalog quantities and preferences
curl --request PUT \
--url https://api.craveup.com/api/v1/storefront/locations/{locationId}/catering/events/{eventId}/live-cart \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'X-Catering-Token: <api-key>' \
--data '
{
"eventRevision": 4503599627370495,
"cartVersion": 4503599627370495,
"menuReleases": [
{
"menuId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"locationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"menuReleaseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"targetRevision": 4503599627370495,
"contentHash": "<string>"
}
],
"items": [
{
"source": {
"menuId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"locationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"channel": "catering",
"kind": "released",
"menuReleaseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"lineId": "<string>",
"productId": "<string>",
"selections": [
{
"groupId": "<string>",
"selectedOptions": [
{
"optionId": "<string>",
"quantity": 50,
"children": "<array>"
}
]
}
],
"quantity": "<string>",
"allocation": {
"groupId": "<string>",
"guests": 5000
}
}
],
"preferences": "<string>"
}
'import requests
url = "https://api.craveup.com/api/v1/storefront/locations/{locationId}/catering/events/{eventId}/live-cart"
payload = {
"eventRevision": 4503599627370495,
"cartVersion": 4503599627370495,
"menuReleases": [
{
"menuId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"locationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"menuReleaseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"targetRevision": 4503599627370495,
"contentHash": "<string>"
}
],
"items": [
{
"source": {
"menuId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"locationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"channel": "catering",
"kind": "released",
"menuReleaseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"lineId": "<string>",
"productId": "<string>",
"selections": [
{
"groupId": "<string>",
"selectedOptions": [
{
"optionId": "<string>",
"quantity": 50,
"children": "<array>"
}
]
}
],
"quantity": "<string>",
"allocation": {
"groupId": "<string>",
"guests": 5000
}
}
],
"preferences": "<string>"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"X-Catering-Token": "<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-Catering-Token': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
eventRevision: 4503599627370495,
cartVersion: 4503599627370495,
menuReleases: [
{
menuId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
locationId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
menuReleaseId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
targetRevision: 4503599627370495,
contentHash: '<string>'
}
],
items: [
{
source: {
menuId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
locationId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
channel: 'catering',
kind: 'released',
menuReleaseId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
},
lineId: '<string>',
productId: '<string>',
selections: [
{
groupId: '<string>',
selectedOptions: [{optionId: '<string>', quantity: 50, children: '<array>'}]
}
],
quantity: '<string>',
allocation: {groupId: '<string>', guests: 5000}
}
],
preferences: '<string>'
})
};
fetch('https://api.craveup.com/api/v1/storefront/locations/{locationId}/catering/events/{eventId}/live-cart', 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://api.craveup.com/api/v1/storefront/locations/{locationId}/catering/events/{eventId}/live-cart",
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([
'eventRevision' => 4503599627370495,
'cartVersion' => 4503599627370495,
'menuReleases' => [
[
'menuId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'locationId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'menuReleaseId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'targetRevision' => 4503599627370495,
'contentHash' => '<string>'
]
],
'items' => [
[
'source' => [
'menuId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'locationId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'channel' => 'catering',
'kind' => 'released',
'menuReleaseId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'lineId' => '<string>',
'productId' => '<string>',
'selections' => [
[
'groupId' => '<string>',
'selectedOptions' => [
[
'optionId' => '<string>',
'quantity' => 50,
'children' => '<array>'
]
]
]
],
'quantity' => '<string>',
'allocation' => [
'groupId' => '<string>',
'guests' => 5000
]
]
],
'preferences' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"X-Catering-Token: <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://api.craveup.com/api/v1/storefront/locations/{locationId}/catering/events/{eventId}/live-cart"
payload := strings.NewReader("{\n \"eventRevision\": 4503599627370495,\n \"cartVersion\": 4503599627370495,\n \"menuReleases\": [\n {\n \"menuId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"locationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"menuReleaseId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"targetRevision\": 4503599627370495,\n \"contentHash\": \"<string>\"\n }\n ],\n \"items\": [\n {\n \"source\": {\n \"menuId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"locationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"channel\": \"catering\",\n \"kind\": \"released\",\n \"menuReleaseId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"lineId\": \"<string>\",\n \"productId\": \"<string>\",\n \"selections\": [\n {\n \"groupId\": \"<string>\",\n \"selectedOptions\": [\n {\n \"optionId\": \"<string>\",\n \"quantity\": 50,\n \"children\": \"<array>\"\n }\n ]\n }\n ],\n \"quantity\": \"<string>\",\n \"allocation\": {\n \"groupId\": \"<string>\",\n \"guests\": 5000\n }\n }\n ],\n \"preferences\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("X-Catering-Token", "<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://api.craveup.com/api/v1/storefront/locations/{locationId}/catering/events/{eventId}/live-cart")
.header("Idempotency-Key", "<idempotency-key>")
.header("X-Catering-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"eventRevision\": 4503599627370495,\n \"cartVersion\": 4503599627370495,\n \"menuReleases\": [\n {\n \"menuId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"locationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"menuReleaseId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"targetRevision\": 4503599627370495,\n \"contentHash\": \"<string>\"\n }\n ],\n \"items\": [\n {\n \"source\": {\n \"menuId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"locationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"channel\": \"catering\",\n \"kind\": \"released\",\n \"menuReleaseId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"lineId\": \"<string>\",\n \"productId\": \"<string>\",\n \"selections\": [\n {\n \"groupId\": \"<string>\",\n \"selectedOptions\": [\n {\n \"optionId\": \"<string>\",\n \"quantity\": 50,\n \"children\": \"<array>\"\n }\n ]\n }\n ],\n \"quantity\": \"<string>\",\n \"allocation\": {\n \"groupId\": \"<string>\",\n \"guests\": 5000\n }\n }\n ],\n \"preferences\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.craveup.com/api/v1/storefront/locations/{locationId}/catering/events/{eventId}/live-cart")
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-Catering-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"eventRevision\": 4503599627370495,\n \"cartVersion\": 4503599627370495,\n \"menuReleases\": [\n {\n \"menuId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"locationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"menuReleaseId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"targetRevision\": 4503599627370495,\n \"contentHash\": \"<string>\"\n }\n ],\n \"items\": [\n {\n \"source\": {\n \"menuId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"locationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"channel\": \"catering\",\n \"kind\": \"released\",\n \"menuReleaseId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"lineId\": \"<string>\",\n \"productId\": \"<string>\",\n \"selections\": [\n {\n \"groupId\": \"<string>\",\n \"selectedOptions\": [\n {\n \"optionId\": \"<string>\",\n \"quantity\": 50,\n \"children\": \"<array>\"\n }\n ]\n }\n ],\n \"quantity\": \"<string>\",\n \"allocation\": {\n \"groupId\": \"<string>\",\n \"guests\": 5000\n }\n }\n ],\n \"preferences\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"cartId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"eventId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"locationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"eventRevision": 4503599627370495,
"cartVersion": 4503599627370495,
"state": "unsent",
"editable": true,
"items": [
{
"source": {
"menuId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"locationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"channel": "catering",
"kind": "released",
"menuReleaseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"lineId": "<string>",
"productId": "<string>",
"selections": [
{
"groupId": "<string>",
"selectedOptions": [
{
"optionId": "<string>",
"quantity": 50,
"children": "<array>"
}
]
}
],
"quantity": "<string>",
"allocation": {
"groupId": "<string>",
"guests": 5000
},
"dietaryPreferences": {
"preferences": [
"vegetarian"
],
"avoidAllergenIds": [
"milk"
]
}
}
],
"preferences": "<string>",
"menuReleases": [
{
"menuId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"locationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"channel": "online",
"menuReleaseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"targetRevision": 4503599627370495,
"contentHash": "<string>"
}
],
"requiresCatalogReview": true,
"staffReviewItems": [
{
"source": {
"menuId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"locationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"channel": "catering",
"kind": "released",
"menuReleaseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"productId": "<string>",
"name": "<string>",
"reason": "configuration_required"
}
],
"currency": "<string>",
"choices": [
{
"commercialPolicy": {
"servingRangeReading": "plan_for_lower",
"rangeQuotePolicy": "quote_top",
"rules": {
"all": {
"minimumGuests": 5000,
"maximumGuests": 5000,
"minimumUnits": "<string>",
"maximumUnits": "<string>",
"minimumSpend": {
"amountCents": 49999999,
"basis": "eligible_food_beverage_before_discounts"
},
"leadTimeHours": 4380
},
"byServiceStyle": {}
}
},
"source": {
"menuId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"locationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"channel": "catering",
"kind": "released",
"menuReleaseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"productId": "<string>",
"name": "<string>",
"description": "<string>",
"priceBasis": "per_person",
"printedPrice": {
"kind": "exact",
"amountCents": 49999999
},
"serves": {
"kind": "exact",
"guests": 5000,
"sourceText": "<string>"
},
"quantityRules": {
"increment": "<string>",
"minimum": "<string>",
"maximum": "<string>"
},
"contents": [
{
"name": "<string>",
"quantity": "<string>",
"unit": "person"
}
],
"planningYield": {
"guests": "<string>",
"quantity": "<string>",
"reviewNote": "<string>"
},
"minimumSpendEligibility": "food_beverage",
"allocationGroup": {
"groupId": "<string>",
"minimumGuests": 5000,
"maximumGuests": 5000,
"minimumGuestsPerProduct": 5000,
"maximumDistinctProducts": 50,
"total": "event_headcount"
},
"ruleLayers": [
{
"scope": "location",
"entityId": "<string>",
"rules": {
"all": {
"minimumGuests": 5000,
"maximumGuests": 5000,
"minimumUnits": "<string>",
"maximumUnits": "<string>",
"minimumSpend": {
"amountCents": 49999999,
"basis": "eligible_food_beverage_before_discounts"
},
"leadTimeHours": 4380
},
"byServiceStyle": {}
}
}
],
"reviewFacts": [
{
"code": "conflicting_lead_time",
"sourceText": "<string>",
"reason": "<string>"
}
],
"foodFacts": {
"serving": {
"label": "<string>",
"grams": 1
},
"nutrients": {
"caloriesKcal": 1,
"proteinGrams": 1,
"carbohydrateGrams": 1,
"fatGrams": 1,
"fiberGrams": 1,
"sugarGrams": 1,
"saturatedFatGrams": 1,
"sodiumMilligrams": 1
},
"provenance": {
"kind": "entered"
},
"includedComponentIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"suitability": {
"vegetarian": "suitable",
"vegan": "suitable"
},
"ingredients": [
"<string>"
],
"allergens": [
{
"allergenId": "milk",
"status": "contains"
}
],
"crossContact": {
"status": "possible",
"allergenIds": [
"milk"
],
"evidence": "<string>"
}
},
"groups": [
{
"groupId": "<string>",
"name": "<string>",
"semanticRole": "size",
"minSelections": 4503599627370495,
"maxSelections": 4503599627370495,
"customerVisible": true,
"selectionPath": [
"<string>"
],
"defaultSelections": [
{
"optionId": "<string>",
"quantity": 49
}
],
"fixedSelections": [
{
"optionId": "<string>",
"quantity": 49
}
],
"options": [
{
"optionId": "<string>",
"name": "<string>",
"priceSemantics": "replaces_item",
"printedPrice": {
"kind": "exact",
"amountCents": 49999999
},
"serves": {
"kind": "exact",
"guests": 5000,
"sourceText": "<string>"
},
"planningYield": {
"guests": "<string>",
"quantity": "<string>",
"reviewNote": "<string>"
},
"charge": {
"chargeId": "<string>",
"scope": "sold_unit",
"minimumSpendEligibility": "food_beverage"
},
"reviewFacts": [
{
"code": "conflicting_lead_time",
"sourceText": "<string>",
"reason": "<string>"
}
],
"customerVisible": true,
"selectionPath": [
"<string>"
],
"maxQuantity": 4503599627370495,
"available": true,
"foodFacts": {
"serving": {
"label": "<string>",
"grams": 1
},
"nutrients": {
"caloriesKcal": 1,
"proteinGrams": 1,
"carbohydrateGrams": 1,
"fatGrams": 1,
"fiberGrams": 1,
"sugarGrams": 1,
"saturatedFatGrams": 1,
"sodiumMilligrams": 1
},
"provenance": {
"kind": "entered"
},
"includedComponentIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"suitability": {
"vegetarian": "suitable",
"vegan": "suitable"
},
"ingredients": [
"<string>"
],
"allergens": [
{
"allergenId": "milk",
"status": "contains"
}
],
"crossContact": {
"status": "possible",
"allergenIds": [
"milk"
],
"evidence": "<string>"
}
},
"childGroups": [
{
"groupId": "<string>",
"applyPerParentQuantity": true,
"group": "<unknown>"
}
]
}
]
}
]
}
],
"approvedQuoteId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"code": "VALIDATION_ERROR",
"message": "<string>",
"requestId": "<string>",
"details": {}
}{
"code": "VALIDATION_ERROR",
"message": "<string>",
"requestId": "<string>",
"details": {}
}{
"code": "VALIDATION_ERROR",
"message": "<string>",
"requestId": "<string>",
"details": {}
}{
"code": "VALIDATION_ERROR",
"message": "<string>",
"requestId": "<string>",
"details": {}
}{
"code": "VALIDATION_ERROR",
"message": "<string>",
"requestId": "<string>",
"details": {}
}{
"code": "VALIDATION_ERROR",
"message": "<string>",
"requestId": "<string>",
"details": {}
}{
"code": "VALIDATION_ERROR",
"message": "<string>",
"requestId": "<string>",
"details": {}
}{
"code": "VALIDATION_ERROR",
"message": "<string>",
"requestId": "<string>",
"details": {}
}Catering
Suggest catering catalog quantities and preferences
PUT
/
locations
/
{locationId}
/
catering
/
events
/
{eventId}
/
live-cart
Suggest catering catalog quantities and preferences
curl --request PUT \
--url https://api.craveup.com/api/v1/storefront/locations/{locationId}/catering/events/{eventId}/live-cart \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'X-Catering-Token: <api-key>' \
--data '
{
"eventRevision": 4503599627370495,
"cartVersion": 4503599627370495,
"menuReleases": [
{
"menuId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"locationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"menuReleaseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"targetRevision": 4503599627370495,
"contentHash": "<string>"
}
],
"items": [
{
"source": {
"menuId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"locationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"channel": "catering",
"kind": "released",
"menuReleaseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"lineId": "<string>",
"productId": "<string>",
"selections": [
{
"groupId": "<string>",
"selectedOptions": [
{
"optionId": "<string>",
"quantity": 50,
"children": "<array>"
}
]
}
],
"quantity": "<string>",
"allocation": {
"groupId": "<string>",
"guests": 5000
}
}
],
"preferences": "<string>"
}
'import requests
url = "https://api.craveup.com/api/v1/storefront/locations/{locationId}/catering/events/{eventId}/live-cart"
payload = {
"eventRevision": 4503599627370495,
"cartVersion": 4503599627370495,
"menuReleases": [
{
"menuId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"locationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"menuReleaseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"targetRevision": 4503599627370495,
"contentHash": "<string>"
}
],
"items": [
{
"source": {
"menuId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"locationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"channel": "catering",
"kind": "released",
"menuReleaseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"lineId": "<string>",
"productId": "<string>",
"selections": [
{
"groupId": "<string>",
"selectedOptions": [
{
"optionId": "<string>",
"quantity": 50,
"children": "<array>"
}
]
}
],
"quantity": "<string>",
"allocation": {
"groupId": "<string>",
"guests": 5000
}
}
],
"preferences": "<string>"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"X-Catering-Token": "<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-Catering-Token': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
eventRevision: 4503599627370495,
cartVersion: 4503599627370495,
menuReleases: [
{
menuId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
locationId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
menuReleaseId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
targetRevision: 4503599627370495,
contentHash: '<string>'
}
],
items: [
{
source: {
menuId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
locationId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
channel: 'catering',
kind: 'released',
menuReleaseId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
},
lineId: '<string>',
productId: '<string>',
selections: [
{
groupId: '<string>',
selectedOptions: [{optionId: '<string>', quantity: 50, children: '<array>'}]
}
],
quantity: '<string>',
allocation: {groupId: '<string>', guests: 5000}
}
],
preferences: '<string>'
})
};
fetch('https://api.craveup.com/api/v1/storefront/locations/{locationId}/catering/events/{eventId}/live-cart', 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://api.craveup.com/api/v1/storefront/locations/{locationId}/catering/events/{eventId}/live-cart",
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([
'eventRevision' => 4503599627370495,
'cartVersion' => 4503599627370495,
'menuReleases' => [
[
'menuId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'locationId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'menuReleaseId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'targetRevision' => 4503599627370495,
'contentHash' => '<string>'
]
],
'items' => [
[
'source' => [
'menuId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'locationId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'channel' => 'catering',
'kind' => 'released',
'menuReleaseId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'lineId' => '<string>',
'productId' => '<string>',
'selections' => [
[
'groupId' => '<string>',
'selectedOptions' => [
[
'optionId' => '<string>',
'quantity' => 50,
'children' => '<array>'
]
]
]
],
'quantity' => '<string>',
'allocation' => [
'groupId' => '<string>',
'guests' => 5000
]
]
],
'preferences' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"X-Catering-Token: <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://api.craveup.com/api/v1/storefront/locations/{locationId}/catering/events/{eventId}/live-cart"
payload := strings.NewReader("{\n \"eventRevision\": 4503599627370495,\n \"cartVersion\": 4503599627370495,\n \"menuReleases\": [\n {\n \"menuId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"locationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"menuReleaseId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"targetRevision\": 4503599627370495,\n \"contentHash\": \"<string>\"\n }\n ],\n \"items\": [\n {\n \"source\": {\n \"menuId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"locationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"channel\": \"catering\",\n \"kind\": \"released\",\n \"menuReleaseId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"lineId\": \"<string>\",\n \"productId\": \"<string>\",\n \"selections\": [\n {\n \"groupId\": \"<string>\",\n \"selectedOptions\": [\n {\n \"optionId\": \"<string>\",\n \"quantity\": 50,\n \"children\": \"<array>\"\n }\n ]\n }\n ],\n \"quantity\": \"<string>\",\n \"allocation\": {\n \"groupId\": \"<string>\",\n \"guests\": 5000\n }\n }\n ],\n \"preferences\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("X-Catering-Token", "<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://api.craveup.com/api/v1/storefront/locations/{locationId}/catering/events/{eventId}/live-cart")
.header("Idempotency-Key", "<idempotency-key>")
.header("X-Catering-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"eventRevision\": 4503599627370495,\n \"cartVersion\": 4503599627370495,\n \"menuReleases\": [\n {\n \"menuId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"locationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"menuReleaseId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"targetRevision\": 4503599627370495,\n \"contentHash\": \"<string>\"\n }\n ],\n \"items\": [\n {\n \"source\": {\n \"menuId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"locationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"channel\": \"catering\",\n \"kind\": \"released\",\n \"menuReleaseId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"lineId\": \"<string>\",\n \"productId\": \"<string>\",\n \"selections\": [\n {\n \"groupId\": \"<string>\",\n \"selectedOptions\": [\n {\n \"optionId\": \"<string>\",\n \"quantity\": 50,\n \"children\": \"<array>\"\n }\n ]\n }\n ],\n \"quantity\": \"<string>\",\n \"allocation\": {\n \"groupId\": \"<string>\",\n \"guests\": 5000\n }\n }\n ],\n \"preferences\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.craveup.com/api/v1/storefront/locations/{locationId}/catering/events/{eventId}/live-cart")
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-Catering-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"eventRevision\": 4503599627370495,\n \"cartVersion\": 4503599627370495,\n \"menuReleases\": [\n {\n \"menuId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"locationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"menuReleaseId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"targetRevision\": 4503599627370495,\n \"contentHash\": \"<string>\"\n }\n ],\n \"items\": [\n {\n \"source\": {\n \"menuId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"locationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"channel\": \"catering\",\n \"kind\": \"released\",\n \"menuReleaseId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"lineId\": \"<string>\",\n \"productId\": \"<string>\",\n \"selections\": [\n {\n \"groupId\": \"<string>\",\n \"selectedOptions\": [\n {\n \"optionId\": \"<string>\",\n \"quantity\": 50,\n \"children\": \"<array>\"\n }\n ]\n }\n ],\n \"quantity\": \"<string>\",\n \"allocation\": {\n \"groupId\": \"<string>\",\n \"guests\": 5000\n }\n }\n ],\n \"preferences\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"cartId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"eventId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"locationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"eventRevision": 4503599627370495,
"cartVersion": 4503599627370495,
"state": "unsent",
"editable": true,
"items": [
{
"source": {
"menuId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"locationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"channel": "catering",
"kind": "released",
"menuReleaseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"lineId": "<string>",
"productId": "<string>",
"selections": [
{
"groupId": "<string>",
"selectedOptions": [
{
"optionId": "<string>",
"quantity": 50,
"children": "<array>"
}
]
}
],
"quantity": "<string>",
"allocation": {
"groupId": "<string>",
"guests": 5000
},
"dietaryPreferences": {
"preferences": [
"vegetarian"
],
"avoidAllergenIds": [
"milk"
]
}
}
],
"preferences": "<string>",
"menuReleases": [
{
"menuId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"locationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"channel": "online",
"menuReleaseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"targetRevision": 4503599627370495,
"contentHash": "<string>"
}
],
"requiresCatalogReview": true,
"staffReviewItems": [
{
"source": {
"menuId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"locationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"channel": "catering",
"kind": "released",
"menuReleaseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"productId": "<string>",
"name": "<string>",
"reason": "configuration_required"
}
],
"currency": "<string>",
"choices": [
{
"commercialPolicy": {
"servingRangeReading": "plan_for_lower",
"rangeQuotePolicy": "quote_top",
"rules": {
"all": {
"minimumGuests": 5000,
"maximumGuests": 5000,
"minimumUnits": "<string>",
"maximumUnits": "<string>",
"minimumSpend": {
"amountCents": 49999999,
"basis": "eligible_food_beverage_before_discounts"
},
"leadTimeHours": 4380
},
"byServiceStyle": {}
}
},
"source": {
"menuId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"locationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"channel": "catering",
"kind": "released",
"menuReleaseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"productId": "<string>",
"name": "<string>",
"description": "<string>",
"priceBasis": "per_person",
"printedPrice": {
"kind": "exact",
"amountCents": 49999999
},
"serves": {
"kind": "exact",
"guests": 5000,
"sourceText": "<string>"
},
"quantityRules": {
"increment": "<string>",
"minimum": "<string>",
"maximum": "<string>"
},
"contents": [
{
"name": "<string>",
"quantity": "<string>",
"unit": "person"
}
],
"planningYield": {
"guests": "<string>",
"quantity": "<string>",
"reviewNote": "<string>"
},
"minimumSpendEligibility": "food_beverage",
"allocationGroup": {
"groupId": "<string>",
"minimumGuests": 5000,
"maximumGuests": 5000,
"minimumGuestsPerProduct": 5000,
"maximumDistinctProducts": 50,
"total": "event_headcount"
},
"ruleLayers": [
{
"scope": "location",
"entityId": "<string>",
"rules": {
"all": {
"minimumGuests": 5000,
"maximumGuests": 5000,
"minimumUnits": "<string>",
"maximumUnits": "<string>",
"minimumSpend": {
"amountCents": 49999999,
"basis": "eligible_food_beverage_before_discounts"
},
"leadTimeHours": 4380
},
"byServiceStyle": {}
}
}
],
"reviewFacts": [
{
"code": "conflicting_lead_time",
"sourceText": "<string>",
"reason": "<string>"
}
],
"foodFacts": {
"serving": {
"label": "<string>",
"grams": 1
},
"nutrients": {
"caloriesKcal": 1,
"proteinGrams": 1,
"carbohydrateGrams": 1,
"fatGrams": 1,
"fiberGrams": 1,
"sugarGrams": 1,
"saturatedFatGrams": 1,
"sodiumMilligrams": 1
},
"provenance": {
"kind": "entered"
},
"includedComponentIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"suitability": {
"vegetarian": "suitable",
"vegan": "suitable"
},
"ingredients": [
"<string>"
],
"allergens": [
{
"allergenId": "milk",
"status": "contains"
}
],
"crossContact": {
"status": "possible",
"allergenIds": [
"milk"
],
"evidence": "<string>"
}
},
"groups": [
{
"groupId": "<string>",
"name": "<string>",
"semanticRole": "size",
"minSelections": 4503599627370495,
"maxSelections": 4503599627370495,
"customerVisible": true,
"selectionPath": [
"<string>"
],
"defaultSelections": [
{
"optionId": "<string>",
"quantity": 49
}
],
"fixedSelections": [
{
"optionId": "<string>",
"quantity": 49
}
],
"options": [
{
"optionId": "<string>",
"name": "<string>",
"priceSemantics": "replaces_item",
"printedPrice": {
"kind": "exact",
"amountCents": 49999999
},
"serves": {
"kind": "exact",
"guests": 5000,
"sourceText": "<string>"
},
"planningYield": {
"guests": "<string>",
"quantity": "<string>",
"reviewNote": "<string>"
},
"charge": {
"chargeId": "<string>",
"scope": "sold_unit",
"minimumSpendEligibility": "food_beverage"
},
"reviewFacts": [
{
"code": "conflicting_lead_time",
"sourceText": "<string>",
"reason": "<string>"
}
],
"customerVisible": true,
"selectionPath": [
"<string>"
],
"maxQuantity": 4503599627370495,
"available": true,
"foodFacts": {
"serving": {
"label": "<string>",
"grams": 1
},
"nutrients": {
"caloriesKcal": 1,
"proteinGrams": 1,
"carbohydrateGrams": 1,
"fatGrams": 1,
"fiberGrams": 1,
"sugarGrams": 1,
"saturatedFatGrams": 1,
"sodiumMilligrams": 1
},
"provenance": {
"kind": "entered"
},
"includedComponentIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"suitability": {
"vegetarian": "suitable",
"vegan": "suitable"
},
"ingredients": [
"<string>"
],
"allergens": [
{
"allergenId": "milk",
"status": "contains"
}
],
"crossContact": {
"status": "possible",
"allergenIds": [
"milk"
],
"evidence": "<string>"
}
},
"childGroups": [
{
"groupId": "<string>",
"applyPerParentQuantity": true,
"group": "<unknown>"
}
]
}
]
}
]
}
],
"approvedQuoteId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"code": "VALIDATION_ERROR",
"message": "<string>",
"requestId": "<string>",
"details": {}
}{
"code": "VALIDATION_ERROR",
"message": "<string>",
"requestId": "<string>",
"details": {}
}{
"code": "VALIDATION_ERROR",
"message": "<string>",
"requestId": "<string>",
"details": {}
}{
"code": "VALIDATION_ERROR",
"message": "<string>",
"requestId": "<string>",
"details": {}
}{
"code": "VALIDATION_ERROR",
"message": "<string>",
"requestId": "<string>",
"details": {}
}{
"code": "VALIDATION_ERROR",
"message": "<string>",
"requestId": "<string>",
"details": {}
}{
"code": "VALIDATION_ERROR",
"message": "<string>",
"requestId": "<string>",
"details": {}
}{
"code": "VALIDATION_ERROR",
"message": "<string>",
"requestId": "<string>",
"details": {}
}Authorizations
Event and location scoped customer catering capability. Never place in query parameters.
Headers
Caller-stable key reused only for retries of this exact request.
Required string length:
16 - 128Pattern:
^[A-Za-z0-9._:-]{16,128}$Path Parameters
Required string length:
1 - 128Required string length:
1 - 128Body
application/json
Required range:
0 <= x <= 9007199254740991Required range:
0 <= x <= 9007199254740991Maximum array length:
1000Show child attributes
Show child attributes
Maximum array length:
100Show child attributes
Show child attributes
Maximum string length:
2000Response
Saved proposal awaiting restaurant approval.
Pattern:
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Pattern:
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Pattern:
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Required range:
0 <= x <= 9007199254740991Required range:
0 <= x <= 9007199254740991Available options:
unsent, awaiting_restaurant_approval, ready, confirmed, unavailable Maximum array length:
100Show child attributes
Show child attributes
Maximum array length:
1000Show child attributes
Show child attributes
Show child attributes
Show child attributes
Pattern:
^[A-Z]{3}$Show child attributes
Show child attributes
Pattern:
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$