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:
Request Body schema: application/json
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 |
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 |
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 |
Responses
Request samples
- Payload
{- "description": "half-price",
- "amount": 50,
- "currency": "EUR",
- "scope": "order",
- "type": "fixed",
- "priority": 10,
- "label": "BOGOF2910"
}
Response samples
- 201
- 400
{- "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": [
- "p0001",
- "p0002"
]
}
List discount rules Deprecated
Retrieves a list of discount rules.
Authorizations:
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 |
Responses
Response samples
- 200
- 400
{- "field_ranges": {
- "amount": {
- "max": 100000,
- "type": "range"
}, - "created_at": {
- "max": 1645094337117,
- "min": 1508419644523,
- "type": "range"
}, - "minimum_order_amount": {
- "max": 10000,
- "type": "range"
}, - "scope": {
- "type": "enum",
- "values": [
- "item",
- "order",
- "shipping"
]
}
}, - "items": [
- {
- "amount": 100,
- "categories": [ ],
- "created_at": "2018-02-13T07:23:48.687284Z",
- "currency": "USD",
- "description": "Free Shipping",
- "id": "00a15514-8083-474f-8564-e60d1bbf3020",
- "items": [ ],
- "label": "Discount Rule Free Shipping 705",
- "minimum_order_amount": 0,
- "priority": 59,
- "scope": "shipping",
- "shipping_price_limit": 0,
- "type": "percentage",
- "updated_at": "2018-02-13T07:23:48.687284Z"
}, - {
- "amount": 20,
- "categories": [ ],
- "created_at": "2020-04-17T10:47:18.629895Z",
- "currency": "USD",
- "description": "NewStore Coupon",
- "id": "00c3d6d4-8999-4e42-8dc1-cd16edd579bc",
- "items": [ ],
- "label": "NS_Coupons_000123",
- "minimum_order_amount": 0,
- "priority": 0,
- "scope": "item",
- "shipping_price_limit": 0,
- "type": "percentage",
- "updated_at": "2020-04-17T10:47:18.629895Z"
}
], - "pagination_info": {
- "count": 50,
- "offset": 0,
- "total": 449
}
}
Get discount rule Deprecated
Retrieves the discount rule with the given ID.
Authorizations:
path Parameters
id required | string The identifier of the discount rule. Use the List discount rules method to retrieve the ID. |
Responses
Response samples
- 200
{- "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": [
- "p0001",
- "p0002"
]
}
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:
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 |
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 |
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 |
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
- Payload
{- "items": [
- "p0001",
- "p0002"
], - "minimum_order_amount": 10
}
Response samples
- 200
- 400
{- "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": [
- "p0001",
- "p0002"
]
}
Delete discount rule Deprecated
Deletes discount rule with the given ID.
Authorizations:
path Parameters
id required | string The identifier of the discount rule. Use the List discount rules method to retrieve the ID. |