Add new promotion
NB: If you want to add discount price to a specific product use discountprice on Product instead.
Create a new promotion that results in an automatic discount when matching products are put in the POS cart.
The automatic assignment of discounts is based product filters (explained in more detail below). When these filters match, the promotion triggers an action resulting in some kind of discount presentend in the cart. Currently, actions come in two flavors: single product discounts and bundle discounts. How the promotion will trigger depends on this flavor.
Single product discounts (percentage, adjustPriceBy, percentageByCostprice, totalPriceUnit): Here, a single product gets discount by some amount. The filters can match against productnos, brands and tags.
Each promotion has a required name which shown in the cart when the discount is given. description is optional and designed only for humans to read. It is only shown in the settings. active can be used to disable promotions until they are ready. Promotions will also only be considered active when today's date is inside the startdate-enddate-range. If enddate is null, the promotion is considered to run forever.
Product filters are inclusive by nature. In the future, excluding filters will be added as well. Filters have an attribute and a value. The attribute can be various attributes of a product, like tag and productno. For instance, to give a discount on all bikes with tag Bike, see the example below). The value can be a list of values in which case, if either of the values match, the filter matches. And if either of the filters matches, the promotion will trigger (in case of single product discounts).
The filters for bundle discounts currently needs to be very specific: A single filter with attribute = productno and value = list of productnos.
In the future, it will be possible to filter based on customer attributes as well, such that specific customers can get certain discounts.
Request
- Base URLhttps://api.c1st.com/api
- URLhttps://api.c1st.com/api/promotions
- AuthHTTP bearer
Request body
Example request
{
"content": {
"id": 123,
"name": "Summer discount",
"description": "10% on all bikes in the summer.",
"deleted": 1,
"startdate": "2019-01-01 12:00:00",
"enddate": "2019-02-01 12:00:00",
"minproducts": 1,
"productfilters": [
{
"attribute": "tag",
"value": "Bike"
}
],
"customerfilters": [
{
"attribute": "tag",
"value": [
"1",
"2",
"3"
]
}
],
"serviceplanfilters": [
{
"attribute": "tag",
"value": [
"1",
"2",
"3"
]
}
],
"articles": [
{
"productno": "456",
"quantity": 5
}
],
"action": {
"type": "percentage",
"amount": 10
}
}
}Response
Ok
Example response
{
"id": 123
}Changes
No recorded changes to this operation across all 1 revision of this API.