verifyCoupon( )


Deprecated

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:

  1. Add a backend file to your site.

  2. 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.

  3. 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

Method Declaration
Copy
Method Parameters
eventIdstringRequired

ID of the event that the ticket coupon is for.


reservationIdstringRequired

ID of the reservation that the ticket coupon is for.


couponstringRequired

Code of the coupon to verify.

Returns
Return Type:Promise<VerifyCouponResponse>
Errors

This method doesn't return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?