Skip to content

Add coupon to cart

POST
/cms/customer/coupon/add
curl --request POST \
--url https://api.example.com/cms/customer/coupon/add \
--header 'API-Key: <API-Key>' \
--header 'Content-Type: application/json' \
--data '{ "id": "example", "coupon_id": 1 }'

POST /customer/coupon/add

Media typeapplication/json
object
id
required

Cart ID

string
coupon_id
required

Coupon ID

integer

Example generated

{
"id": "example",
"coupon_id": 1
}

Coupon added to cart

Media typeapplication/json
object
coupon_expiry_date
string format: date-time
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

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

Settings. Returned as a JSON-encoded string (e.g. “[]” when empty), an object keyed by setting key (each {name, value, type}), or an empty array when no settings are stored

One of:
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
number format: float
shipping
number format: float
tax
number format: float
discount
number format: float
total
number format: float

Example

{
"data": {
"items": [
{
"item": {
"settings": "[]",
"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"
}
]
}
}

Bad Request