Automatic Promotions (v1.0)
Download OpenAPI specification:Download
Use this API to manage automatic promotions in NewStore.. For a guide on how to use automatic promotions via NewStore Omnichannel Manager, see this guide.
Use this resource 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. This includes creating promotions for both, percentage or fixed amount discounts.
For more information on automatic promotions, see the process documentation or this guide.
Create promotion
Use this method to create an automatic promotion. You can create promotions for specific products or for the whole cart in the order.
You can create promotions that apply percentage discounts or fixed amount discounts on specified products or the cart. For more information, see the process documentation or this guide.
Authorizations:
header Parameters
x-request-id | string |
Request Body schema: application/json
a new promotion
active | boolean Indicates whether the promotion is active or not |
name required | string The name of the promotion |
description | string |
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. |
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. |
Array of objects | |
required | object |
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. |
Responses
Request samples
- Payload
{- "name": "Cart level percentage promotion",
- "description": "A promotion with type CartLevelPercentage",
- "localizedTimezone": false,
- "validFrom": "2022-01-01T00:00:00+01:00",
- "validTo": "2022-04-01T00:00:00+01:00",
- "category": {
- "kind": "CartLevelPercentage",
- "discount": 10
}, - "currencies": [
- {
- "code": "EUR",
- "minimumCartValue": 10
}
]
}
Response samples
- 201
- 400
- 500
{- "promotion": {
- "id": "7c9f2605-9fb3-5444-8fee-47fe51608efe",
- "active": false,
- "name": "Promotion for hoodies",
- "description": "A promotion for hoodies",
- "localizedTimezone": false,
- "validFrom": "2022-01-01T00:00:00+01:00",
- "validTo": "2022-04-01T00:00:00+01:00",
- "category": {
- "kind": "CartLevelPercentage",
- "discount": 10
}, - "currencies": [
- {
- "code": "EUR",
- "minimumCartValue": 10
}
], - "createdAt": "2021-12-31T00:00:00",
- "updatedAt": "2021-12-31T00:00:00",
- "createdBy": "store-employee-1",
- "updatedBy": "store-employee-1",
- "tenant": "newstore",
- "stores": [ ],
- "version": "2"
}, - "links": {
- "self": "/promotion/7c9f2605-9fb3-5444-8fee-47fe51608efe"
}
}
List promotions
Retrieves all automatic promotions created for your business via NewStore Omnichannel Manager or the create promotion method.
Authorizations:
query Parameters
count required | integer The number of promotions to get at once |
page required | integer The page number |
header Parameters
x-request-id | string |
Responses
Response samples
- 200
- 400
- 500
{- "items": [
- {
- "promotion": {
- "id": "7c9f2605-9fb3-5444-8fee-47fe51608efe",
- "active": true,
- "name": "Promotion for hoodies",
- "description": "A promotion for hoodies",
- "localizedTimezone": false,
- "validFrom": "2022-01-01T00:00:00+01:00",
- "validTo": "2022-04-01T00:00:00+01:00",
- "category": {
- "kind": "CartLevelPercentage",
- "discount": 5
}, - "currencies": [
- {
- "code": "EUR",
- "minimumCartValue": 10
}
], - "createdAt": "2021-12-31T00:00:00",
- "updatedAt": "2021-12-31T00:00:00",
- "createdBy": "store-employee-1",
- "updatedBy": "store-employee-1",
- "tenant": "newstore",
- "version": "2"
}, - "links": {
- "self": "/promotion/7c9f2605-9fb3-5444-8fee-47fe51608efe"
}
}, - {
- "promotion": {
- "id": "6cxtew5ec-9fb3-5478-9cre6-8ue3289y",
- "active": false,
- "name": "Promotion for t-shirts",
- "description": "A promotion for t-shirts",
- "localizedTimezone": false,
- "validFrom": "2022-01-01T00:00:00+01:00",
- "validTo": "2022-04-01T00:00:00+01:00",
- "category": {
- "kind": "CartLevelPercentage",
- "discount": 3
}, - "currencies": [
- {
- "code": "EUR",
- "minimumCartValue": 5
}
], - "createdAt": "2021-11-01T00:00:00",
- "updatedAt": "2021-11-01T00:00:00",
- "createdBy": "store-employee-2",
- "updatedBy": "store-employee-2",
- "tenant": "newstore",
- "stores": [ ],
- "version": "1"
}, - "links": {
- "self": "/promotion/6cxtew5ec-9fb3-5478-9cre6-8ue3289y"
}
}
], - "links": {
- "next": "/promotion/2189ey2-b624-7654-2v34-bd4672f425rfe",
- "previous": ""
}, - "pagination": {
- "count": 2,
- "page": 1,
- "total": 3
}
}
Get promotion
Retrieves the specified automatic promotion by ID. To retrieve the promotion ID, use the List promotions method.
Authorizations:
path Parameters
id required | string |
header Parameters
x-request-id | string |
Responses
Response samples
- 200
- 404
- 500
{- "promotion": {
- "id": "7c9f2605-9fb3-5444-8fee-47fe51608efe",
- "active": false,
- "name": "Promotion for hoodies",
- "description": "A promotion for hoodies",
- "localizedTimezone": false,
- "validFrom": "2022-01-01T00:00:00+01:00",
- "validTo": "2022-04-01T00:00:00+01:00",
- "category": {
- "kind": "CartLevelPercentage",
- "discount": 10
}, - "currencies": [
- {
- "code": "EUR",
- "minimumCartValue": 10
}
], - "createdAt": "2021-12-31T00:00:00",
- "updatedAt": "2021-12-31T00:00:00",
- "createdBy": "store-employee-1",
- "updatedBy": "store-employee-1",
- "tenant": "newstore",
- "stores": [ ],
- "version": "1"
}, - "links": {
- "self": "/promotion/7c9f2605-9fb3-5444-8fee-47fe51608efe"
}
}
Update promotion
Updates the specified promotion with new information. Use this method to switch
a promotion to an active
state or change the currencies that the promotion can be applied
to, and so on. Given the nature of the update via the PUT method the complete object
has to be passed. The only property that cannot be updated is the category.
To retrieve the promotion ID, use the List promotions method.
Authorizations:
path Parameters
id required | string |
header Parameters
x-request-id | string |
Request Body schema: application/json
The updated promotion
tenant | string |
version required | string |
active | boolean Indicates whether the promotion is active or not |
name | string The name of the promotion |
description | string |
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. |
validFrom | 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. |
Array of objects | |
object | |
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. |
Responses
Request samples
- Payload
{- "id": "62839b62-80ff-4000-8000-01b47275b241",
- "name": "My Promotion",
- "description": "My Promotion Description",
- "localizedTimezone": false,
- "validFrom": "2022-01-01T00:00:00+01:00",
- "validTo": "2022-04-01T00:00:00+01:00",
- "category": [
- {
- "kind": "CartLevelPercentage",
- "discount": 10
}
], - "active": true,
- "currencies": [
- {
- "code": "EUR",
- "minimumCartValue": "0.00000"
}
], - "stores": [ ],
- "version": "6f419b7b-1529-4c33-a5ba-a07762850db1"
}
Response samples
- 200
- 400
- 404
- 409
- 500
{- "promotion": {
- "id": "7c9f2605-9fb3-5444-8fee-47fe51608efe",
- "active": false,
- "name": "Promotion for hoodies",
- "description": "A promotion for hoodies",
- "localizedTimezone": false,
- "validFrom": "2022-01-01T00:00:00+01:00",
- "validTo": "2022-04-01T00:00:00+01:00",
- "category": {
- "kind": "CartLevelPercentage",
- "discount": 10
}, - "currencies": [
- {
- "code": "EUR",
- "minimumCartValue": 10
}
], - "createdAt": "2021-12-31T00:00:00",
- "updatedAt": "2021-12-31T00:00:00",
- "createdBy": "store-employee-1",
- "updatedBy": "store-employee-1",
- "tenant": "newstore",
- "stores": [ ],
- "version": "2"
}, - "links": {
- "self": "/promotion/7c9f2605-9fb3-5444-8fee-47fe51608efe"
}
}