Preview. This site is still being built. Features, prices and terms may change, and nothing here is a binding offer. Read the preview notice

Preview. Still being built; nothing here is a binding offer. Details

Commerce · coupons

5 routes. Paths are relative to https://api.intersink.com/v1.

All groups

List the channel's coupons

GET/coupons/channels/{channelId}

Needs a signed-in user (Bearer token or access_token cookie).

Parameters

NameTypeDescription
channelIdrequiredstring, path
pagenumber, queryMinimum 1.
limitnumber, queryMinimum 1, maximum 100.
qstring, querySearch in the title/name
statusstring, queryOne of: "active", "paused", "archived".

Response

200. The payload in data is not described in the spec yet.

Create a coupon

POST/coupons/channels/{channelId}

Needs a signed-in user (Bearer token or access_token cookie).

Parameters

NameTypeDescription
channelIdrequiredstring, path

Request body application/json

FieldTypeDescription
namestringAt most 120 characters. Example: "Welcome offer"
valuenumberpercent: 1–100. fixed: minor units (pence/cents). Minimum 0, maximum 10000000.
currencystringFor fixed amounts and minimums At least 3 characters, at most 3 characters. Example: "GBP"
min_order_minornumberMinimum order, minor units Minimum 0, maximum 10000000.
max_discount_minornumberCap on a percent discount, minor units Minimum 1, maximum 10000000.
starts_atstring
ends_atstring
usage_limitnumberTotal uses allowed Minimum 1, maximum 10000000.
per_customer_limitnumberUses allowed per signed-in customer Minimum 1, maximum 1000.
coderequiredstring3–40 letters, digits, - or _ (stored upper-case) Example: "WELCOME10"
kindrequiredstringOne of: "percent", "fixed", "free_shipping".
statusstringOne of: "active", "paused", "archived".

Response

201. The payload in data is of type object.

Update a coupon (incl. pause / resume)

PATCH/coupons/channels/{channelId}/{id}

Needs a signed-in user (Bearer token or access_token cookie).

Parameters

NameTypeDescription
channelIdrequiredstring, path
idrequirednumber, path

Request body application/json

FieldTypeDescription
namestringAt most 120 characters. Example: "Welcome offer"
valuenumberpercent: 1–100. fixed: minor units (pence/cents). Minimum 0, maximum 10000000.
currencystringFor fixed amounts and minimums At least 3 characters, at most 3 characters. Example: "GBP"
min_order_minornumberMinimum order, minor units Minimum 0, maximum 10000000.
max_discount_minornumberCap on a percent discount, minor units Minimum 1, maximum 10000000.
starts_atstring
ends_atstring
usage_limitnumberTotal uses allowed Minimum 1, maximum 10000000.
per_customer_limitnumberUses allowed per signed-in customer Minimum 1, maximum 1000.
codestring
kindstringOne of: "percent", "fixed", "free_shipping".
statusstringOne of: "active", "paused", "archived".

Response

200. The payload in data is of type object.

Delete an unused coupon (a used one is archived)

DELETE/coupons/channels/{channelId}/{id}

Needs a signed-in user (Bearer token or access_token cookie).

Parameters

NameTypeDescription
channelIdrequiredstring, path
idrequirednumber, path

Response

200. The payload in data is of type object.

What a code takes off a cart (Public)

POST/coupons/channels/{channelId}/validate

Public: no sign-in needed.

Shopper check before paying. Rate-limited: codes must not be guessable by brute force.

Parameters

NameTypeDescription
channelIdrequiredstring, path

Request body application/json

FieldTypeDescription
coderequiredstringAt most 40 characters. Example: "WELCOME10"
subtotal_minorrequirednumberCart subtotal, minor units Minimum 0, maximum 10000000.
currencystringAt least 3 characters, at most 3 characters. Example: "GBP"

Response

200. The payload in data is of type object.