If a referenced Store does not exist, a ReferencedResourceNotFound error is returned.

This action generates a [CartDiscountStoresSet](ctp:api:type:CartDiscountStoresSetMessage) Message.
interface CartDiscountSetStoresAction {
    action: "setStores";
    stores: StoreResourceIdentifier[];
}

Properties

Properties

action: "setStores"

Stores to set. Overrides the current list of Stores. If empty, any existing values will be removed.

A failed update can return the following errors:

- If the referenced Stores exceed the [limit](/../api/limits#cart-discounts-stores), a [MaxStoreReferencesReached](ctp:api:type:MaxStoreReferencesReachedError) error is returned.
- If the referenced Stores exceed the [limit](/../api/limits#cart-discounts) for Cart Discounts that do not require a Discount Code, a [StoreCartDiscountsLimitReached](ctp:api:type:StoreCartDiscountsLimitReachedError) error is returned.