Skip to main content
GET
/
locations
/
{locationId}
/
carts
/
{cartId}
Get cart
curl --request GET \
  --url https://api.craveup.com/api/v1/locations/{locationId}/carts/{cartId} \
  --header 'X-API-Key: <api-key>'
import requests

url = "https://api.craveup.com/api/v1/locations/{locationId}/carts/{cartId}"

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}', 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}",
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}"

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}")
.header("X-API-Key", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.craveup.com/api/v1/locations/{locationId}/carts/{cartId}")

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": "cart_123",
  "locationId": "loc_456def",
  "status": "OPEN",
  "lockedAt": null,
  "discountCode": null,
  "currency": "usd",
  "fulfilmentMethod": "pickup",
  "statementDescriptor": "CRAVE*Downtown Pizza Co",
  "pickupType": "ASAP",
  "orderDate": "2024-11-12",
  "orderTime": "18:30",
  "totalQuantity": 2,
  "subTotal": "3600",
  "subTotalFormatted": "$36.00",
  "discountTotal": "0.00",
  "discountTotalFormatted": "$0.00",
  "waiterTipTotal": "0.00",
  "waiterTipTotalFormatted": "$0.00",
  "taxTotal": "280",
  "taxTotalFormatted": "$2.80",
  "taxAndFeeTotal": "320",
  "taxAndFeeTotalFormatted": "$3.20",
  "serviceFeeTotal": "120",
  "serviceFeeTotalFormatted": "$1.20",
  "paymentProcessingFeeTotal": "40",
  "paymentProcessingFeeTotalFormatted": "$0.40",
  "applicationFeeTotal": "0.00",
  "applicationFeeTotalFormatted": "$0.00",
  "netSalesTotal": "3600",
  "netSalesTotalFormatted": "$36.00",
  "fulfillmentMethodFeeTotal": "0.00",
  "fulfillmentMethodFeeTotalFormatted": "$0.00",
  "orderTotalWithServiceFee": "4040",
  "orderTotalWithServiceFeeFormatted": "$40.40",
  "orderTotalWithServiceFeeAmount": 4040,
  "orderTotal": "4040",
  "orderTotalFormatted": "$40.40",
  "enterpriseFeeTotal": "0.00",
  "enterpriseFeeTotalFormatted": "$0.00",
  "subTotalWithoutDiscount": "3600",
  "subTotalWithoutDiscountFormatted": "$36.00",
  "restaurantDisplayName": "Downtown Pizza Co",
  "fees": {
    "enterpriseFeeRate": "0.0000",
    "enterpriseFeeFix": "0.00",
    "serviceFeeRate": "0.0250",
    "serviceFeeFix": "0.00",
    "taxRate": "0.0775",
    "tipRate": "0.0000",
    "fulfillmentMethodFeeFix": "0.00",
    "fulfillmentMethodFeeRate": "0.0000",
    "paymentProcessingFeeRate": "0.0290",
    "paymentProcessingFeeFix": "0.30"
  },
  "items": [
    {
      "id": "item_123",
      "productId": "prod_margherita",
      "name": "Margherita Pizza",
      "description": "Classic tomato, basil, mozzarella.",
      "imageUrl": "https://cdn.craveup.com/products/margherita.png",
      "price": "1800",
      "priceFormatted": "$18.00",
      "quantity": 2,
      "total": "3600",
      "totalFormatted": "$36.00",
      "discount": "0.00",
      "discountFormatted": "$0.00",
      "selections": []
    }
  ],
  "deliveryInfo": null,
  "tableServiceInfo": null,
  "roomServiceInfo": null,
  "metadata": {
    "channel": "qr"
  },
  "checkoutUrl": "https://checkout.craveup.com/c/cart_123",
  "fulfillmentIdentifier": null
}
{
"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

X-API-Key
string
header
required

API Key required to authenticate requests

Path Parameters

locationId
string
required
cartId
string
required

Response

Cart retrieved successfully.

id
string
Example:

"cart_123"

locationId
string
Example:

"loc_456def"

status
string
Example:

"OPEN"

lockedAt
string<date-time> | null

Timestamp when the cart was locked for checkout. Null while the cart is editable.

Example:

null

discountCode
string | null
Example:

"SAVE10"

currency
string
Example:

"usd"

fulfilmentMethod
string

Current fulfillment method for the cart. Note: the API responds with the UK spelling fulfilmentMethod; when updating a cart send fulfillmentMethod in the request body.

Example:

"pickup"

statementDescriptor
string | null

Descriptor that appears on the shopper’s card statement.

Example:

"CRAVE*Downtown Pizza Co"

pickupType
string
Example:

"ASAP"

orderDate
string
Example:

"2024-11-12"

orderTime
string
Example:

"18:30"

totalQuantity
integer
Example:

3

subTotal
string
Example:

"3600"

subTotalFormatted
string
Example:

"$36.00"

discountTotal
string
Example:

"0.00"

discountTotalFormatted
string
Example:

"$0.00"

waiterTipTotal
string
Example:

"540"

waiterTipTotalFormatted
string
Example:

"$5.40"

taxTotal
string
Example:

"280"

taxTotalFormatted
string
Example:

"$2.80"

taxAndFeeTotal
string
Example:

"320"

taxAndFeeTotalFormatted
string
Example:

"$3.20"

serviceFeeTotal
string
Example:

"120"

serviceFeeTotalFormatted
string
Example:

"$1.20"

paymentProcessingFeeTotal
string
Example:

"40"

paymentProcessingFeeTotalFormatted
string
Example:

"$0.40"

applicationFeeTotal
string
Example:

"0.00"

applicationFeeTotalFormatted
string
Example:

"$0.00"

netSalesTotal
string
Example:

"3600"

netSalesTotalFormatted
string
Example:

"$36.00"

fulfillmentMethodFeeTotal
string
Example:

"0.00"

fulfillmentMethodFeeTotalFormatted
string
Example:

"$0.00"

orderTotalWithServiceFee
string
Example:

"4460"

orderTotalWithServiceFeeFormatted
string
Example:

"$44.60"

orderTotalWithServiceFeeAmount
number

Order total with fees converted into the smallest currency unit.

Example:

4460

orderTotal
string
Example:

"4040"

orderTotalFormatted
string
Example:

"$40.40"

enterpriseFeeTotal
string
Example:

"0.00"

enterpriseFeeTotalFormatted
string
Example:

"$0.00"

subTotalWithoutDiscount
string
Example:

"3600"

subTotalWithoutDiscountFormatted
string
Example:

"$36.00"

restaurantDisplayName
string
Example:

"Downtown Pizza Co"

deliveryInfo
object | null
tableServiceInfo
object | null
roomServiceInfo
object | null
fees
object
metadata
object | null
checkoutUrl
string | null
fulfillmentIdentifier
string | null
Example:

null