Skip to main content

Deprecated Discount Rule API (v0)

Download OpenAPI specification:Download

Important: This API is now deprecated and will not be available anymore from June 15th, 2023 onwards.

To create a discount, use the Manage coupons resource instead or use Omnichannel Manager to create coupons.

Create discount rule Deprecated

Creates a discount rule.

Important: Ensure that you specify the value of the amount property correctly, according to the specified currency. For example, if the currency is specified as USD and the product price (amount) has more than 2 decimal places, it is considered as invalid by the platform.

For more information, see pricing dependencies on currency.

Authorizations:
newStoreAccessToken
Request Body schema: application/json
One of
label
required
string non-empty

Unique name of the discount rule. The value is trimmed before it is stored.

description
string non-empty

Description of the discount rule. The value is trimmed before it is stored.

scope
required
string
Enum: "order" "item" "shipping"

Scope of the discount to be applied on, the whole order value, individual item's value or the shipping costs. In case of item scope at least one item or category identifier has to be specified in the list of items or categories.

currency
required
string = 3 characters

The currency code of the amount property (in case of a fixed discount) as well as the minimum_order_amount. The currency of the discount rule and the order that it should be applied on must match.

priority
integer >= 0
Default: 0

Defines the priority in which the discount rules are applied. Higher values mean higher priority.

minimum_order_amount
number >= 0

Minimum order total value in the given currency before the discount rule can be applied.

shipping_price_limit
number >= 0

Shipping price limit, i.e. do not apply this shipping discount rule to shipping options with prices higher than this limit

type
required
string
Value: "fixed"
amount
required
number >= 0

Fixed amount in the given currency to be applied

items
Array of strings

A list of product IDs. Each item included in this list is discounted by the provided amount upon checkout. The list is only taken into account for discount rules with scope item

categories
Array of strings

A list of category identifiers. Each item belonging to a category specified in this list is discounted by the provided amount upon checkout. The list is only taken into account for discount rules with scope item

Responses

Request samples

Content type
application/json
Example
{
  • "description": "half-price",
  • "amount": 50,
  • "currency": "EUR",
  • "scope": "order",
  • "type": "fixed",
  • "priority": 10,
  • "label": "BOGOF2910"
}

Response samples

Content type
application/json
{
  • "amount": 30,
  • "created_at": "2018-10-26T09:42:30.869Z",
  • "currency": "EUR",
  • "description": "30% Cyber Month",
  • "id": "467ad6df-eb07-4288-b8ed-ce0e5b224552",
  • "label": "30%today",
  • "minimum_order_amount": 10,
  • "priority": 10,
  • "scope": "order",
  • "shipping_price_limit": 0,
  • "type": "percentage",
  • "updated_at": "2018-10-26T09:42:30.869Z",
  • "items": [
    ]
}

List discount rules Deprecated

Retrieves a list of discount rules.

Authorizations:
newStoreAccessToken
query Parameters
labels
Array of strings <= 20 items unique

List of labels to filter discount rules.

advanced_search
string

Any non-empty value enables advanced search with sorting, filtering and full-text queries. If used, fields items and categories will be excluded from discount rule item in the response.

Responses

Response samples

Content type
application/json
Example
{
  • "field_ranges": {
    },
  • "items": [
    ],
  • "pagination_info": {
    }
}

Get discount rule Deprecated

Retrieves the discount rule with the given ID.

Authorizations:
newStoreAccessToken
path Parameters
id
required
string

The identifier of the discount rule. Use the List discount rules method to retrieve the ID.

Responses

Response samples

Content type
application/json
{
  • "amount": 30,
  • "created_at": "2018-10-26T09:42:30.869Z",
  • "currency": "EUR",
  • "description": "30% Cyber Month",
  • "id": "467ad6df-eb07-4288-b8ed-ce0e5b224552",
  • "label": "30%today",
  • "minimum_order_amount": 10,
  • "priority": 10,
  • "scope": "order",
  • "shipping_price_limit": 0,
  • "type": "percentage",
  • "updated_at": "2018-10-26T09:42:30.869Z",
  • "items": [
    ]
}

Update discount rule Deprecated

Updates certain fields in the specified discount rule.

Important: Ensure that you specify the value of the amount property correctly, according to the specified currency. For example, if the currency is specified as USD and the product price (amount) has more than 2 decimal places, it is considered as invalid by the platform.

For more information, see pricing dependencies on currency.

Authorizations:
newStoreAccessToken
path Parameters
id
required
string

The identifier of the discount rule. Use the List discount rules method to retrieve the ID.

Request Body schema: application/json
label
string non-empty

Unique name of the discount rule. The value is trimmed before it is stored.

description
string non-empty

Description of the discount rule. The value is trimmed before it is stored.

scope
string
Enum: "order" "item" "shipping"

Scope of the discount to be applied on, the whole order value, individual item's value or the shipping costs. In case of item scope at least one item or category identifier has to be specified in the list of items or categories.

type
string
Enum: "fixed" "percentage"
amount
number >= 0

Fixed amount in the given currency or percentage to be applied

priority
integer >= 0
Default: 0

Defines the priority in which the discount rules are applied. Higher values mean higher priority.

minimum_order_amount
number >= 0

Minimum order total value in the given currency before the discount rule can be applied.

shipping_price_limit
number >= 0

Shipping price limit, i.e. do not apply this shipping discount rule to shipping options with prices higher than this limit

items
Array of strings

A list of product IDs. Each item included in this list is discounted by the provided amount upon checkout. The list is only taken into account for discount rules with scope item

categories
Array of strings

A list of category identifiers. Each item belonging to a category specified in this list is discounted by the provided amount upon checkout. The list is only taken into account for discount rules with scope item

currency
string = 3 characters

The currency code of the amount property (in case of a fixed discount) as well as the minimum_order_amount. The currency of the discount rule and the order that it should be applied on must match.

Responses

Request samples

Content type
application/json
{
  • "items": [
    ],
  • "minimum_order_amount": 10
}

Response samples

Content type
application/json
{
  • "amount": 30,
  • "created_at": "2018-10-26T09:42:30.869Z",
  • "currency": "EUR",
  • "description": "30% Cyber Month",
  • "id": "467ad6df-eb07-4288-b8ed-ce0e5b224552",
  • "label": "30%today",
  • "minimum_order_amount": 10,
  • "priority": 10,
  • "scope": "order",
  • "shipping_price_limit": 0,
  • "type": "percentage",
  • "updated_at": "2018-10-26T09:42:30.869Z",
  • "items": [
    ]
}

Delete discount rule Deprecated

Deletes discount rule with the given ID.

Authorizations:
newStoreAccessToken
path Parameters
id
required
string

The identifier of the discount rule. Use the List discount rules method to retrieve the ID.

Responses