Get a product with modifier tree
curl --request GET \
--url https://api.craveup.com/api/v1/locations/{locationId}/products/{productId} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.craveup.com/api/v1/locations/{locationId}/products/{productId}"
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://api.craveup.com/api/v1/locations/{locationId}/products/{productId}', 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/locations/{locationId}/products/{productId}",
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://api.craveup.com/api/v1/locations/{locationId}/products/{productId}"
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://api.craveup.com/api/v1/locations/{locationId}/products/{productId}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.craveup.com/api/v1/locations/{locationId}/products/{productId}")
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{
"id": "prod_margherita",
"name": "Margherita Pizza",
"description": "Tomato, basil, mozzarella.",
"availability": "AVAILABLE",
"images": [
"https://cdn.craveup.com/products/margherita.png"
],
"price": "1800",
"displayPrice": "$18.00",
"currency": "usd",
"locationId": "loc_456def",
"modifierIds": [
"mod_group_sauces"
],
"modifiers": [
{
"id": "mod_group_sauces",
"name": "Sauce Selection",
"description": null,
"rule": {
"min": 0,
"max": 2
},
"items": [
{
"id": "mod_item_bbq",
"name": "BBQ Sauce",
"price": "0.50",
"maxQuantity": 2,
"childGroups": []
}
]
}
]
}{
"success": false,
"message": "Unauthorized access",
"code": "UNAUTHORIZED"
}{
"success": false,
"message": "Requested resource not found",
"code": "NOT_FOUND"
}{
"success": false,
"message": "An unexpected error occurred",
"code": "GENERIC_ERROR"
}Products
Get a product with modifier tree
Fetches product details and its modifier configuration for building a product detail page.
GET
/
locations
/
{locationId}
/
products
/
{productId}
Get a product with modifier tree
curl --request GET \
--url https://api.craveup.com/api/v1/locations/{locationId}/products/{productId} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.craveup.com/api/v1/locations/{locationId}/products/{productId}"
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://api.craveup.com/api/v1/locations/{locationId}/products/{productId}', 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/locations/{locationId}/products/{productId}",
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://api.craveup.com/api/v1/locations/{locationId}/products/{productId}"
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://api.craveup.com/api/v1/locations/{locationId}/products/{productId}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.craveup.com/api/v1/locations/{locationId}/products/{productId}")
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{
"id": "prod_margherita",
"name": "Margherita Pizza",
"description": "Tomato, basil, mozzarella.",
"availability": "AVAILABLE",
"images": [
"https://cdn.craveup.com/products/margherita.png"
],
"price": "1800",
"displayPrice": "$18.00",
"currency": "usd",
"locationId": "loc_456def",
"modifierIds": [
"mod_group_sauces"
],
"modifiers": [
{
"id": "mod_group_sauces",
"name": "Sauce Selection",
"description": null,
"rule": {
"min": 0,
"max": 2
},
"items": [
{
"id": "mod_item_bbq",
"name": "BBQ Sauce",
"price": "0.50",
"maxQuantity": 2,
"childGroups": []
}
]
}
]
}{
"success": false,
"message": "Unauthorized access",
"code": "UNAUTHORIZED"
}{
"success": false,
"message": "Requested resource not found",
"code": "NOT_FOUND"
}{
"success": false,
"message": "An unexpected error occurred",
"code": "GENERIC_ERROR"
}Authorizations
API Key required to authenticate requests
Response
Product retrieved successfully.
Example:
"prod_bbq_chicken"
Example:
"BBQ Chicken Pizza"
Example:
"AVAILABLE"
Example:
"21.00"
Example:
"$21.00"
Example:
"usd"
Example:
"loc_456def"
Show child attributes
Show child attributes
⌘I