snabble Promotions API (v1)
Download OpenAPI specification:Download
All endpoints require the Authorization
header to be set with a valid JWT token for the respective environment.
Retrieve active configuration
Retrieves the currently active promotion configurations for the project
Authorizations:
path Parameters
projectID required | string (ProjectID) The identifier for a particular project. |
Responses
Response samples
- 200
- default
{- "rounding": {
- "mode": "up",
- "precision": 2
}, - "ranks": [
- {
- "id": "manual_discount",
- "evaluationMode": "applyAll"
}, - {
- "id": "manual_discount_control",
- "evaluationMode": "applyAll"
}, - {
- "id": "article_promotion",
- "evaluationMode": "applyAll"
}, - {
- "id": "article_group",
- "evaluationMode": "applyAll"
}, - {
- "id": "receipt_promotion",
- "evaluationMode": "selectBest"
}
], - "groups": [
- {
- "id": "",
- "condition": null,
- "rules": [
- {
- "id": "buy-6-get-one-free",
- "rankID": "article_promotion",
- "condition": {
- "type": "and",
- "children": [
- {
- "type": "isCurrentlyActive",
- "args": {
- "from": "2021-02-25T00:00:00+01:00",
- "to": "2021-03-04T00:00:00+01:00"
}
}, - {
- "type": "hasSKU",
- "args": {
- "equals": "1200"
}
}, - {
- "type": "amountGreaterOrEqual",
- "args": {
- "value": "6"
}
}
]
}, - "actions": [
- {
- "type": "addLineItemDiscount",
- "args": {
- "absolute": true,
- "amount": "6",
- "isMultiusable": true,
- "name": "Buy 6 get 1 free",
- "requiredAmount": "6",
- "value": "1"
}
}
]
}, - {
- "id": "cart-discount-in-some-shop",
- "rankID": "receipt_promotion",
- "condition": {
- "type": "and",
- "children": [
- {
- "type": "isCurrentlyActive",
- "args": {
- "from": "2021-03-28T00:00:00+01:00",
- "to": "2021-03-29T00:00:00+02:00"
}
}, - {
- "type": "totalGreaterThanOrEqual",
- "args": {
- "value": "50"
}
}, - {
- "type": "hasExternalShopID",
- "args": {
- "oneOf": [
- "12",
- "13",
- "14"
]
}
}
]
}, - "actions": [
- {
- "type": "addCartDiscount",
- "args": {
- "absolute": true,
- "isMultiusable": true,
- "name": "10 Euro cart discount in some shops",
- "value": "10"
}
}
]
}, - {
- "id": "25-percent-discount-on-some-products-in-one-shop",
- "rankID": "article_group",
- "condition": {
- "type": "and",
- "children": [
- {
- "type": "isCurrentlyActive",
- "args": {
- "from": "2021-03-27T00:00:00+01:00",
- "to": "2021-03-28T00:00:00+01:00"
}
}, - {
- "type": "hasSKU",
- "args": {
- "oneOf": [
- "1234",
- "1235",
- "1236"
]
}
}, - {
- "type": "hasExternalShopID",
- "args": {
- "oneOf": [
- "200"
]
}
}
]
}, - "actions": [
- {
- "type": "addLineItemDiscount",
- "args": {
- "absolute": false,
- "amount": "1",
- "isMultiusable": true,
- "name": "25 percent off on these products",
- "value": "25"
}
}
]
}, - {
- "id": "cart-discount-with-coupon",
- "rankID": "receipt_promotion",
- "condition": {
- "type": "and",
- "children": [
- {
- "type": "isCurrentlyActive",
- "args": {
- "from": "2021-04-29T00:00:00+02:00",
- "to": "2041-07-01T00:00:00+02:00"
}
}, - {
- "type": "hasCouponCode",
- "args": {
- "equals": "1983958235"
}
}, - {
- "type": "totalGreaterThanOrEqual",
- "args": {
- "value": "20"
}
}
]
}, - "actions": [
- {
- "type": "addCartDiscount",
- "args": {
- "absolute": false,
- "isMultiusable": true,
- "name": "Coupon 10% Discount (>20)",
- "value": "10"
}
}, - {
- "type": "redeemCouponCode",
- "args": {
- "code": "1983958235"
}
}
]
}, - {
- "id": "3-euro-cart-discount-with-coupon",
- "rankID": "receipt_promotion",
- "condition": {
- "type": "and",
- "children": [
- {
- "type": "isCurrentlyActive",
- "args": {
- "from": "2021-04-29T00:00:00+02:00",
- "to": "2041-07-01T00:00:00+02:00"
}
}, - {
- "type": "hasCouponCode",
- "args": {
- "equals": "234235235"
}
}
]
}, - "actions": [
- {
- "type": "addCartDiscount",
- "args": {
- "absolute": true,
- "isMultiusable": true,
- "name": "Coupon: 3,00€ Discount (>0)",
- "value": "3"
}
}, - {
- "type": "redeemCouponCode",
- "args": {
- "code": "234235235"
}
}
]
}, - {
- "id": "discount-10",
- "rankID": "manual_discount",
- "condition": {
- "type": "and",
- "children": [
- {
- "type": "isReferredToByCoupon",
- "args": {
- "equals": "discount-10"
}
}, - {
- "type": "hasSKU",
- "args": {
- "oneOf": [
- "123456"
]
}
}, - {
- "type": "isExclusiveForLineItem"
}
]
}, - "actions": [
- {
- "type": "modifyPrice",
- "args": {
- "absolute": false,
- "isMultiusable": true,
- "name": "10% Rabatt",
- "value": "10"
}
}, - {
- "type": "redeemReferringCoupon",
- "args": {
- "id": "discount-10"
}
}
]
}, - {
- "id": "discount-25",
- "rankID": "manual_discount",
- "condition": {
- "type": "and",
- "children": [
- {
- "type": "isReferredToByCoupon",
- "args": {
- "equals": "discount-25"
}
}, - {
- "type": "hasSKU",
- "args": {
- "oneOf": [
- "123456"
]
}
}, - {
- "type": "isExclusiveForLineItem"
}
]
}, - "actions": [
- {
- "type": "modifyPrice",
- "args": {
- "absolute": false,
- "isMultiusable": true,
- "name": "25% Rabatt",
- "value": "25"
}
}, - {
- "type": "redeemReferringCoupon",
- "args": {
- "id": "discount-25"
}
}
]
}, - {
- "id": "discount-50",
- "rankID": "manual_discount",
- "condition": {
- "type": "and",
- "children": [
- {
- "type": "isReferredToByCoupon",
- "args": {
- "equals": "discount-50"
}
}, - {
- "type": "hasSKU",
- "args": {
- "oneOf": [
- "123456"
]
}
}, - {
- "type": "isExclusiveForLineItem"
}
]
}, - "actions": [
- {
- "type": "modifyPrice",
- "args": {
- "absolute": false,
- "isMultiusable": true,
- "name": "50% Rabatt",
- "value": "50"
}
}, - {
- "type": "redeemReferringCoupon",
- "args": {
- "id": "discount-50"
}
}
]
}, - {
- "id": "manual-discount-control",
- "rankID": "manual_discount_control",
- "condition": {
- "type": "grantedDiscountGreaterThanOrEqual",
- "args": {
- "ruleIDs": [
- "discount-10",
- "discount-25",
- "discount-50"
], - "value": "8"
}
}, - "actions": [
- {
- "type": "addForceControl"
}
]
}, - {
- "id": "free-product-on-two-saturdays",
- "rankID": "article_promotion",
- "condition": {
- "type": "and",
- "children": [
- {
- "type": "hasSKU",
- "args": {
- "equals": "2468"
}
}, - {
- "type": "or",
- "children": [
- {
- "type": "isCurrentlyActive",
- "args": {
- "from": "2022-04-02T00:00:00+02:00",
- "to": "2022-04-03T00:00:00+02:00"
}
}, - {
- "type": "isCurrentlyActive",
- "args": {
- "from": "2022-04-09T00:00:00+02:00",
- "to": "2022-04-10T00:00:00+02:00"
}
}
]
}
]
}, - "actions": [
- {
- "type": "addLineItemDiscount",
- "args": {
- "absolute": false,
- "amount": "1",
- "isMultiusable": false,
- "name": "Free thingie only these Saturdays",
- "requiredAmount": "1",
- "value": "100"
}
}
]
}, - {
- "id": "discount-if-cart-bigger-than-40",
- "rankID": "receipt_promotion",
- "condition": {
- "type": "and",
- "children": [
- {
- "type": "totalGreaterThanOrEqual",
- "args": {
- "value": "40"
}
}, - {
- "type": "or",
- "children": [
- {
- "type": "isCurrentlyActive",
- "args": {
- "from": "2022-03-17T00:00:00+01:00",
- "to": "2022-03-24T00:00:00+01:00"
}
}
]
}
]
}, - "actions": [
- {
- "type": "addCartDiscount",
- "args": {
- "absolute": true,
- "name": "10 Euro discount",
- "value": "10"
}
}
]
}
]
}
]
}
Retrieve configuration by id
Retrieves the promotion configuration with the given id for the project
Authorizations:
path Parameters
projectID required | string (ProjectID) The identifier for a particular project. |
configID required | integer (ConfigID) A numeric id to identify a particular promotion configuration. This is an internal identifier. |
Responses
Response samples
- 200
- default
{- "rounding": {
- "mode": "up",
- "precision": 2
}, - "ranks": [
- {
- "id": "manual_discount",
- "evaluationMode": "applyAll"
}, - {
- "id": "manual_discount_control",
- "evaluationMode": "applyAll"
}, - {
- "id": "article_promotion",
- "evaluationMode": "applyAll"
}, - {
- "id": "article_group",
- "evaluationMode": "applyAll"
}, - {
- "id": "receipt_promotion",
- "evaluationMode": "selectBest"
}
], - "groups": [
- {
- "id": "",
- "condition": null,
- "rules": [
- {
- "id": "buy-6-get-one-free",
- "rankID": "article_promotion",
- "condition": {
- "type": "and",
- "children": [
- {
- "type": "isCurrentlyActive",
- "args": {
- "from": "2021-02-25T00:00:00+01:00",
- "to": "2021-03-04T00:00:00+01:00"
}
}, - {
- "type": "hasSKU",
- "args": {
- "equals": "1200"
}
}, - {
- "type": "amountGreaterOrEqual",
- "args": {
- "value": "6"
}
}
]
}, - "actions": [
- {
- "type": "addLineItemDiscount",
- "args": {
- "absolute": true,
- "amount": "6",
- "isMultiusable": true,
- "name": "Buy 6 get 1 free",
- "requiredAmount": "6",
- "value": "1"
}
}
]
}, - {
- "id": "cart-discount-in-some-shop",
- "rankID": "receipt_promotion",
- "condition": {
- "type": "and",
- "children": [
- {
- "type": "isCurrentlyActive",
- "args": {
- "from": "2021-03-28T00:00:00+01:00",
- "to": "2021-03-29T00:00:00+02:00"
}
}, - {
- "type": "totalGreaterThanOrEqual",
- "args": {
- "value": "50"
}
}, - {
- "type": "hasExternalShopID",
- "args": {
- "oneOf": [
- "12",
- "13",
- "14"
]
}
}
]
}, - "actions": [
- {
- "type": "addCartDiscount",
- "args": {
- "absolute": true,
- "isMultiusable": true,
- "name": "10 Euro cart discount in some shops",
- "value": "10"
}
}
]
}, - {
- "id": "25-percent-discount-on-some-products-in-one-shop",
- "rankID": "article_group",
- "condition": {
- "type": "and",
- "children": [
- {
- "type": "isCurrentlyActive",
- "args": {
- "from": "2021-03-27T00:00:00+01:00",
- "to": "2021-03-28T00:00:00+01:00"
}
}, - {
- "type": "hasSKU",
- "args": {
- "oneOf": [
- "1234",
- "1235",
- "1236"
]
}
}, - {
- "type": "hasExternalShopID",
- "args": {
- "oneOf": [
- "200"
]
}
}
]
}, - "actions": [
- {
- "type": "addLineItemDiscount",
- "args": {
- "absolute": false,
- "amount": "1",
- "isMultiusable": true,
- "name": "25 percent off on these products",
- "value": "25"
}
}
]
}, - {
- "id": "cart-discount-with-coupon",
- "rankID": "receipt_promotion",
- "condition": {
- "type": "and",
- "children": [
- {
- "type": "isCurrentlyActive",
- "args": {
- "from": "2021-04-29T00:00:00+02:00",
- "to": "2041-07-01T00:00:00+02:00"
}
}, - {
- "type": "hasCouponCode",
- "args": {
- "equals": "1983958235"
}
}, - {
- "type": "totalGreaterThanOrEqual",
- "args": {
- "value": "20"
}
}
]
}, - "actions": [
- {
- "type": "addCartDiscount",
- "args": {
- "absolute": false,
- "isMultiusable": true,
- "name": "Coupon 10% Discount (>20)",
- "value": "10"
}
}, - {
- "type": "redeemCouponCode",
- "args": {
- "code": "1983958235"
}
}
]
}, - {
- "id": "3-euro-cart-discount-with-coupon",
- "rankID": "receipt_promotion",
- "condition": {
- "type": "and",
- "children": [
- {
- "type": "isCurrentlyActive",
- "args": {
- "from": "2021-04-29T00:00:00+02:00",
- "to": "2041-07-01T00:00:00+02:00"
}
}, - {
- "type": "hasCouponCode",
- "args": {
- "equals": "234235235"
}
}
]
}, - "actions": [
- {
- "type": "addCartDiscount",
- "args": {
- "absolute": true,
- "isMultiusable": true,
- "name": "Coupon: 3,00€ Discount (>0)",
- "value": "3"
}
}, - {
- "type": "redeemCouponCode",
- "args": {
- "code": "234235235"
}
}
]
}, - {
- "id": "discount-10",
- "rankID": "manual_discount",
- "condition": {
- "type": "and",
- "children": [
- {
- "type": "isReferredToByCoupon",
- "args": {
- "equals": "discount-10"
}
}, - {
- "type": "hasSKU",
- "args": {
- "oneOf": [
- "123456"
]
}
}, - {
- "type": "isExclusiveForLineItem"
}
]
}, - "actions": [
- {
- "type": "modifyPrice",
- "args": {
- "absolute": false,
- "isMultiusable": true,
- "name": "10% Rabatt",
- "value": "10"
}
}, - {
- "type": "redeemReferringCoupon",
- "args": {
- "id": "discount-10"
}
}
]
}, - {
- "id": "discount-25",
- "rankID": "manual_discount",
- "condition": {
- "type": "and",
- "children": [
- {
- "type": "isReferredToByCoupon",
- "args": {
- "equals": "discount-25"
}
}, - {
- "type": "hasSKU",
- "args": {
- "oneOf": [
- "123456"
]
}
}, - {
- "type": "isExclusiveForLineItem"
}
]
}, - "actions": [
- {
- "type": "modifyPrice",
- "args": {
- "absolute": false,
- "isMultiusable": true,
- "name": "25% Rabatt",
- "value": "25"
}
}, - {
- "type": "redeemReferringCoupon",
- "args": {
- "id": "discount-25"
}
}
]
}, - {
- "id": "discount-50",
- "rankID": "manual_discount",
- "condition": {
- "type": "and",
- "children": [
- {
- "type": "isReferredToByCoupon",
- "args": {
- "equals": "discount-50"
}
}, - {
- "type": "hasSKU",
- "args": {
- "oneOf": [
- "123456"
]
}
}, - {
- "type": "isExclusiveForLineItem"
}
]
}, - "actions": [
- {
- "type": "modifyPrice",
- "args": {
- "absolute": false,
- "isMultiusable": true,
- "name": "50% Rabatt",
- "value": "50"
}
}, - {
- "type": "redeemReferringCoupon",
- "args": {
- "id": "discount-50"
}
}
]
}, - {
- "id": "manual-discount-control",
- "rankID": "manual_discount_control",
- "condition": {
- "type": "grantedDiscountGreaterThanOrEqual",
- "args": {
- "ruleIDs": [
- "discount-10",
- "discount-25",
- "discount-50"
], - "value": "8"
}
}, - "actions": [
- {
- "type": "addForceControl"
}
]
}, - {
- "id": "free-product-on-two-saturdays",
- "rankID": "article_promotion",
- "condition": {
- "type": "and",
- "children": [
- {
- "type": "hasSKU",
- "args": {
- "equals": "2468"
}
}, - {
- "type": "or",
- "children": [
- {
- "type": "isCurrentlyActive",
- "args": {
- "from": "2022-04-02T00:00:00+02:00",
- "to": "2022-04-03T00:00:00+02:00"
}
}, - {
- "type": "isCurrentlyActive",
- "args": {
- "from": "2022-04-09T00:00:00+02:00",
- "to": "2022-04-10T00:00:00+02:00"
}
}
]
}
]
}, - "actions": [
- {
- "type": "addLineItemDiscount",
- "args": {
- "absolute": false,
- "amount": "1",
- "isMultiusable": false,
- "name": "Free thingie only these Saturdays",
- "requiredAmount": "1",
- "value": "100"
}
}
]
}, - {
- "id": "discount-if-cart-bigger-than-40",
- "rankID": "receipt_promotion",
- "condition": {
- "type": "and",
- "children": [
- {
- "type": "totalGreaterThanOrEqual",
- "args": {
- "value": "40"
}
}, - {
- "type": "or",
- "children": [
- {
- "type": "isCurrentlyActive",
- "args": {
- "from": "2022-03-17T00:00:00+01:00",
- "to": "2022-03-24T00:00:00+01:00"
}
}
]
}
]
}, - "actions": [
- {
- "type": "addCartDiscount",
- "args": {
- "absolute": true,
- "name": "10 Euro discount",
- "value": "10"
}
}
]
}
]
}
]
}
Update configuration
Update an existing promotion configuration
Authorizations:
path Parameters
projectID required | string (ProjectID) The identifier for a particular project. |
configID required | integer (ConfigID) A numeric id to identify a particular promotion configuration. This is an internal identifier. |
Request Body schema: application/jsonrequired
object | |
id required | integer (ConfigID) A numeric id to identify a particular promotion configuration. This is an internal identifier. |
projectID | string (ProjectID) The identifier for a particular project. |
active | boolean Whether or not this is the currently active promotion for a project. |
object (RoundingConfig) The rounding strategy to use when calculating promotions. | |
Array of items The ranks in this configuration. Each rule belongs to a rank. The rules will be evaluation in the order of their ranks. | |
Array of items The groups of rules in this configuration. The groups are applied in the order they are specified. If a group specifies a condition it is skipped if the condition is not fulfilled. |
Responses
Request samples
- Payload
{- "rounding": {
- "mode": "up",
- "precision": 2
}, - "ranks": [
- {
- "id": "manual_discount",
- "evaluationMode": "applyAll"
}, - {
- "id": "manual_discount_control",
- "evaluationMode": "applyAll"
}, - {
- "id": "article_promotion",
- "evaluationMode": "applyAll"
}, - {
- "id": "article_group",
- "evaluationMode": "applyAll"
}, - {
- "id": "receipt_promotion",
- "evaluationMode": "selectBest"
}
], - "groups": [
- {
- "id": "",
- "condition": null,
- "rules": [
- {
- "id": "buy-6-get-one-free",
- "rankID": "article_promotion",
- "condition": {
- "type": "and",
- "children": [
- {
- "type": "isCurrentlyActive",
- "args": {
- "from": "2021-02-25T00:00:00+01:00",
- "to": "2021-03-04T00:00:00+01:00"
}
}, - {
- "type": "hasSKU",
- "args": {
- "equals": "1200"
}
}, - {
- "type": "amountGreaterOrEqual",
- "args": {
- "value": "6"
}
}
]
}, - "actions": [
- {
- "type": "addLineItemDiscount",
- "args": {
- "absolute": true,
- "amount": "6",
- "isMultiusable": true,
- "name": "Buy 6 get 1 free",
- "requiredAmount": "6",
- "value": "1"
}
}
]
}, - {
- "id": "cart-discount-in-some-shop",
- "rankID": "receipt_promotion",
- "condition": {
- "type": "and",
- "children": [
- {
- "type": "isCurrentlyActive",
- "args": {
- "from": "2021-03-28T00:00:00+01:00",
- "to": "2021-03-29T00:00:00+02:00"
}
}, - {
- "type": "totalGreaterThanOrEqual",
- "args": {
- "value": "50"
}
}, - {
- "type": "hasExternalShopID",
- "args": {
- "oneOf": [
- "12",
- "13",
- "14"
]
}
}
]
}, - "actions": [
- {
- "type": "addCartDiscount",
- "args": {
- "absolute": true,
- "isMultiusable": true,
- "name": "10 Euro cart discount in some shops",
- "value": "10"
}
}
]
}, - {
- "id": "25-percent-discount-on-some-products-in-one-shop",
- "rankID": "article_group",
- "condition": {
- "type": "and",
- "children": [
- {
- "type": "isCurrentlyActive",
- "args": {
- "from": "2021-03-27T00:00:00+01:00",
- "to": "2021-03-28T00:00:00+01:00"
}
}, - {
- "type": "hasSKU",
- "args": {
- "oneOf": [
- "1234",
- "1235",
- "1236"
]
}
}, - {
- "type": "hasExternalShopID",
- "args": {
- "oneOf": [
- "200"
]
}
}
]
}, - "actions": [
- {
- "type": "addLineItemDiscount",
- "args": {
- "absolute": false,
- "amount": "1",
- "isMultiusable": true,
- "name": "25 percent off on these products",
- "value": "25"
}
}
]
}, - {
- "id": "cart-discount-with-coupon",
- "rankID": "receipt_promotion",
- "condition": {
- "type": "and",
- "children": [
- {
- "type": "isCurrentlyActive",
- "args": {
- "from": "2021-04-29T00:00:00+02:00",
- "to": "2041-07-01T00:00:00+02:00"
}
}, - {
- "type": "hasCouponCode",
- "args": {
- "equals": "1983958235"
}
}, - {
- "type": "totalGreaterThanOrEqual",
- "args": {
- "value": "20"
}
}
]
}, - "actions": [
- {
- "type": "addCartDiscount",
- "args": {
- "absolute": false,
- "isMultiusable": true,
- "name": "Coupon 10% Discount (>20)",
- "value": "10"
}
}, - {
- "type": "redeemCouponCode",
- "args": {
- "code": "1983958235"
}
}
]
}, - {
- "id": "3-euro-cart-discount-with-coupon",
- "rankID": "receipt_promotion",
- "condition": {
- "type": "and",
- "children": [
- {
- "type": "isCurrentlyActive",
- "args": {
- "from": "2021-04-29T00:00:00+02:00",
- "to": "2041-07-01T00:00:00+02:00"
}
}, - {
- "type": "hasCouponCode",
- "args": {
- "equals": "234235235"
}
}
]
}, - "actions": [
- {
- "type": "addCartDiscount",
- "args": {
- "absolute": true,
- "isMultiusable": true,
- "name": "Coupon: 3,00€ Discount (>0)",
- "value": "3"
}
}, - {
- "type": "redeemCouponCode",
- "args": {
- "code": "234235235"
}
}
]
}, - {
- "id": "discount-10",
- "rankID": "manual_discount",
- "condition": {
- "type": "and",
- "children": [
- {
- "type": "isReferredToByCoupon",
- "args": {
- "equals": "discount-10"
}
}, - {
- "type": "hasSKU",
- "args": {
- "oneOf": [
- "123456"
]
}
}, - {
- "type": "isExclusiveForLineItem"
}
]
}, - "actions": [
- {
- "type": "modifyPrice",
- "args": {
- "absolute": false,
- "isMultiusable": true,
- "name": "10% Rabatt",
- "value": "10"
}
}, - {
- "type": "redeemReferringCoupon",
- "args": {
- "id": "discount-10"
}
}
]
}, - {
- "id": "discount-25",
- "rankID": "manual_discount",
- "condition": {
- "type": "and",
- "children": [
- {
- "type": "isReferredToByCoupon",
- "args": {
- "equals": "discount-25"
}
}, - {
- "type": "hasSKU",
- "args": {
- "oneOf": [
- "123456"
]
}
}, - {
- "type": "isExclusiveForLineItem"
}
]
}, - "actions": [
- {
- "type": "modifyPrice",
- "args": {
- "absolute": false,
- "isMultiusable": true,
- "name": "25% Rabatt",
- "value": "25"
}
}, - {
- "type": "redeemReferringCoupon",
- "args": {
- "id": "discount-25"
}
}
]
}, - {
- "id": "discount-50",
- "rankID": "manual_discount",
- "condition": {
- "type": "and",
- "children": [
- {
- "type": "isReferredToByCoupon",
- "args": {
- "equals": "discount-50"
}
}, - {
- "type": "hasSKU",
- "args": {
- "oneOf": [
- "123456"
]
}
}, - {
- "type": "isExclusiveForLineItem"
}
]
}, - "actions": [
- {
- "type": "modifyPrice",
- "args": {
- "absolute": false,
- "isMultiusable": true,
- "name": "50% Rabatt",
- "value": "50"
}
}, - {
- "type": "redeemReferringCoupon",
- "args": {
- "id": "discount-50"
}
}
]
}, - {
- "id": "manual-discount-control",
- "rankID": "manual_discount_control",
- "condition": {
- "type": "grantedDiscountGreaterThanOrEqual",
- "args": {
- "ruleIDs": [
- "discount-10",
- "discount-25",
- "discount-50"
], - "value": "8"
}
}, - "actions": [
- {
- "type": "addForceControl"
}
]
}, - {
- "id": "free-product-on-two-saturdays",
- "rankID": "article_promotion",
- "condition": {
- "type": "and",
- "children": [
- {
- "type": "hasSKU",
- "args": {
- "equals": "2468"
}
}, - {
- "type": "or",
- "children": [
- {
- "type": "isCurrentlyActive",
- "args": {
- "from": "2022-04-02T00:00:00+02:00",
- "to": "2022-04-03T00:00:00+02:00"
}
}, - {
- "type": "isCurrentlyActive",
- "args": {
- "from": "2022-04-09T00:00:00+02:00",
- "to": "2022-04-10T00:00:00+02:00"
}
}
]
}
]
}, - "actions": [
- {
- "type": "addLineItemDiscount",
- "args": {
- "absolute": false,
- "amount": "1",
- "isMultiusable": false,
- "name": "Free thingie only these Saturdays",
- "requiredAmount": "1",
- "value": "100"
}
}
]
}, - {
- "id": "discount-if-cart-bigger-than-40",
- "rankID": "receipt_promotion",
- "condition": {
- "type": "and",
- "children": [
- {
- "type": "totalGreaterThanOrEqual",
- "args": {
- "value": "40"
}
}, - {
- "type": "or",
- "children": [
- {
- "type": "isCurrentlyActive",
- "args": {
- "from": "2022-03-17T00:00:00+01:00",
- "to": "2022-03-24T00:00:00+01:00"
}
}
]
}
]
}, - "actions": [
- {
- "type": "addCartDiscount",
- "args": {
- "absolute": true,
- "name": "10 Euro discount",
- "value": "10"
}
}
]
}
]
}
]
}
Response samples
- 400
- default
{- "error": {
- "type": "string",
- "message": "string"
}
}
Retrieve configurations
Retrieve all the promotion configurations for a project, only one of which can be active.
Authorizations:
path Parameters
projectID required | string (ProjectID) The identifier for a particular project. |
Responses
Response samples
- 200
- default
{- "configurations": [
- {
- "$ref": "#/components/examples/promotionConfiguration"
}
]
}
Create configuration
Create a new promotion configuration for the project
Authorizations:
path Parameters
projectID required | string (ProjectID) The identifier for a particular project. |
Request Body schema: application/jsonrequired
object | |
id required | integer (ConfigID) A numeric id to identify a particular promotion configuration. This is an internal identifier. |
projectID | string (ProjectID) The identifier for a particular project. |
active | boolean Whether or not this is the currently active promotion for a project. |
object (RoundingConfig) The rounding strategy to use when calculating promotions. | |
Array of items The ranks in this configuration. Each rule belongs to a rank. The rules will be evaluation in the order of their ranks. | |
Array of items The groups of rules in this configuration. The groups are applied in the order they are specified. If a group specifies a condition it is skipped if the condition is not fulfilled. |
Responses
Request samples
- Payload
{- "rounding": {
- "mode": "up",
- "precision": 2
}, - "ranks": [
- {
- "id": "manual_discount",
- "evaluationMode": "applyAll"
}, - {
- "id": "manual_discount_control",
- "evaluationMode": "applyAll"
}, - {
- "id": "article_promotion",
- "evaluationMode": "applyAll"
}, - {
- "id": "article_group",
- "evaluationMode": "applyAll"
}, - {
- "id": "receipt_promotion",
- "evaluationMode": "selectBest"
}
], - "groups": [
- {
- "id": "",
- "condition": null,
- "rules": [
- {
- "id": "buy-6-get-one-free",
- "rankID": "article_promotion",
- "condition": {
- "type": "and",
- "children": [
- {
- "type": "isCurrentlyActive",
- "args": {
- "from": "2021-02-25T00:00:00+01:00",
- "to": "2021-03-04T00:00:00+01:00"
}
}, - {
- "type": "hasSKU",
- "args": {
- "equals": "1200"
}
}, - {
- "type": "amountGreaterOrEqual",
- "args": {
- "value": "6"
}
}
]
}, - "actions": [
- {
- "type": "addLineItemDiscount",
- "args": {
- "absolute": true,
- "amount": "6",
- "isMultiusable": true,
- "name": "Buy 6 get 1 free",
- "requiredAmount": "6",
- "value": "1"
}
}
]
}, - {
- "id": "cart-discount-in-some-shop",
- "rankID": "receipt_promotion",
- "condition": {
- "type": "and",
- "children": [
- {
- "type": "isCurrentlyActive",
- "args": {
- "from": "2021-03-28T00:00:00+01:00",
- "to": "2021-03-29T00:00:00+02:00"
}
}, - {
- "type": "totalGreaterThanOrEqual",
- "args": {
- "value": "50"
}
}, - {
- "type": "hasExternalShopID",
- "args": {
- "oneOf": [
- "12",
- "13",
- "14"
]
}
}
]
}, - "actions": [
- {
- "type": "addCartDiscount",
- "args": {
- "absolute": true,
- "isMultiusable": true,
- "name": "10 Euro cart discount in some shops",
- "value": "10"
}
}
]
}, - {
- "id": "25-percent-discount-on-some-products-in-one-shop",
- "rankID": "article_group",
- "condition": {
- "type": "and",
- "children": [
- {
- "type": "isCurrentlyActive",
- "args": {
- "from": "2021-03-27T00:00:00+01:00",
- "to": "2021-03-28T00:00:00+01:00"
}
}, - {
- "type": "hasSKU",
- "args": {
- "oneOf": [
- "1234",
- "1235",
- "1236"
]
}
}, - {
- "type": "hasExternalShopID",
- "args": {
- "oneOf": [
- "200"
]
}
}
]
}, - "actions": [
- {
- "type": "addLineItemDiscount",
- "args": {
- "absolute": false,
- "amount": "1",
- "isMultiusable": true,
- "name": "25 percent off on these products",
- "value": "25"
}
}
]
}, - {
- "id": "cart-discount-with-coupon",
- "rankID": "receipt_promotion",
- "condition": {
- "type": "and",
- "children": [
- {
- "type": "isCurrentlyActive",
- "args": {
- "from": "2021-04-29T00:00:00+02:00",
- "to": "2041-07-01T00:00:00+02:00"
}
}, - {
- "type": "hasCouponCode",
- "args": {
- "equals": "1983958235"
}
}, - {
- "type": "totalGreaterThanOrEqual",
- "args": {
- "value": "20"
}
}
]
}, - "actions": [
- {
- "type": "addCartDiscount",
- "args": {
- "absolute": false,
- "isMultiusable": true,
- "name": "Coupon 10% Discount (>20)",
- "value": "10"
}
}, - {
- "type": "redeemCouponCode",
- "args": {
- "code": "1983958235"
}
}
]
}, - {
- "id": "3-euro-cart-discount-with-coupon",
- "rankID": "receipt_promotion",
- "condition": {
- "type": "and",
- "children": [
- {
- "type": "isCurrentlyActive",
- "args": {
- "from": "2021-04-29T00:00:00+02:00",
- "to": "2041-07-01T00:00:00+02:00"
}
}, - {
- "type": "hasCouponCode",
- "args": {
- "equals": "234235235"
}
}
]
}, - "actions": [
- {
- "type": "addCartDiscount",
- "args": {
- "absolute": true,
- "isMultiusable": true,
- "name": "Coupon: 3,00€ Discount (>0)",
- "value": "3"
}
}, - {
- "type": "redeemCouponCode",
- "args": {
- "code": "234235235"
}
}
]
}, - {
- "id": "discount-10",
- "rankID": "manual_discount",
- "condition": {
- "type": "and",
- "children": [
- {
- "type": "isReferredToByCoupon",
- "args": {
- "equals": "discount-10"
}
}, - {
- "type": "hasSKU",
- "args": {
- "oneOf": [
- "123456"
]
}
}, - {
- "type": "isExclusiveForLineItem"
}
]
}, - "actions": [
- {
- "type": "modifyPrice",
- "args": {
- "absolute": false,
- "isMultiusable": true,
- "name": "10% Rabatt",
- "value": "10"
}
}, - {
- "type": "redeemReferringCoupon",
- "args": {
- "id": "discount-10"
}
}
]
}, - {
- "id": "discount-25",
- "rankID": "manual_discount",
- "condition": {
- "type": "and",
- "children": [
- {
- "type": "isReferredToByCoupon",
- "args": {
- "equals": "discount-25"
}
}, - {
- "type": "hasSKU",
- "args": {
- "oneOf": [
- "123456"
]
}
}, - {
- "type": "isExclusiveForLineItem"
}
]
}, - "actions": [
- {
- "type": "modifyPrice",
- "args": {
- "absolute": false,
- "isMultiusable": true,
- "name": "25% Rabatt",
- "value": "25"
}
}, - {
- "type": "redeemReferringCoupon",
- "args": {
- "id": "discount-25"
}
}
]
}, - {
- "id": "discount-50",
- "rankID": "manual_discount",
- "condition": {
- "type": "and",
- "children": [
- {
- "type": "isReferredToByCoupon",
- "args": {
- "equals": "discount-50"
}
}, - {
- "type": "hasSKU",
- "args": {
- "oneOf": [
- "123456"
]
}
}, - {
- "type": "isExclusiveForLineItem"
}
]
}, - "actions": [
- {
- "type": "modifyPrice",
- "args": {
- "absolute": false,
- "isMultiusable": true,
- "name": "50% Rabatt",
- "value": "50"
}
}, - {
- "type": "redeemReferringCoupon",
- "args": {
- "id": "discount-50"
}
}
]
}, - {
- "id": "manual-discount-control",
- "rankID": "manual_discount_control",
- "condition": {
- "type": "grantedDiscountGreaterThanOrEqual",
- "args": {
- "ruleIDs": [
- "discount-10",
- "discount-25",
- "discount-50"
], - "value": "8"
}
}, - "actions": [
- {
- "type": "addForceControl"
}
]
}, - {
- "id": "free-product-on-two-saturdays",
- "rankID": "article_promotion",
- "condition": {
- "type": "and",
- "children": [
- {
- "type": "hasSKU",
- "args": {
- "equals": "2468"
}
}, - {
- "type": "or",
- "children": [
- {
- "type": "isCurrentlyActive",
- "args": {
- "from": "2022-04-02T00:00:00+02:00",
- "to": "2022-04-03T00:00:00+02:00"
}
}, - {
- "type": "isCurrentlyActive",
- "args": {
- "from": "2022-04-09T00:00:00+02:00",
- "to": "2022-04-10T00:00:00+02:00"
}
}
]
}
]
}, - "actions": [
- {
- "type": "addLineItemDiscount",
- "args": {
- "absolute": false,
- "amount": "1",
- "isMultiusable": false,
- "name": "Free thingie only these Saturdays",
- "requiredAmount": "1",
- "value": "100"
}
}
]
}, - {
- "id": "discount-if-cart-bigger-than-40",
- "rankID": "receipt_promotion",
- "condition": {
- "type": "and",
- "children": [
- {
- "type": "totalGreaterThanOrEqual",
- "args": {
- "value": "40"
}
}, - {
- "type": "or",
- "children": [
- {
- "type": "isCurrentlyActive",
- "args": {
- "from": "2022-03-17T00:00:00+01:00",
- "to": "2022-03-24T00:00:00+01:00"
}
}
]
}
]
}, - "actions": [
- {
- "type": "addCartDiscount",
- "args": {
- "absolute": true,
- "name": "10 Euro discount",
- "value": "10"
}
}
]
}
]
}
]
}
Response samples
- 400
- default
{- "error": {
- "type": "string",
- "message": "string"
}
}
Activate configuration
Set an active configuration to be the active one
Authorizations:
path Parameters
projectID required | string (ProjectID) The identifier for a particular project. |
configID required | integer (ConfigID) A numeric id to identify a particular promotion configuration. This is an internal identifier. |