Automatic Promotions (1.0)
Download OpenAPI specification:Download
Use this API to manage Automatic Promotions in NewStore, such as creating, retrieving, or updating promotions.
You can use these methods to create automatic promotions for specific products or for the whole cart, which are applied automatically during checkout in NewStore Associate App.
For a guide on how to use automatic promotions via NewStore Omnichannel Manager, see this guide. Also you can find additinal information in process documentation
DISCLAIMER: Coupon fields should not contain any PII, this information may be removed.
Get Promotion
Retrieves the specified automatic promotion by ID. To retrieve the promotion ID, use the list promotions API.
Authorizations:
path Parameters
id required | string The ID of the promotion. |
Responses
Response samples
- 200
- 404
- 500
{- "links": {
- "self": "/promotion/64357c41-cad8-4000-8000-d998be563098"
}, - "promotion": {
- "id": "64357c41-cad8-4000-8000-d998be563098",
- "name": "Black Friday Promo",
- "description": "Black Friday Promo",
- "validFrom": "2023-11-01T00:00:00",
- "validTo": "2023-12-01T00:00:00",
- "category": {
- "kind": "CartLevelPercentage",
- "discount": 10
}, - "active": true,
- "createdAt": "2023-04-11T00:00:00",
- "createdBy": "25dd570161b05f0cae353a56757f8495",
- "updatedAt": "2023-04-11T00:00:00",
- "updatedBy": "25dd570161b05f0cae353a56757f8495",
- "tenant": "dodici",
- "currencies": [
- {
- "code": "EUR",
- "minimumCartValue": 50
}
], - "stores": [
- "f9c7b6ec-b296-4eba-b083-c8b53d14407d"
], - "localizedTimezone": true,
- "exclusive": true,
- "segment": {
- "key": "type",
- "value": "gold member",
- "schema": 1
}, - "version": "a43a5a2d-1424-4c80-a252-992d489062eb"
}
}
Update Promotion
Updates the specified promotion with new information.The only property that cannot be updated is the category.
Authorizations:
path Parameters
id required | string The ID of the promotion. |
Request Body schema: application/json
Update promotion request.
name required | string The name of the promotion. |
validFrom required | string(?:^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}$)|(?:... The date the promotion becomes valid. If localizedTimezone is false, timezone can be indicated at the end of the string. |
validTo | string(?:^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}$)|(?:... The date the promotion becomes invalid. If localizedTimezone is false, timezone can be indicated at the end of the string. |
required | CartLevelPercentageCategory (object) or CartLevelFixedCategory (object) or ProductLevelPercentageCategory (object) or ProductLevelFixedCategory (object) or BogoPercentageCategory (object) or BogoFixedCategory (object) or BundlePercentageCategory (object) or BundleFixedCategory (object) or FreeShipping (object) The actual promotion kind. |
active | boolean Indicates whether the promotions is active or not. |
required | Array of objects (Currency) A list of conditions on currencies to satisfy in order for the promotion to be applied. |
stores | Array of strings Indicates in which stores the promotion can be used. A list of IDs states that the promotion can be used in the given stores while an empty array states that the promotion can be used in any store. |
localizedTimezone | boolean Optional, this property determines local timezone validity for the promotion. If true, UTC is assumed with no timezone required in "validFrom" and "validTo". If false, timezone must be specified in those fields. |
exclusive | boolean Indicates whether the promotion is exclusive or not. |
object or null (Segment) A customer segmentation. | |
version required | string A UUID representing the version of the promotion. |
Responses
Request samples
- Payload
{- "name": "Black Friday Promo",
- "description": "The Black Friday Promo",
- "validFrom": "2023-11-01T00:00:00",
- "validTo": "2023-12-01T00:00:00",
- "category": {
- "kind": "CartLevelPercentage",
- "discount": 10
}, - "active": true,
- "currencies": [
- {
- "code": "EUR",
- "minimumCartValue": 50
}
], - "stores": [
- "f9c7b6ec-b296-4eba-b083-c8b53d14407d"
], - "localizedTimezone": true,
- "exclusive": true,
- "segment": {
- "key": "type",
- "value": "gold member",
- "schema": 1
}, - "version": "a43a5a2d-1424-4c80-a252-992d489062eb"
}
Response samples
- 200
- 400
- 404
- 409
- 500
{- "links": {
- "self": "/promotion/64357c41-cad8-4000-8000-d998be563098"
}, - "promotion": {
- "id": "64357c41-cad8-4000-8000-d998be563098",
- "name": "Black Friday Promo",
- "description": "Black Friday Promo",
- "validFrom": "2023-11-01T00:00:00",
- "validTo": "2023-12-01T00:00:00",
- "category": {
- "kind": "CartLevelPercentage",
- "discount": 10
}, - "active": true,
- "createdAt": "2023-04-11T00:00:00",
- "createdBy": "25dd570161b05f0cae353a56757f8495",
- "updatedAt": "2023-04-11T00:00:00",
- "updatedBy": "25dd570161b05f0cae353a56757f8495",
- "tenant": "dodici",
- "currencies": [
- {
- "code": "EUR",
- "minimumCartValue": 50
}
], - "stores": [
- "f9c7b6ec-b296-4eba-b083-c8b53d14407d"
], - "localizedTimezone": true,
- "exclusive": true,
- "segment": {
- "key": "type",
- "value": "gold member",
- "schema": 1
}, - "version": "a43a5a2d-1424-4c80-a252-992d489062eb"
}
}
Create Promotion
Creates a specified automatic promotion.
Authorizations:
Request Body schema: application/json
Create promotion request.
name required | string The name of the promotion. |
validFrom required | string(?:^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}$)|(?:... The date the promotion becomes valid. If localizedTimezone is false, timezone can be indicated at the end of the string. |
validTo | string(?:^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}$)|(?:... The date the promotion becomes invalid. If localizedTimezone is false, timezone can be indicated at the end of the string. |
required | CartLevelPercentageCategory (object) or CartLevelFixedCategory (object) or ProductLevelPercentageCategory (object) or ProductLevelFixedCategory (object) or BogoPercentageCategory (object) or BogoFixedCategory (object) or BundlePercentageCategory (object) or BundleFixedCategory (object) or FreeShipping (object) The actual promotion kind. |
active | boolean Indicates whether the promotions is active or not. |
required | Array of objects (Currency) A list of conditions on currencies to satisfy in order for the promotion to be applied. |
stores | Array of strings Indicates in which stores the promotion can be used. A list of IDs states that the promotion can be used in the given stores while an empty array states that the promotion can be used in any store. |
localizedTimezone | boolean Optional, this property determines local timezone validity for the promotion. If true, UTC is assumed with no timezone required in "validFrom" and "validTo". If false, timezone must be specified in those fields. |
exclusive | boolean Indicates whether the promotion is exclusive or not. |
object or null (Segment) A customer segmentation. |
Responses
Request samples
- Payload
{- "name": "Black Friday Promo",
- "validFrom": "2023-11-01T00:00:00",
- "validTo": "2023-12-01T00:00:00",
- "category": {
- "kind": "CartLevelPercentage",
- "discount": 10
}, - "active": true,
- "currencies": [
- {
- "code": "EUR",
- "minimumCartValue": 50
}
], - "stores": [
- "f9c7b6ec-b296-4eba-b083-c8b53d14407d"
], - "localizedTimezone": true,
- "exclusive": true,
- "segment": {
- "key": "type",
- "value": "gold member",
- "schema": 1
}
}
Response samples
- 201
- 400
- 409
- 500
{- "links": {
- "self": "/promotion/64357c41-cad8-4000-8000-d998be563098"
}, - "promotion": {
- "id": "64357c41-cad8-4000-8000-d998be563098",
- "name": "Black Friday Promo",
- "description": "Black Friday Promo",
- "validFrom": "2023-11-01T00:00:00",
- "validTo": "2023-12-01T00:00:00",
- "category": {
- "kind": "CartLevelPercentage",
- "discount": 10
}, - "active": true,
- "createdAt": "2023-04-11T00:00:00",
- "createdBy": "25dd570161b05f0cae353a56757f8495",
- "updatedAt": "2023-04-11T00:00:00",
- "updatedBy": "25dd570161b05f0cae353a56757f8495",
- "tenant": "dodici",
- "currencies": [
- {
- "code": "EUR",
- "minimumCartValue": 50
}
], - "stores": [
- "f9c7b6ec-b296-4eba-b083-c8b53d14407d"
], - "localizedTimezone": true,
- "exclusive": true,
- "segment": {
- "key": "type",
- "value": "gold member",
- "schema": 1
}, - "version": "a43a5a2d-1424-4c80-a252-992d489062eb"
}
}
List Promotions
Retrieves all automatic promotions.
Authorizations:
query Parameters
count required | integer <= 150 The number of promotions to get at once. |
page required | integer >= 1 The page number. |
partial-category | boolean Default: true Example: partial-category=true This flag should be always present with |
Responses
Response samples
- 200
- 400
- 500
{- "items": [
- {
- "links": {
- "self": "/promotion/64357c41-cad8-4000-8000-d998be563098"
}, - "promotion": {
- "id": "64357c41-cad8-4000-8000-d998be563098",
- "name": "Black Friday Promo",
- "description": "Black Friday Promo",
- "validFrom": "2023-11-01T00:00:00",
- "validTo": "2023-12-01T00:00:00",
- "category": {
- "kind": "CartLevelPercentage",
- "discount": 10
}, - "active": true,
- "createdAt": "2023-04-11T00:00:00",
- "createdBy": "25dd570161b05f0cae353a56757f8495",
- "updatedAt": "2023-04-11T00:00:00",
- "updatedBy": "25dd570161b05f0cae353a56757f8495",
- "tenant": "dodici",
- "currencies": [
- {
- "code": "EUR",
- "minimumCartValue": 50
}
], - "stores": [
- "f9c7b6ec-b296-4eba-b083-c8b53d14407d"
], - "localizedTimezone": true,
- "exclusive": true,
- "segment": {
- "key": "type",
- "value": "gold member",
- "schema": 1
}, - "version": "a43a5a2d-1424-4c80-a252-992d489062eb"
}
}, - {
- "links": {
- "self": "/promotion/633e9b5e-983b-4000-8000-bdde1340e55f"
}, - "promotion": {
- "id": "633e9b5e-983b-4000-8000-bdde1340e55f",
- "name": "Promotion for hoodies",
- "description": "Promotion for hoodies",
- "validFrom": "2023-04-27T00:00:00",
- "validTo": "2023-04-30T23:59:59",
- "category": {
- "kind": "ProductLevelFixed",
- "includedCategories": [
- {
- "path": [
- "Shop",
- "Accessories"
]
}
], - "includedProducts": [ ],
- "excludedProducts": [ ],
- "shopId": "storefront-catalog-en",
- "locale": "en-us",
- "discounts": [
- {
- "amount": 50,
- "currency": "EUR"
}, - {
- "amount": 50,
- "currency": "USD"
}
]
}, - "active": false,
- "createdAt": "2023-04-27T13:15:55Z",
- "createdBy": "3227aa4cdff85694a7788450e3c269b2",
- "updatedAt": "2022-10-06T09:09:50Z",
- "updatedBy": "3227aa4cdff85694a7788450e3c269b2",
- "tenant": "dodici",
- "currencies": [
- {
- "code": "EUR",
- "minimumCartValue": 150
}, - {
- "code": "USD",
- "minimumCartValue": 150
}
], - "stores": [ ],
- "exclusive": true,
- "segment": {
- "key": "member",
- "value": "VIP",
- "schema": 1
}, - "version": "6255ca9a-a025-4846-826a-f69fd6da4917"
}
}
], - "links": {
- "next": "/promotion?count=2&page=1",
- "previous": null
}, - "pagination": {
- "count": 2,
- "page": 1,
- "total": 15
}
}
Search Promotions
Searchs for the specified promotions.
Authorizations:
query Parameters
count required | integer <= 150 The number of promotions to get at once. |
page required | integer >= 1 The page number. |
Request Body schema: application/json
Search promotion request.
name | string The name of the promotion. |
Array of kind (string) The promotion type. | |
validFrom | string^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$ The date the promotion becomes valid. |
validTo | string^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$ The date the promotion becomes invalid. |
active | boolean Indicates whether the promotions is active or not. |
segment | string Indicates the Key or Value of customer profile extended attribute. |
partial | boolean Default: false Partially returns the data of each promotion. |
Responses
Request samples
- Payload
{- "name": "promo",
- "kind": [
- "CartLevelPercentage",
- "ProductLevelFixed"
], - "validFrom": "2023-11-01T00:00:00Z",
- "validTo": "2023-12-01T00:00:00Z",
- "active": true,
- "segment": "member",
- "partial": false
}
Response samples
- 200
- 400
- 500
{- "items": [
- {
- "links": {
- "self": "/promotion/64357c41-cad8-4000-8000-d998be563098"
}, - "promotion": {
- "id": "64357c41-cad8-4000-8000-d998be563098",
- "name": "Black Friday Promo",
- "description": "Black Friday Promo",
- "validFrom": "2023-11-01T00:00:00",
- "validTo": "2023-12-01T00:00:00",
- "category": {
- "kind": "CartLevelPercentage",
- "discount": 10
}, - "active": true,
- "createdAt": "2023-04-11T00:00:00",
- "createdBy": "25dd570161b05f0cae353a56757f8495",
- "updatedAt": "2023-04-11T00:00:00",
- "updatedBy": "25dd570161b05f0cae353a56757f8495",
- "tenant": "dodici",
- "currencies": [
- {
- "code": "EUR",
- "minimumCartValue": 50
}
], - "stores": [
- "f9c7b6ec-b296-4eba-b083-c8b53d14407d"
], - "localizedTimezone": true,
- "exclusive": true,
- "segment": {
- "key": "type",
- "value": "gold member",
- "schema": 1
}, - "version": "a43a5a2d-1424-4c80-a252-992d489062eb"
}
}, - {
- "links": {
- "self": "/promotion/633e9b5e-983b-4000-8000-bdde1340e55f"
}, - "promotion": {
- "id": "633e9b5e-983b-4000-8000-bdde1340e55f",
- "name": "Promotion for hoodies",
- "description": "Promotion for hoodies",
- "validFrom": "2023-04-27T00:00:00",
- "validTo": "2023-04-30T23:59:59",
- "category": {
- "kind": "ProductLevelFixed",
- "includedCategories": [
- {
- "path": [
- "Shop",
- "Accessories"
]
}
], - "includedProducts": [ ],
- "excludedProducts": [ ],
- "shopId": "storefront-catalog-en",
- "locale": "en-us",
- "discounts": [
- {
- "amount": 50,
- "currency": "EUR"
}, - {
- "amount": 50,
- "currency": "USD"
}
]
}, - "active": false,
- "createdAt": "2023-04-27T13:15:55Z",
- "createdBy": "3227aa4cdff85694a7788450e3c269b2",
- "updatedAt": "2022-10-06T09:09:50Z",
- "updatedBy": "3227aa4cdff85694a7788450e3c269b2",
- "tenant": "dodici",
- "currencies": [
- {
- "code": "EUR",
- "minimumCartValue": 150
}, - {
- "code": "USD",
- "minimumCartValue": 150
}
], - "stores": [ ],
- "exclusive": true,
- "segment": {
- "key": "member",
- "value": "VIP",
- "schema": 1
}, - "version": "6255ca9a-a025-4846-826a-f69fd6da4917"
}
}
], - "links": {
- "next": "/promotion?count=2&page=1",
- "previous": null
}, - "pagination": {
- "count": 2,
- "page": 1,
- "total": 15
}
}