Skip to main content

Discount

The Discount type is a basic discount that applies to an order or to individual products when the specified conditions are met.

The discount editor has the Basic data, Attributes, Conditions, Discount, Coupons, Gifts, Exclusions, and Version History tabs. On the Attributes tab, you can select an attribute set for the discount (Selecting a set of attributes). The Version History tab stores the discount's change history. The other tabs are described below.

General information​

When you create a discount, fill in the main fields:

  • Name: the discount name shown in the interface.
  • Marker: required. A unique string identifier to use in application code.
  • Type: Discounts (discount), Personal Discounts (personal discount), or Bonuses (bonus).

After you create the discount, open it and also set:

  • Start date: required. The date the discount takes effect.
  • End date: optional. If it isn't set, the discount never expires.

Conditions​

Conditions determine when the discount applies. You can combine several conditions with AND (all conditions must be met) or OR (one is enough); choose this in the Condition logic type field. To add a condition, click + Add condition and choose its type in the Condition type field. The list groups conditions into Static Conditions and Dynamic Conditions.

If the discount has coupons, its conditions work only when a coupon is applied.

ConditionDescription
ProductThe discount applies if the order contains the specified product
CategoryThe discount applies if the order contains a product from the specified category
Product AttributeThe discount applies if the order contains a product with certain attributes
Product (dynamic)Same as the "Product" condition, but you must pass the discount marker in additionalDiscountsMarkers
Category (dynamic)Same as the "Category" condition, but you must pass the discount marker in additionalDiscountsMarkers
Min Order AmountThe discount applies only when the order reaches the specified amount
User LTVThe discount applies based on the user's total order amount. Only orders that reached a status with the Final Success flag count
Min Order Amount

If other discounts already apply to products in the order, the minimum amount is calculated after the product discounts are applied.

For example, the minimum amount for the discount is 1000 ₽. The order has 10 products at 100 ₽ each, for a total of 1000 ₽. Each product has a 5% discount, so the order total is 950 ₽. Since 950 < 1000, the order discount doesn't apply.

Application​

On the Discount tab, configure how the discount is calculated:

  • Discount type:

    • No Discount: no discount is applied.
    • Percentage of product/order price: the discount is calculated as a percentage.
    • Fixed discount amount: the price is reduced by a fixed amount.
    • Fixed price: the product gets the specified fixed price. This option appears only if To product is selected in the Application field.
  • Value: the numeric value of the discount for the selected type. Required; a percentage can't exceed 100.

  • Maximum value: relevant for the percentage type. Sets the maximum amount of the discount, using the formula min(calculated value, maximum value). A value of 0 means no limit.

  • Application (Discount applicability):

    • To product (To Product): the discount is shown at the product level and is visible on the /products endpoints when all conditions are met.
    • To order (To Entire Order): the discount applies when an order is created or pre-calculated.

    You can choose To product only if the Conditions tab has a product, category, or product attribute condition (including a dynamic one). Without such a condition, the field is locked and the discount applies to the order.

Coupons​

You can link coupons to a discount. A discount with a coupon applies only when the request passes the coupon code in the couponCode field.

Manual coupon​

A coupon with a custom name that can be used any number of times. Allowed characters are Latin letters, digits, -, and _. The length is 3 to 20 characters. In the list of added coupons, this kind of coupon is marked Reusable.

Coupon generation​

Coupons are generated from a mask, where:

  • A is replaced with a random letter
  • 9 is replaced with a random digit

For example, the mask AAAA-9999 creates coupons such as XKBM-4721.

Along with the mask, specify the number of coupons, up to 100 per request.

Escaping characters

To keep A or 9 as is in the coupon code, put a backslash before it: \A, \9. For example, the mask PROMO\9-AAA-999 creates coupons such as PROMO9-XYZ-123.

The mask must contain at least 5 special characters (A or 9; escaped ones don't count) and be no longer than 20 characters. Besides these, the mask can contain Latin letters, digits, -, and _.

Generated coupons are single-use. The list shows whether each one has been used.

When you pre-calculate an order with a single-use coupon, the discount is shown, but the coupon isn't used. When you create an order, the coupon is marked as used and won't work again.

Gifts​

You can add gifts to a discount: products that appear in the order at a price of 0.

  • Select the Gift product from the product list.

  • The Replace cart items with gifts checkbox determines what happens if the customer adds the gift product to the order themselves:

    • Selected: the product in the order becomes free (it's replaced with the gift).
    • Cleared: the product stays paid, and another line item for the same product is added to the order at a price of 0 (as the gift).

    If the order doesn't contain this product, the gift is added to the order either way.

Exclusions​

On the Exclusions tab, you can specify products to exclude from the discount conditions ("Product", "Category", and their dynamic variants). The category and attributes on this tab only filter the products you choose from; you can't exclude an entire category. Products in the exclusions list are ignored when conditions are checked.