How can I pass coupon directly to the checkout page, without the users having to enter it manually?

Modified on: Mon, 2 Aug, 2021 at 3:39 PM

For V2 checkout pages: 

If you want to pass a discount code to the checkout page URL, just make use of the following syntax:[coupon]=coupon_name


Here's a sample URL for reference:[coupon]=CBDEMO_SAVER

For V3 checkout pages:

If you are an Enterprise customer in PC 2.0, there is a new manual discounting feature. Reach out to to know more. 

You can include a coupon code to the checkout script so that it is automatically applied. It can be done similar to the example mentioned in the "Add-on customizations" section in this document. The script code to include coupons is as mentioned below.

var cbInstance = Chargebee.getInstance();

var link = document.querySelectorAll(“[data-cb-type=checkout]“)[0];

var product = cbInstance.getProduct(link);

product.addCoupon(“COUPON NAME”);

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.