Skip to content

Commit 12c8607

Browse files
committed
Updated API from documentation release
1 parent 63488aa commit 12c8607

16 files changed

+183
-3
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"action": "setIsActive",
3+
"isActive": false
4+
}

api-specs/api/examples/discount-group-create.example.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@
66
"description": {
77
"en": "10% discount on all items in cart"
88
},
9-
"sortOrder": "0.01"
9+
"sortOrder": "0.01",
10+
"isActive": true
1011
}

api-specs/api/examples/discount-group-updated.example.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "{{discount-group-id}}",
3-
"version": 1,
3+
"version": 2,
44
"key": "black-friday-sale",
55
"name": {
66
"en": "Black Friday Sale"
@@ -9,6 +9,7 @@
99
"en": "10% discount on all items in cart"
1010
},
1111
"sortOrder": "0.01",
12+
"isActive": false,
1213
"createdAt": "2024-11-21T13:08:15.962Z",
1314
"lastModifiedAt": "2024-11-21T13:08:15.962Z",
1415
"lastModifiedBy": {

api-specs/api/examples/discount-group.example.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"en": "10% discount on all items in cart"
1010
},
1111
"sortOrder": "0.01",
12+
"isActive": true,
1213
"createdAt": "2024-11-21T13:08:15.962Z",
1314
"lastModifiedAt": "2024-11-21T13:08:15.962Z",
1415
"lastModifiedBy": {

api-specs/api/examples/discount-groups.example.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"name": {"en": "Black Friday Sale"},
1212
"description": {"en": "10% discount on all items in cart"},
1313
"sortOrder": "0.01",
14+
"isActive": true,
1415
"createdAt": "2024-11-21T13:08:15.962Z",
1516
"lastModifiedAt": "2024-11-21T13:08:15.962Z",
1617
"lastModifiedBy": {

api-specs/api/resources/discount-groups.raml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ post:
3333
description: |
3434
Creates a DiscountGroup in the Project.
3535
This request generates the [DiscountGroupCreated](ctp:api:type:DiscountGroupCreatedMessage) Message.
36+
37+
If the [limit](/../api/limits#discount-groups) for active Discount Groups has been reached, a [MaxDiscountGroupsReached](ctp:api:type:MaxDiscountGroupsReachedError) error is returned.
3638
securedBy: [oauth_2_0: { scopes: ['manage_cart_discounts:{projectKey}'] }]
3739
body:
3840
application/json:

api-specs/api/ruleset.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,11 @@
132132
<option type="exclude">DiscountCode:isActive</option>
133133
<option type="exclude">DiscountCodeDraft:isActive</option>
134134
<option type="exclude">DiscountCodeChangeIsActiveAction:isActive</option>
135+
<option type="exclude">DiscountGroup:isActive</option>
136+
<option type="exclude">DiscountGroupDraft:isActive</option>
137+
<option type="exclude">DiscountGroupSetIsActiveAction:isActive</option>
138+
<option type="exclude">DiscountGroupIsActiveSetMessage:isActive</option>
139+
<option type="exclude">DiscountGroupIsActiveSetMessagePayload:isActive</option>
135140
<option type="exclude">TrackingData:isReturn</option>
136141
<option type="exclude">ProductDiscount:isActive</option>
137142
<option type="exclude">ProductDiscountDraft:isActive</option>

api-specs/api/types/discount-group/DiscountGroup.raml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ properties:
3737
Value between `0` and `1` that determines the order in which the CartDiscount from the DiscountGroup is applied; a CartDiscount with a higher value is prioritized.
3838
3939
The sort order is unique among all DiscountGroups and CartDiscounts.
40+
isActive:
41+
type: boolean
42+
description: |
43+
A DiscountGroup must be active for its CartDiscounts to be considered during discount application.
44+
default: true
4045
createdAt:
4146
type: datetime
4247
description: |

api-specs/api/types/discount-group/DiscountGroupDraft.raml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,8 @@ properties:
2626
Value between `0` and `1` that determines the order in which the CartDiscount from the DiscountGroup will be applied; a CartDiscount with a higher value will be prioritized.
2727
2828
The sort order must be unique among all DiscountGroups and CartDiscounts.
29+
isActive?:
30+
type: boolean
31+
description: |
32+
A DiscountGroup must be active for its CartDiscounts to be considered during discount application.
33+
default: true
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#%RAML 1.0 DataType
2+
(package): DiscountGroup
3+
type: DiscountGroupUpdateAction
4+
displayName: DiscountGroupSetIsActiveAction
5+
discriminatorValue: setIsActive
6+
example: !include ../../../examples/DiscountGroup/DiscountGroupSetIsActiveAction.json
7+
(beta): true
8+
description: |
9+
This action generates the [DiscountGroupIsActiveSet](ctp:api:type:DiscountGroupIsActiveSetMessage) Message.
10+
11+
If the [limit](/../api/limits#discount-groups) for active Discount Groups has been reached, a [MaxDiscountGroupsReached](ctp:api:type:MaxDiscountGroupsReachedError) error is returned.
12+
properties:
13+
isActive:
14+
type: boolean
15+
description: |
16+
New value to set.
17+
18+
A DiscountGroup must be active for its CartDiscounts to be considered during discount application.

0 commit comments

Comments
 (0)