Coupon codes for pricing plans

Is there any way to create a discount code for a wix pricing plan as it is something I need for my website.

1 Like

I am also interested in this topic.

exportfunction myCreateCoupon ( discount , code ){
//let couponecode = Math.trunc(Math.random() * 1000).toString() +“E”+Math.trunc(Math.random() * 1000000).toString()
let couponInfo = {
“name” : “MyCoupon” ,
“code” : code ,
“startTime” : new Date (),
“expirationTime” : new Date ( new Date (). getTime () + 24 * 60 * 60 * 1000 * 90 ),
“usageLimit” : 1 ,
“limitedToOneItem” : true ,
“limitPerCustomer” : 1 ,
“active” : true ,
“scope” : { // Coupon applies to all pricing plans
“namespace” : “pricingPlans”
},
“percentOffRate” : discount ,
}
// return {“id”:coupons.createCoupon(couponInfo),“code”:couponInfo.code};
return coupons . createCoupon ( couponInfo );
}
this the code i am using, but this has an issued the coupon is for all billing circles.

Thank you for this. Is it possible to do it just for products? I am having issues with the scope namespace key/value. I’m unsure which value to use for all products because I’m unaware of what wix means by “name space”.