Skip to main content

Discount

The Discount type is a basic discount that is applied to an order or individual items when certain conditions are met.

The discount editor consists of the tabs Basic data, Attributes, Conditions, Discount, Coupons, Gifts, Exclusions, and Version History. In the Attributes tab, you can select a set of attributes for the discount (Selecting a set of attributes), and the Version History tab stores the history of changes to the discount. The other tabs are described below.

General Information​

When creating a discount, fill in the main fields:

  • Name — the name of the discount for display in the interface.
  • Marker — a required field. A unique string identifier for use in the application code.
  • Type — Discounts (discount), Personal Discounts (personal discount), or Bonuses (bonus).

After creation, within the discount, you also need to specify:

  • Start Date — a required field. The date from which the discount becomes effective.
  • End Date — an optional field. If not specified, the discount is valid indefinitely.

Conditions​

Conditions determine when the discount will be applied. Multiple conditions can be combined using the AND rule (all conditions must be met) or OR (at least one is sufficient).

ConditionDescription
ProductThe discount is applied if the specified product is in the order
CategoryThe discount is applied if there is a product from the specified category in the order
Product AttributeThe discount is applied if there is a product with certain attributes in the order
Product (dynamic)Similar to the "Product" condition, but requires passing the discount marker in additionalDiscountsMarkers
Category (dynamic)Similar to the "Category" condition, but requires passing the discount marker in additionalDiscountsMarkers
Minimum Order AmountThe discount is applied only when the specified order amount is reached
User LTVThe discount is applied based on the total amount of user payments
Minimum Order Amount

If other discounts are already applied to the items in the order, the minimum amount is calculated after applying discounts to the items.

For example: the minimum amount for the discount is 1000 ₽. The order has 10 items at 100 ₽ each = 1000 ₽. However, each item has a 5% discount, making the total order amount 950 ₽. Since 950 < 1000, the discount for the entire order is not applied.

Application​

In the Discount tab, configure how the discount will be calculated:

  • Discount Type:

    • No discount — the discount is not applied.
    • Percentage of product/order cost — the discount is calculated as a percentage.
    • Fixed discount amount — a fixed price reduction.
    • Fixed price — the product will have the specified fixed price. This option appears only if To product is selected in the Application field.
  • Value — the numerical value of the discount according to the selected type.

  • Maximum Value — relevant for percentage type. Defines the maximum amount that the discount can reach. The formula used is: min(calculated value, maximum value). A value of 0 means no limit.

  • Application:

    • To product — the discount is displayed at the product level and is visible on the /products endpoints when all conditions are met.
    • To order — the discount is applied when creating or pre-calculating the order.

Coupons​

Coupons can be linked to the discount. A discount with a coupon is applied only when the coupon code is passed in the couponCode field of the request.

Manual Coupon​

A coupon with a custom name that can be used an unlimited number of times. Allowed characters: Latin letters, digits, - and _; length — from 3 to 50 characters. In the list of added coupons, such a coupon is marked as Reusable.

Coupon Generation​

Coupon generation based on a mask, where:

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

For example, the mask AAAA-9999 will create coupons like XKBM-4721.

In addition to the mask, specify the number of coupons — no more than 100 per request.

Escaping Characters

If you need to keep the character A or 9 literally in the coupon code, place a backslash before it: \A, \9. For example, the mask PROMO\9-AAA-999 will create coupons like PROMO9-XYZ-123.

The mask must contain at least 5 special characters (A or 9; escaped ones do not count) and be no longer than 20 characters. In addition to these, the mask may include Latin letters, digits, -, _, and /.

Generated coupons are one-time use: in the list, it is visible whether each has been used or not.

When pre-calculating an order with a one-time coupon, the discount will be shown, but the coupon will not be used. When creating an order, the coupon is marked as used and will not work again.

Gifts​

Gifts can be added to the discount — products that will appear in the order at a price of 0.

  • Gift product is selected from the list of products.
  • Replace cart items with gifts — the checkbox determines what happens if the customer adds the same product to the order that is a gift:
    • Checked — the product in the order becomes free (replaced with the gift).
    • Unchecked — the product remains paid, and another item of the same product is added to the order at a price of 0 (as a gift).

Exclusions​

In the Exclusions tab, you can specify products that will be excluded from the discount conditions (the "Product", "Category", and their dynamic variants). The category and attributes on this tab serve only as filters for selecting products — an entire category cannot be excluded. Products from the exclusions list will not be considered when checking conditions.