onCouponApplied( )


Triggered when a coupon is applied.

Method Declaration
Copy
function wixMarketing_onCouponApplied(event: CouponAppliedEvent): void;
Method Parameters
eventCouponAppliedEvent
onCouponApplied example
JavaScript
export function wixMarketing_onCouponApplied(event) { const eventId = event.metadata.id; const entityId = event.data.coupon._id; }
Errors

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

Did this help?

onCouponCreated( )


Triggered when a coupon is created.

Method Declaration
Copy
function wixMarketing_onCouponCreated(event: CouponCreated): void;
Method Parameters
eventCouponCreated
onCouponCreated example
JavaScript
export function wixMarketing_onCouponCreated(event) { const eventId = event.metadata.id; const entityId = event.entity._id; }
Errors

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

Did this help?

onCouponDeleted( )


Triggered when a coupon is deleted.

Method Declaration
Copy
function wixMarketing_onCouponDeleted(event: CouponDeleted): void;
Method Parameters
eventCouponDeleted
onCouponDeleted example
JavaScript
export function wixMarketing_onCouponDeleted(event) { const eventId = event.metadata.id; const entityId = event.entity._id; }
Errors

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

Did this help?

onCouponUpdated( )


Triggered when a coupon specification is updated.

Method Declaration
Copy
function wixMarketing_onCouponUpdated(event: CouponUpdated): void;
Method Parameters
eventCouponUpdated
onCouponUpdated example
JavaScript
export function wixMarketing_onCouponUpdated(event) { const eventId = event.metadata.id; const entityId = event.entity._id; }
Errors

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

Did this help?