docs
  1. Configure
  2. Promotions
  3. Managing A Promotion

Managing a Promotion (hidden)

After promotions are correctly created via Panel or via Admin API, they will have an effect on the customer's Basket and Orders.

Assigning a promotion to a Basket Item

Once a Basket with items are created, the Basket endpoint returns all applicable promotions that can be applied to that basket and to the items that belong to that basket.

To apply a promotion to a specific item, include the promotionId provided in the applicablePromotions in either the Add a Variant call or Update an Item call.

We recommend applying promotions one by one and using the response of the updated basket item (with=applicablePromotions). This ensures there are no conflicts between the promotions.

We would also recommend running this logic generally in two cases:

  • Upon the first initial load of the basket, to handle new promotions after a user comes back to the shop
  • After any Basket Action like an Add to Basket or quantity update is done by the use

Understanding Applicable Promotions

The applicable promotions array consists of all promotions that meet the conditions for and can be applied to that item.

Applicable Promotions - In Case Buy X Get Y is Applicable to a Basket Item

FieldFormatDescription
itemIdstringThe Basket Item ID to which the promotion should be applied. This can be null in case of a bux_x_get_y effect where the free item is not in the basket yet.
promotion.idstringUnique identifier of a promotion
promotion.namestringThe internal name of a promotion
promotion.displayNamestringThe name of the promotion that will be displayed to the customers across the order lifecycle
promotion.scheduleobjectSet dates which promotion are valid
promotion.isActivebooleanIdentifies if a promotion is active or not
promotion.effect.typestringbuy_x_get_y
promotion.effect.additionalData.eligibleItemsQuantityintegerDefines the quantity amount the customer needs to buy
promotion.effect.additionalData.maxCountintegerDefines how many items a customer is entitled to get a discount from
promotion.effect.additionalData.maxCountTypestring

Max Count Type defines how the quantity amount will be considered to make a promotion eligible for that basket or not.

per_eligible_items_quantity: in case this option is selected, the total quantity of items in a basket which fulfill the condition of the promotion is considered for the count

per_eligible_uniq_items: in case this option is selected, the total quantity of unique variant IDs which fulfill the condition of the promotion is considered for the count

per_item_set: in case this option is selected, the total quantity defined on the Item Set will be used

single_item: in case this option is selected, the total quantity of unit items within the same variant ID that participate in a promotion is considered for the count

promotion.effect.additionalData.variantIdsArrayVariant IDs which participate in a promotion
promotion.effect.additionalData.discountTypeStringCan be absolute or relative
promotion.effect.additionalData.discountValueIntegerDiscount amount of the promotion in cents
promotion.effect.additionalData.discountDistributionStringDefines if a discount will be distributed pro_rata or not. In case of a proportional distribution, this value will be reflected as pro_rata. Else it will be described as none.
promotion.effect.additionalData.applicableItemSelectionTypeStringDefines which item in the basket the discount will be applied to. Can be variant_ids or cheapest.
promotion.conditionsArray of objectsWill describe all conditions that are attached to the promotion
promotion.customDataobjectThe object with custom fields that are added during promotion creation
promotion.prioritynumberThe priority of the promotion compared to other promotions. This can be used to decide which promotion to apply if there is a conflict between two
promotion.tiersNot applicable for Buy X Get Y

Applicable Promotions - In Case Combo Deal is Applicable to a Basket Item

FieldFormatDescription
itemIdstringThe Basket Item ID to which the promotion should be applied
promotion.idstringUnique identifier of a promotion
promotion.namestringThe internal name of a promotion
promotion.displayNamestringThe name of the promotion that will be displayed to the customers across the order lifecycle
promotion.scheduleobjectSet dates which promotion are valid
promotion.isActivebooleanIdentifies if a promotion is active or not
promotion.effect.typeobjectcombo_deal
promotion.effect.additionalData.eligibleItemsQuantityintegerDefines the quantity amount the customer needs to buy
promotion.effect.additionalData.maxCountTypestring

Max Count Type defines how the quantity amount will be considered to make a promotion eligible for that basket or not.

per_eligible_items_quantity: in case this option is selected, the total quantity of items in a basket which fulfill the condition of the promotion is considered for the count

per_item_set: in case this option is selected, the total quantity defined on the Item Set will be used

single_item: in case this option is selected, the total quantity of unit items within the same variant ID that participate in a promotion is considered for the count

promotion.effect.additionalData.priceIntegerPrice of the deal in cents
promotion.conditionsArray of objectsWill described all conditions that are attached to the promotion
promotion.customDataobjectThe object with custom fields that are added during promotion creation
promotion.prioritynumberThe priority of the promotion compared to other promotions. This can be used to decide which promotion to apply if there is a conflict between two.
promotion.tiersNot applicable for Combo deals

Applicable Promotions - In Case Automatic Discount is Applicable to a Basket Item

FieldFormatDescription
itemIdstringThe Basket Item ID to which the promotion should be applied
promotion.idstringUnique identifier of a promotion
promotion.namestringThe internal name of a promotion
promotion.displayNamestringThe name of the promotion that will be displayed to the customers across the order lifecycle
promotion.scheduleobjectSet dates which promotion are valid
promotion.isActivebooleanIdentifies if a promotion is active or not
promotion.effect.typeobjectautomatic_discount
promotion.effect.additionalData.typestringabsolute or relative
promotion.effect.additionalData.valueIntegerDiscount amount of the promotion in cents
promotion.conditionsArray of objectsWill described all conditions that are attached to the promotion
promotion.customDataobjectThe object with custom fields that are added during promotion creation
promotion.prioritynumberThe priority of the promotion compared to other promotions. This can be used to decide which promotion to apply if there is a conflict between two
promotion.tiersarray of objectsMOV tiers related to the
promotion.tiers.idnumberThe identifier of a tier. It is unique for tiers in this promotion
promotion.tiers.movnumberThe minimum order value that would activate a tier in cents
promotion.tiers.namestringThe name of a tier
promotion.tiers.effect.additionalData.typestringThe discount type of a tier. It could be absolute or relative
promotion.tiers.effect.additionalData.valuenumberThe discount amount of a tier in cents

Managing Orders with Promotions

Promotion Information on Checkout

All promotions that are applicable to an order are shown on item level on our Checkout UI.

We highly recommend the usage of a displayName in order for the customers to identify the promotions better, as this information can also be used on E-mail templates and Invoices.

Promotion Information on GET Order endpoint and Webhooks

Since promotions will always be applied to an item, the promotion information can be found inside the items array of the Order endpoints

FieldFormatDescription
promotion.idstringUnique identifier of a promotion
promotion.namestringThe internal name of a promotion
promotion.versionstringThe version of a promotion.
promotion.displayNamestringThe name of the promotion that will be displayed to the customers across the order lifecycle
promotion.codestringThe code which was attached to a promotion

Managing list of promotions

Retrieve active promotions with matching ID using GET v1/promotions endpoint.

For details see the Storefront API Reference.

Configuring a promotion on Storefront

For details see the Storefront Configuration Document.