Skip to main content

Create Discount

Definition

Create various kinds of discounts.
This activity is used when you want to make offers to customers.
We provided all the required properties in this activity so you can generate every kind of discount.
You can create a personalized discount for a specific customer or you can also create one discount for all of the customers. In some of our built-in workflows such as Wishlist Marketing, this activity is used.

tip

You can generate random coupon code with javascript. An example of this can be found in the Birthday Emails workflow.

Properties

PropertyDescription
Discount NameThe name of the discount.
Discount TypeType of the discount.
Assigned to IDsProducts/Categories/Manufacturers comma seperated IDs.
Use PercentageWhether use percentage.
Discount PercentageDiscount percentage value (used with "UsePercentage").
Maximum Discount AmountThe maximum discount amount (used with "UsePercentage").
Discount AmountThe amount of the discount.
Requires Coupon CodeWhether discount requires coupon code.
Coupon CodeThe discount coupon code.
Start Date UTCDiscount start date (UTC).
End Date UTCDiscount end date (UTC).
Is CumulativeWhether discount can be used simultaneously with other discounts (with the same discount type).
Discount LimitationLimitaion type of the discount.
Limitation TimesThe discount limitation times (used when Limitation is set to "N Times Only" or "N Times Per Customer").
Maximum Discounted QuantityThe maximum product quantity which could be discounted Used with "Assigned to products" or "Assigned to categories" type.

Outcomes

OutcomeDescription
DoneReturns the output model.

Output Model

{
Name: string,
DiscountType: number // AssignedToOrderTotal = 1, AssignedToSkus = 2, AssignedToCategories = 5, AssignedToManufacturers = 6, AssignedToShipping = 10, AssignedToOrderSubTotal = 20,
UsePercentage: boolean,
DiscountPercentage: number,
DiscountAmount: number,
MaximumDiscountAmount?: number,
StartDateUtc?: Date,
EndDateUtc?: Date,
RequiresCouponCode: boolean,
CouponCode: string,
IsCumulative: boolean,
DiscountLimitationId: number,
LimitationTimes: number,
MaximumDiscountedQuantity?: number,
AppliedToSubCategories: boolean,
DiscountLimitationType: number, // Unlimited = 0, NTimesOnly = 15, NTimesPerCustomer = 25
AppliedToProductIds: number[]
}