Get recommendable products
curl --request GET \
--url https://api.craveup.com/api/v1/locations/{locationId}/carts/{cartId}/products \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.craveup.com/api/v1/locations/{locationId}/carts/{cartId}/products"
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}/carts/{cartId}/products', 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}/carts/{cartId}/products",
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}/carts/{cartId}/products"
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}/carts/{cartId}/products")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.craveup.com/api/v1/locations/{locationId}/carts/{cartId}/products")
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_buffalo_wings",
"name": "Buffalo Wings",
"description": "Crisp wings with house buffalo sauce.",
"price": "12.00",
"availability": "AVAILABLE",
"images": [
"https://cdn.craveup.com/products/buffalo-wings.jpg"
],
"modifierIds": [
"mod_group_sauces"
]
}
]{
"success": false,
"message": "Unauthorized access",
"code": "UNAUTHORIZED"
}{
"success": false,
"message": "An unexpected error occurred",
"code": "GENERIC_ERROR"
}Carts
Get recommendable products
Returns up to five products not already in the cart to power “you might also like” suggestions.
GET
/
locations
/
{locationId}
/
carts
/
{cartId}
/
products
Get recommendable products
curl --request GET \
--url https://api.craveup.com/api/v1/locations/{locationId}/carts/{cartId}/products \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.craveup.com/api/v1/locations/{locationId}/carts/{cartId}/products"
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}/carts/{cartId}/products', 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}/carts/{cartId}/products",
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}/carts/{cartId}/products"
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}/carts/{cartId}/products")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.craveup.com/api/v1/locations/{locationId}/carts/{cartId}/products")
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_buffalo_wings",
"name": "Buffalo Wings",
"description": "Crisp wings with house buffalo sauce.",
"price": "12.00",
"availability": "AVAILABLE",
"images": [
"https://cdn.craveup.com/products/buffalo-wings.jpg"
],
"modifierIds": [
"mod_group_sauces"
]
}
]{
"success": false,
"message": "Unauthorized access",
"code": "UNAUTHORIZED"
}{
"success": false,
"message": "An unexpected error occurred",
"code": "GENERIC_ERROR"
}Authorizations
API Key required to authenticate requests
Response
Recommended products fetched successfully.
Example:
"prod_buffalo_wings"
Example:
"Buffalo Wings"
Example:
"Crisp wings with house buffalo sauce."
Example:
"12.00"
Example:
"AVAILABLE"
Example:
[
"https://cdn.craveup.com/products/buffalo-wings.jpg"
]
Example:
["mod_group_sauces"]
⌘I