Skip to content

Set item quantity in cart

POST
/cms/customer/cart/set_quantity
curl --request POST \
--url https://api.example.com/cms/customer/cart/set_quantity \
--header 'API-Key: <API-Key>' \
--header 'Content-Type: application/json' \
--data '{ "id": "example", "itemId": 1, "quantity": 1 }'
Media typeapplication/json
object
id
string
itemId
integer
quantity
integer

Example generated

{
"id": "example",
"itemId": 1,
"quantity": 1
}

Cart updated

Media typeapplication/json
object
data
Cart

API representation of a shopping cart

object
id

Cart ID

string
items

Cart items

Array<object>
object
item
Pricing Tier

API representation of an ecommerce pricing tier (product item)

object
id

Item ID

description

Description

string
productId

Product ID

product

Product name

string
price

Price

sale_price

The price it sells at today: its timed offer’s price while one runs, otherwise price

currency

Currency

string
available

Available

item_order

Item order

shippable

Shippable

weight

Weight

installments

Installments

oncePerUser

Once per user

isUpgrade

Is upgrade

upgradeType

Upgrade type

string
nullable
upgradeFrom

Upgrade from

string
upgradeExcludeItems

Upgrade exclude items

string
nullable
upgradePriceWeb

Upgrade price web

upgradePriceMobile

Upgrade price mobile

settings

Field values, keyed by field key (each {name, value, type}), e.g. {“size”: {“name”: “Size”, “value”: “large”, “type”: “list”}}: the same keys the product search takes in settings; an empty array when there are none

One of:
object
key
additional properties
object
name
string
value
string
type
string
hasImage

Has image

additional_label_1

Additional label 1

string
nullable
additional_label_2

Additional label 2

string
nullable
additional_label_3

Additional label 3

string
nullable
diameter

Diameter

length

Length

depth

Depth

width

Width

recurrent

Recurrent

recurrentPrice

Recurrent price

recurrentStart

Recurrent start

string
recurrentSchedule

Recurrent schedule

string
sku

SKU

string
prices

Prices per currency code, or an empty array when none

One of:
object
key
additional properties
object
price
One of:
string
recurrentPrice
One of:
string
stock_enabled

Stock enabled

stock_available

Stock available

allow_backorder

Whether orders are accepted when out of stock

packageQuantity

Package quantity

relatedItems

Related items

Array<object>
object
images

Images (attachments)

Array<object>
object
id
string
name
string
description
string
url

High resolution URL

string
url_original
string
url_thumbnail
string
focal
string
image_width
integer
nullable
image_height
integer
nullable
video

Video (only for video attachments)

object
type
string
duration

Duration (only when present in metadata)

integer
files

Files (attachments)

Array<object>
object
id
string
name
string
description
string
url
string
type
string
duration

Duration (only when present in metadata)

integer
product_details

Product details. Deprecated to avoid circular references. Use productId instead.

object
translations

Translations

action_data

Action data to be executed when a pricing tier is bought

Array<object>
nullable
object
function
string
param
string
group
string
action_data_renew

Action data to be executed when a pricing tier is bought as a renewal

Array<object>
nullable
object
function
string
param
string
group
string
quantity
integer
price

Unit price: the product item’s numeric string price, or a number when priced in the cart currency

One of:
string
prices

Cart price matrix

object
subtotal

Items before the discount, without VAT. subtotal - discount + tax + shipping = total.

number format: float
shipping
number format: float
tax

VAT included in the total, not added to it. 0 unless a VAT country is given (vat_country).

number format: float
discount

Coupon discount without VAT. A percentage coupon takes that share of the subtotal; a flat coupon comes off the total, and this is that amount less its VAT.

number format: float
total
number format: float

Example

{
"data": {
"items": [
{
"item": {
"prices": {
"ZAR": {
"price": "1",
"recurrentPrice": "1"
}
},
"images": [
{
"id": "4",
"name": "watermarked",
"focal": "50% 50%",
"image_width": 654,
"image_height": 529,
"type": "image"
}
],
"files": [
{
"id": "5",
"type": "file"
}
],
"translations": {
"en": {
"description": "Description text",
"label1": "Label 1",
"label2": "Label 2",
"label3": "Label 3"
}
},
"action_data": [
{
"function": "registerSubscription",
"param": "365",
"group": "subscription"
}
],
"action_data_renew": [
{
"function": "registerSubscription",
"param": "365",
"group": "subscription"
}
]
},
"price": "23"
}
]
}
}

Invalid request