onCouponDeleted( )


An event that is triggered when a coupon is deleted.

The onCouponDeleted() event handler runs when a coupon is deleted.

Note: Backend events don't work when previewing your site.

Method Declaration
Copy
function onCouponDeleted(event: CouponDeletedEvent): void;
Method Parameters
eventCouponDeletedEventRequired

Information about a deleted coupon.

An event when a coupon is deleted
JavaScript
// Place this code in the events.js file // of your site's Backend section. export function wixMarketing_onCouponDeleted(event) { const deletedCouponId = event.metadata.entityId; } /* Full event object * * { * "metadata": { * "id": "0c279cd0-3db2-4e5c-afb5-9b1346bf3ccc", * "entityId": "03a35393-7835-44b0-af53-6019a484b48b", * "eventTime": "2021-01-17T12:01:46.597758Z", * "triggeredByAnonymizeRequest": false * } * } * */
Errors

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

Did this help?