Search...
deleteLoyaltyCoupon( )
Developer Preview
Deletes a loyalty coupon.
Description
The deletion of a loyalty coupon does not impact the functionality of the corresponding coupon itself.
Admin Method
This function requires elevated permissions to run. This function is not universal and runs only on the backend.
Syntax
function deleteLoyaltyCoupon(_id: string, revision: string): Promise<void>
deleteLoyaltyCoupon Parameters
NAME
TYPE
DESCRIPTION
_id
string
ID of the loyalty coupon to delete.
revision
string
Revision number, which increments by 1 each time the loyalty coupon is updated.
To prevent conflicting changes, the current `revision`` must be passed when updating the loyalty coupon.
Returns
Return Type:
Promise<
void
>Was this helpful?
deleteLoyaltyCoupon example
Copy Code
1import { coupons } from 'wix-loyalty.v2';23 async function deleteLoyaltyCoupon(id, revision) {4 try {5 const result = await coupons.deleteLoyaltyCoupon(id, revision);67 return result;8 } catch (error) {9 console.error(error);10 // Handle the error11 }12 }13