Marketing API
Discounts

Create Product Discount

This API endpoint (POST) creates a discount for one or multiple products. If the request succeeds, it returns a Discount Object. Permissions: discounts.create Webhook event: discount-created

Body Parameters

label * string The label of the discount.



currency * string (currency-code) The currency of the discount.



percent_off * decimal The percentage discount applied to the order and/or product subtotal.



amount_off * integer The fixed discount amount applied to the order and/or product subtotal.



shipping_amount_off * integer The fixed discount amount applied to the shipping subtotal.



shipping_percent_off * decimal The percentage discount applied to the shipping subtotal.



condition * string The possible values are coupon, vouchers, all_orders, item_subtotal and item_quantity.



applies_to * string The possible values are all_products, selected_products and selected_categories.



active boolean Determines whether the discount is currently active. The default value is false.



payments array of strings payment codes The payment whitelist for the discount. When set, the discount will apply if the customer selects any of the whitelisted payments to complete a purchase.



destinations array of strings (Country Codes) The country whitelist of the discount. When set, the discount will apply if the customer's billing country matches any of the whitelisted destinations.



rule_amount integer The amount that has to be met for the discount to activate. For example, 100 items in an order or a $100 order value. Required if the condition is set to item_subtotal or item_quantity.



subscription_discount_duration string Shows how the discount will be applied for subscription products. The possible values are forever, once and repeating. The default value is once.



number_of_months integer The total number of months the discount will be applied for recurring subscriptions. Required if subscription_discount_duration is set to repeating.



domain string The id of the domain that this discount is valid for.



coupon string The coupon code, for example, BLACKFRIDAY. Required if condition is set to coupon.



coupon_max_redemptions integer The number of times the coupon can be redeemed. Available if condition is set to coupon. If not provided, then the coupon can be redeemed unlimited times.



products array of strings The Product IDs associated with the discount. Required if applies_to is set to selected_products.



categories object An object containing the categories configuration of the discount. Required if applies_to is set to selected_categories. For the category values see Product Tax Categories.

JSON



voucher_method string The possible values are autogenerated and list. Required if condition is set to vouchers.



voucher_prefix string A custom prefix to use when generating the vouchers.



number_of_vouchers integer The total number of vouchers to generate. The maximum is 1000. Required if voucher_method is set to autogenerated.



vouchers array of strings The voucher codes. Required if voucher_method is set to list.



expiry_date date-format The expiration date of the discount.