Code Samples for Multiple Rule Promotions

Tiered $ off order based on order value

Example request
1{
2 "name": "Tiered $ off order based on order value",
3 "redemption_type": "AUTOMATIC",
4 "rules": [
5 {
6 "action": {
7 "cart_value": {
8 "discount": {
9 "fixed_amount": "45"
10 }
11 }
12 },
13 "apply_once": true,
14 "stop": true,
15 "currency_code": "AUD",
16 "condition": {
17 "cart": {
18 "minimum_spend": "175"
19 }
20 }
21 },
22 {
23 "action": {
24 "cart_value": {
25 "discount": {
26 "fixed_amount": "30"
27 }
28 }
29 },
30 "apply_once": true,
31 "stop": true,
32 "condition": {
33 "cart": {
34 "minimum_spend": "150"
35 }
36 }
37 },
38 {
39 "action": {
40 "cart_value": {
41 "discount": {
42 "fixed_amount": "15"
43 }
44 }
45 },
46 "apply_once": true,
47 "stop": true,
48 "condition": {
49 "cart": {
50 "minimum_spend": "100"
51 }
52 }
53 }
54 ],
55 "notifications": [
56 {
57 "type": "UPSELL",
58 "content": "<div>&nbsp;</div>",
59 "locations": [
60 "CART_PAGE"
61 ]
62 },
63 {
64 "type": "ELIGIBLE",
65 "content": "<div>&nbsp;</div>",
66 "locations": [
67 "CART_PAGE"
68 ]
69 },
70 {
71 "type": "APPLIED",
72 "content": "<div>&nbsp;</div>",
73 "locations": [
74 "CART_PAGE"
75 ]
76 }
77 ],
78 "stop": false,
79 "start_date": "2019-02-01T05:00:00+00:00",
80 "status": "ENABLED"
81}

Apply a tiered discount to X products based on the quantity of items ordered within X

Example request
{
"name": "Apply a tiered discount to applicable products based on the quantity of items ordered within X ",
"redemption_type": "AUTOMATIC",
"rules": [
{
"action": {
"cart_items": {
"discount": {
"fixed_amount": "20"
},
"strategy": "LEAST_EXPENSIVE",
"as_total": true,
"include_items_considered_by_condition": true,
"items": {
"categories": [
24
]
}
}
},
"apply_once": true,
"stop": true,
"condition": {
"cart": {
"items": {
"categories": [
35
]
},
"minimum_quantity": 4
}
}
},
{
"action": {
"cart_items": {
"discount": {
"fixed_amount": "15"
},
"strategy": "LEAST_EXPENSIVE",
"as_total": true,
"include_items_considered_by_condition": true,
"items": {
"categories": [
25
]
}
}
},
"apply_once": true,
"stop": true,
"condition": {
"cart": {
"items": {
"categories": [
25
]
},
"minimum_quantity": 3
}
}
},
{
"action": {
"cart_items": {
"discount": {
"fixed_amount": "10"
},
"strategy": "LEAST_EXPENSIVE",
"as_total": true,
"include_items_considered_by_condition": true,
"items": {
"categories": [
30
]
}
}
},
"apply_once": true,
"stop": true,
"condition": {
"cart": {
"items": {
"categories": [
36
]
},
"minimum_quantity": 2
}
}
}
],
"notifications": [
{
"type": "UPSELL",
"content": "<div>&nbsp;</div>",
"locations": [
"CART_PAGE"
]
},
{
"type": "ELIGIBLE",
"content": "<div>&nbsp;</div>",
"locations": [
"CART_PAGE"
]
},
{
"type": "APPLIED",
"content": "<div>&nbsp;</div>",
"locations": [
"CART_PAGE"
]
}
],
"stop": true,
"start_date": "2019-02-01T05:00:00+00:00",
"status": "ENABLED"
}

Up to 50% off storewide (50% off category X items and 40% off everything else)

Example request
1{
2 "name": "Up to 50% off storewide (50% off category X items and 40% off everything else)",
3 "redemption_type": "AUTOMATIC",
4 "rules": [
5 {
6 "action": {
7 "cart_items": {
8 "discount": {
9 "percentage_amount": 50
10 },
11 "items": {
12 "categories": [
13 36
14 ]
15 }
16 }
17 },
18 "apply_once": true
19 },
20 {
21 "action": {
22 "cart_items": {
23 "discount": {
24 "percentage_amount": 40
25 },
26 "items": {
27 "not": {
28 "categories": [
29 24
30 ]
31 }
32 }
33 }
34 },
35 "apply_once": true
36 }
37 ]
38}

Buy X products, get free shipping, and 10% off order

Example request
1{
2 "name": "Buy two of product X, get free shipping to all zones, and 10% off order",
3 "redemption_type": "AUTOMATIC",
4 "rules": [
5 {
6 "condition": {
7 "cart": {
8 "items": {
9 "products": [
10 118
11 ]
12 },
13 "minimum_quantity": 2
14 }
15 },
16 "action": {
17 "shipping": {
18 "free_shipping": true,
19 "zone_ids": "*"
20 }
21 }
22 },
23 {
24 "condition": {
25 "cart": {
26 "items": {
27 "products": [
28 130
29 ]
30 },
31 "minimum_quantity": 2
32 }
33 },
34 "action": {
35 "cart_value": {
36 "discount": {
37 "percentage_amount": 10
38 }
39 }
40 }
41 }
42 ]
43}