Skip to main content
POST
/
locations
/
{locationId}
/
carts
/
{cartId}
/
cart-item
Add item to cart
curl --request POST \
  --url https://api.craveup.com/api/v1/locations/{locationId}/carts/{cartId}/cart-item \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '{
  "productId": "prod_margherita",
  "quantity": 2,
  "specialInstructions": "Extra crispy",
  "itemUnavailableAction": "remove_item",
  "selections": [
    {
      "groupId": "mod_group_crust",
      "selectedOptions": [
        {
          "optionId": "mod_option_thin",
          "quantity": 1,
          "children": [
            {
              "groupId": "<string>",
              "selectedOptions": [
                {
                  "optionId": "<string>",
                  "quantity": 123
                }
              ]
            }
          ]
        }
      ]
    }
  ],
  "categoryId": "cat_pizzas"
}'
{
  "cartId": "cart_123",
  "cart": {
    "id": "cart_123",
    "locationId": "loc_456def",
    "status": "OPEN",
    "lockedAt": null,
    "discountCode": "SAVE10",
    "currency": "usd",
    "fulfilmentMethod": "pickup",
    "statementDescriptor": "CRAVE*Downtown Pizza Co",
    "pickupType": "ASAP",
    "orderDate": "2024-11-12",
    "orderTime": "18:30",
    "totalQuantity": 3,
    "subTotal": "3600",
    "subTotalFormatted": "$36.00",
    "discountTotal": "0.00",
    "discountTotalFormatted": "$0.00",
    "waiterTipTotal": "540",
    "waiterTipTotalFormatted": "$5.40",
    "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": "4460",
    "orderTotalWithServiceFeeFormatted": "$44.60",
    "orderTotalWithServiceFeeAmount": 4460,
    "orderTotal": "4040",
    "orderTotalFormatted": "$40.40",
    "enterpriseFeeTotal": "0.00",
    "enterpriseFeeTotalFormatted": "$0.00",
    "subTotalWithoutDiscount": "3600",
    "subTotalWithoutDiscountFormatted": "$36.00",
    "restaurantDisplayName": "Downtown Pizza Co",
    "deliveryInfo": {
      "addressString": "123 Market Street, San Francisco, CA 94105",
      "addressData": {}
    },
    "tableServiceInfo": {
      "tableNumber": "A5"
    },
    "roomServiceInfo": {
      "lastName": "Smith",
      "roomNumber": "1203"
    },
    "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"
    },
    "metadata": {},
    "checkoutUrl": "<string>",
    "fulfillmentIdentifier": null
  }
}

Authorizations

X-API-Key
string
header
required

API Key required to authenticate requests

Path Parameters

locationId
string
required
cartId
string
required

Body

application/json
productId
string
required
Example:

"prod_margherita"

quantity
integer
required
Required range: x >= 1
Example:

2

itemUnavailableAction
enum<string>
required

Behavior when the item becomes unavailable.

Available options:
remove_item,
cancel_entire_order
Example:

"remove_item"

selections
object[]
required

Selected modifier groups and options.

specialInstructions
string | null
Example:

"Extra crispy"

categoryId
string | null
Example:

"cat_pizzas"

Response

Item added successfully.

Response structure returned after adding or updating items in a cart.

cartId
string
required
Example:

"cart_123"

cart
object
required
I