Commerce · coupons
5 routes. Paths are relative to https://api.intersink.com/v1.
- GET/coupons/channels/{channelId}List the channel's coupons
- POST/coupons/channels/{channelId}Create a coupon
- PATCH/coupons/channels/{channelId}/{id}Update a coupon (incl. pause / resume)
- DELETE/coupons/channels/{channelId}/{id}Delete an unused coupon (a used one is archived)
- POST/coupons/channels/{channelId}/validateWhat a code takes off a cart (Public)
List the channel's coupons
GET/coupons/channels/{channelId}
Needs a signed-in user (Bearer token or access_token cookie).
Parameters
| Name | Type | Description |
|---|---|---|
| channelIdrequired | string, path | |
| page | number, query | Minimum 1. |
| limit | number, query | Minimum 1, maximum 100. |
| q | string, query | Search in the title/name |
| status | string, query | One 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
| Name | Type | Description |
|---|---|---|
| channelIdrequired | string, path |
Request body application/json
| Field | Type | Description |
|---|---|---|
| name | string | At most 120 characters. Example: "Welcome offer" |
| value | number | percent: 1–100. fixed: minor units (pence/cents). Minimum 0, maximum 10000000. |
| currency | string | For fixed amounts and minimums At least 3 characters, at most 3 characters. Example: "GBP" |
| min_order_minor | number | Minimum order, minor units Minimum 0, maximum 10000000. |
| max_discount_minor | number | Cap on a percent discount, minor units Minimum 1, maximum 10000000. |
| starts_at | string | |
| ends_at | string | |
| usage_limit | number | Total uses allowed Minimum 1, maximum 10000000. |
| per_customer_limit | number | Uses allowed per signed-in customer Minimum 1, maximum 1000. |
| coderequired | string | 3–40 letters, digits, - or _ (stored upper-case) Example: "WELCOME10" |
| kindrequired | string | One of: "percent", "fixed", "free_shipping". |
| status | string | One 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
| Name | Type | Description |
|---|---|---|
| channelIdrequired | string, path | |
| idrequired | number, path |
Request body application/json
| Field | Type | Description |
|---|---|---|
| name | string | At most 120 characters. Example: "Welcome offer" |
| value | number | percent: 1–100. fixed: minor units (pence/cents). Minimum 0, maximum 10000000. |
| currency | string | For fixed amounts and minimums At least 3 characters, at most 3 characters. Example: "GBP" |
| min_order_minor | number | Minimum order, minor units Minimum 0, maximum 10000000. |
| max_discount_minor | number | Cap on a percent discount, minor units Minimum 1, maximum 10000000. |
| starts_at | string | |
| ends_at | string | |
| usage_limit | number | Total uses allowed Minimum 1, maximum 10000000. |
| per_customer_limit | number | Uses allowed per signed-in customer Minimum 1, maximum 1000. |
| code | string | |
| kind | string | One of: "percent", "fixed", "free_shipping". |
| status | string | One 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
| Name | Type | Description |
|---|---|---|
| channelIdrequired | string, path | |
| idrequired | number, 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
| Name | Type | Description |
|---|---|---|
| channelIdrequired | string, path |
Request body application/json
| Field | Type | Description |
|---|---|---|
| coderequired | string | At most 40 characters. Example: "WELCOME10" |
| subtotal_minorrequired | number | Cart subtotal, minor units Minimum 0, maximum 10000000. |
| currency | string | At least 3 characters, at most 3 characters. Example: "GBP" |
Response
200. The payload in data is of type object.