Add item to cart
Add a product, variant, food, or service item with optional add-ons to the authenticated shopper’s cart.
Request
Headers
| Header | Type | Description |
|---|---|---|
Authorization | string | Provide the customer token as Bearer <jwt>. |
x-shop-id | string | Identify the shop that owns the cart. |
Content-Type | string | Always set to application/json. |
Body parameters
| Field | Type | Required | Description |
|---|---|---|---|
productId | string | No | Product identifier to add. Provide one of productId, foodId, or serviceId. |
foodId | string | No | Food item identifier (restaurant stores). |
serviceId | string | No | Service identifier (business stores). |
variantId | string | No | Variant identifier. Include it to add a specific product variant. |
quantity | integer | No | Quantity to add. Defaults to 1. |
selectedAddons | array | No | Array of add-on objects {addonId, quantity} for food or service items. |
product for ecommerce, food for restaurant, and service for business stores. Add the matching identifier (productId, foodId, or serviceId). Services behave like foods — they have no variants but can carry add-ons.Food request example
Service request example
itemType: "service" and a populated service object (plus a serviceId convenience field), mirroring the food shape:
Successful response
Error response
Authorizations
JWT issued by the Salesive Store API for authenticated shoppers.
Optional storefront identifier sent as a header to scope responses to a specific shop. Try It requests remember this value once provided.
Headers
Optional identifier that scopes responses to a specific storefront when the referer cannot be inferred.
Body
- Option 1
- Option 2
- Option 3
Add a product/variant line item, a food line item, or a service line item, with optional add-ons. Use the identifier that matches the storefront catalog type: productId (ecommerce), foodId (restaurant), or serviceId (business).
Identifier of the product to add to the cart (ecommerce stores).
Identifier of the food item to add to the cart (restaurant stores).
Identifier of the service to add to the cart (business stores).
Optional identifier of the product variant to add.
Quantity of the product, food, or service to add. Defaults to 1.
x >= 1Optional add-on selections for food or service items.

