Skip to content

Commit 503a690

Browse files
committed
Updated API from documentation release
1 parent 8a62f92 commit 503a690

9 files changed

Lines changed: 72 additions & 0 deletions
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"action": "setDiscountsConfiguration",
3+
"discountsConfiguration": {
4+
"discountCombinationMode": "Stacking"
5+
}
6+
}

api-specs/api/examples/project-update-response.example.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,8 @@
1111
},
1212
"carts": {
1313
"countryTaxRateFallbackEnabled": false
14+
},
15+
"discounts" : {
16+
"discountCombinationMode": "Stacking"
1417
}
1518
}

api-specs/api/examples/project.example.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,8 @@
1111
},
1212
"carts": {
1313
"countryTaxRateFallbackEnabled": false
14+
},
15+
"discounts" : {
16+
"discountCombinationMode": "Stacking"
1417
}
1518
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#%RAML 1.0 DataType
2+
(package): Project
3+
type: string
4+
displayName: DiscountCombinationMode
5+
description: |
6+
Defines how Product Discounts and Cart Discounts are combined for every Cart in a Project.
7+
(enumDescriptions):
8+
BestDeal: Either Product Discounts or Cart Discounts are chosen based on best deal for the customer. Only one type applies per Cart.
9+
Stacking: Product Discounts and Cart Discounts are both applied to the Cart, potentially increasing the total discount.
10+
enum:
11+
- BestDeal
12+
- Stacking
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#%RAML 1.0 DataType
2+
(package): Project
3+
type: object
4+
displayName: DiscountsConfiguration
5+
description: |
6+
Holds the configuration for behavior of Product and Cart Discounts.
7+
properties:
8+
discountCombinationMode:
9+
type: DiscountCombinationMode
10+
description: |
11+
Indicates how Product Discounts and Cart Discounts should be combined. Default value is `Stacking`.

api-specs/api/types/project/Project.raml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,7 @@ properties:
6565
type: BusinessUnitConfiguration
6666
description: |
6767
Holds configuration specific to [Business Units](ctp:api:type:BusinessUnit).
68+
discounts:
69+
type: DiscountsConfiguration
70+
description: |
71+
Holds configuration specific to discounts, including how Product and Cart Discounts are combined in every Cart of the Project.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#%RAML 1.0 DataType
2+
(package): Project
3+
type: ProjectUpdateAction
4+
displayName: ProjectSetDiscountsConfigurationAction
5+
discriminatorValue: setDiscountsConfiguration
6+
example: !include ../../../examples/Project/ProjectSetDiscountsConfigurationAction.json
7+
properties:
8+
discountsConfiguration:
9+
type: DiscountsConfiguration
10+
description: |
11+
Configuration for the behavior of Cart and Product Discounts in the Project.

api-specs/api/types/types.raml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2171,6 +2171,8 @@ CartScoreType: !include project/CartScoreType.raml
21712171
CartValueType: !include project/CartValueType.raml
21722172
CartsConfiguration: !include project/CartsConfiguration.raml
21732173
CustomerSearchStatus: !include project/CustomerSearchStatus.raml
2174+
DiscountCombinationMode: !include project/DiscountCombinationMode.raml
2175+
DiscountsConfiguration: !include project/DiscountsConfiguration.raml
21742176
ExternalOAuth: !include project/ExternalOAuth.raml
21752177
OrderSearchStatus: !include project/OrderSearchStatus.raml
21762178
ProductSearchIndexingMode: !include project/ProductSearchIndexingMode.raml
@@ -2204,6 +2206,7 @@ ProjectChangeShoppingListsConfigurationAction: !include project/updates/ProjectC
22042206
ProjectChangeTaxRoundingModeAction: !include project/updates/ProjectChangeTaxRoundingModeAction.raml
22052207
# yamllint disable-line rule:line-length
22062208
ProjectSetBusinessUnitAssociateRoleOnCreationAction: !include project/updates/ProjectSetBusinessUnitAssociateRoleOnCreationAction.raml
2209+
ProjectSetDiscountsConfigurationAction: !include project/updates/ProjectSetDiscountsConfigurationAction.raml
22072210
ProjectSetExternalOAuthAction: !include project/updates/ProjectSetExternalOAuthAction.raml
22082211
ProjectSetShippingRateInputTypeAction: !include project/updates/ProjectSetShippingRateInputTypeAction.raml
22092212
QuoteRequest: !include quote-request/QuoteRequest.raml

api-specs/graphql/schema.sdl

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4563,6 +4563,14 @@ type DiscountedTotalPricePortion {
45634563
discountedAmount: BaseMoney!
45644564
}
45654565

4566+
type DiscountsConfiguration {
4567+
discountCombinationMode: DiscountCombinationMode!
4568+
}
4569+
4570+
input DiscountsConfigurationInput {
4571+
discountCombinationMode: DiscountCombinationMode
4572+
}
4573+
45664574
type EnumAttribute implements Attribute {
45674575
key: String!
45684576
label: String!
@@ -9965,6 +9973,11 @@ type ProductVariantTailoringRemoved implements MessagePayload {
99659973
type: String!
99669974
}
99679975

9976+
enum DiscountCombinationMode {
9977+
Stacking
9978+
BestDeal
9979+
}
9980+
99689981
"Contains information about the limits of your project."
99699982
type ProjectCustomLimitsProjection {
99709983
query: QueryLimitsProjection!
@@ -10006,6 +10019,7 @@ type ProjectProjection {
1000610019
currencies: [Currency!]!
1000710020
shippingRateInputType: ShippingRateInputType
1000810021
createdAt: DateTime!
10022+
discounts: DiscountsConfiguration
1000910023
}
1001010024

1001110025
input ProjectSettingsUpdateAction {
@@ -10032,6 +10046,7 @@ input ProjectSettingsUpdateAction {
1003210046

1003310047
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
1003410048
changeProductSearchIndexingEnabled: ChangeProjectSettingsProductSearchIndexingEnabled
10049+
setDiscountsConfiguration: SetProjectSettingsDiscountsConfiguration
1003510050
}
1003610051

1003710052
input PublishProduct {
@@ -13440,6 +13455,10 @@ input SetProjectSettingsMyBusinessUnitAssociateRoleOnCreation {
1344013455
associateRole: ResourceIdentifierInput
1344113456
}
1344213457

13458+
input SetProjectSettingsDiscountsConfiguration {
13459+
discountsConfiguration: DiscountsConfigurationInput!
13460+
}
13461+
1344313462
input SetProjectSettingsShippingRateInputType {
1344413463
shippingRateInputType: ShippingRateInputTypeInput
1344513464
}

0 commit comments

Comments
 (0)