5 July 2023
Pricing and DiscountsProject configurationSecurity and privacy
With the introduction of Store-specific Cart Discounts in public beta, you can now define Cart Discounts that are applicable to specific Stores. Previously, you could only define Cart Discounts that are active across all the Stores in your Project.
You can restrict the permissions of API Clients to view and manage Cart Discounts in a specific Store only. Previously, such permissions could only be managed globally for all Cart Discounts in a Project at the same time. However, the permissions set are not exclusive in the following instances:
- Cart Discounts requiring a Discount Code can be linked to a Discount Code created by any user.
 - When using Custom Fields, if any Custom Field references Cart Discounts, all Cart Discounts will be visible.
 
With this enhancement, the limit for Cart Discounts that do not require a Discount Code has been increased. In addition to the 100 active Cart Discounts that are independent of a Store, you can now have 100 Cart Discounts per Store. Thus, the overall limit is 100 + (100 * number of Stores in a Project).
Changes:
- 
[API] Added
manage_cart_discounts:{projectKey}:{storeKey}andview_cart_discounts:{projectKey}:{storeKey}scopes. - 
[API] Added MaxCartDiscountsReached, StoreCartDiscountsLimitReached, and MaxStoreReferencesReached errors.
 - 
[GraphQL API] Added the following types to the GraphQL schema:
AddCartDiscountStore,RemoveCartDiscountStore,SetCartDiscountStores - 
[GraphQL API] Changed the
CartDiscountDrafttype:- Input field 
storeswas added toCartDiscountDrafttype 
 - Input field 
 - 
[GraphQL API] Changed the
InStoretype:InStoreobject type now implementsCartDiscountQueryInterfaceinterface- Added the 
cartDiscountsfield to theInStoretype. - Added the 
cartDiscountfield to theInStoretype. 
 - 
[GraphQL API] Changed the
CartDiscounttype:- Added the 
storesfield to theCartDiscounttype. - Added the 
storesReffield to theCartDiscounttype. 
 - Added the 
 - 
[GraphQL API] Changed the
CartDiscountUpdateActiontype:- Input field 
setStoreswas added toCartDiscountUpdateActiontype - Input field 
removeStorewas added toCartDiscountUpdateActiontype - Input field 
addStorewas added toCartDiscountUpdateActiontype 
 - Input field 
 
The following changes were introduced in terms of GraphQL SDL:
extend type InStore {
  cartDiscount(
    "Queries with specified ID"
    id: String,
    "Queries with specified key"
    key: String): CartDiscount
  cartDiscounts(where: String, sort: [String!], limit: Int, offset: Int): CartDiscountQueryResult!
}
extend type CartDiscount {
  "BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
  stores: [Store!]!
  "BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
  storesRef: [KeyReference!]!
}
extend input CartDiscountDraft {
  "BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
  stores: [ResourceIdentifierInput!]
}
extend input CartDiscountUpdateAction {
  "BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
  addStore: AddCartDiscountStore
  "BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
  removeStore: RemoveCartDiscountStore
  "BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
  setStores: SetCartDiscountStores
}
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
input AddCartDiscountStore {
  store: ResourceIdentifierInput!
}
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
input RemoveCartDiscountStore {
  store: ResourceIdentifierInput!
}
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
input SetCartDiscountStores {
  stores: [ResourceIdentifierInput!]
}