Skip to main content
POST
Add item to cart

Request

Headers

Body parameters

A storefront’s catalog type is determined by the shop type: product for ecommerce, food for restaurant, service for business, and digital for digital stores. Add the matching identifier (productId, foodId, serviceId, or digitalId / allAccess). Services behave like foods: they have no variants but can carry add-ons.

Food request example

Service request example

A service cart item is returned with itemType: "service" and a populated service object (plus a serviceId convenience field), mirroring the food shape:

Digital request example

A digital line carries no quantity (it is always 1, and quantity is ignored). The price on the line is a display snapshot taken from the catalog; the order recomputes it, so a client can never set it.
To add the all-access pass, send { "allAccess": true }. The returned line looks like this (itemType: "digital", with digital and digitalId pointing at the product; the pass line has neither):
Rules for digital lines, each answered with a code in the error body: Choosing the other way to buy an item already in the cart swaps the line instead of adding a second one. The quantity of a digital line cannot be changed.

Successful response

Error response

Authorizations

Authorization
string
header
required

JWT issued by the Salesive Store API for authenticated shoppers.

x-shop-id
string
header
required

Optional storefront identifier sent as a header to scope responses to a specific shop. Try It requests remember this value once provided.

Headers

x-shop-id
string

Optional identifier that scopes responses to a specific storefront when the referer cannot be inferred.

Body

application/json

Add a product/variant line item, a food line item, a service line item, or a digital line item, with optional add-ons. Use the identifier that matches the storefront catalog type: productId (ecommerce), foodId (restaurant), serviceId (business), or digitalId / allAccess (digital).

productId
string
required

Identifier of the product to add to the cart (ecommerce stores).

foodId
string

Identifier of the food item to add to the cart (restaurant stores).

serviceId
string

Identifier of the service to add to the cart (business stores).

variantId
string

Optional identifier of the product variant to add.

quantity
integer
default:1

Quantity of the product, food, or service to add. Defaults to 1.

Required range: x >= 1
selectedAddons
object[]

Optional add-on selections for food or service items.

digitalId
string

Identifier of the digital product to add (digital stores). Needs mode.

mode
enum<string>

How to buy the digital product: lifetime (permanent access, the product's pricing.oneTime) or pass (30 days, pricing.monthly). Required with digitalId.

Available options:
lifetime,
pass
allAccess
enum<boolean>

Add the store-wide all-access pass instead of one product. Cannot be combined with digitalId.

Available options:
true
autoRenew
boolean

The shopper ticked "Renew automatically". Only meaningful on pass lines (mode: "pass" or allAccess).

Response

Cart updated with the new item.

status
integer
required

HTTP status code returned by the API.

success
boolean
required

Indicates whether the request succeeded.

message
string
required

Human-readable response message.

data
object
required