This method is deprecated.
Deprecated. This method will be deprecated on March 30, 2026. Replace with getInvoice().
Migration Instructions
To stay compatible with future changes, migrate to
getInvoice(). The coupon verification is now performed under the hood by the getInvoice() method.
To migrate to the new method:
Add a backend file to your site.
Write a code so that it replaces the verifyCoupon() method from the frontend with the getInvoice() method from the backend. Export your backend function so that it can be used in the frontend.
Import your backend function into the frontend file. Test your changes to make sure your code behaves as expected.
If the coupon has been verified, the VerifyCouponResponse contains
an invoice property with an invoice that includes the coupon discounts.
If the coupon fails verification, the VerifyCouponResponse contains
a discountErrors property including information about why the verification
failed.
You may want to call verifyCoupon() in an input element's onCustomValidation()
to validate a coupon code while the form is being filled out.
Note: The frontend Events APIs aren't functional when previewing a site. View a published version of a site to see their complete functionality
ID of the event that the ticket coupon is for.
ID of the reservation that the ticket coupon is for.
Code of the coupon to verify.
This method doesn't return any custom errors, but may return standard errors. Learn more about standard Wix errors.