Search...
deleteCoupon( )
Deletes a coupon.
Description
The deleteCoupon()
function returns a Promise that resolves when the specified coupon is deleted.
Admin Method
This function requires elevated permissions to run. This function is not universal and runs only on the backend.
Syntax
function deleteCoupon(_id: string): Promise<void>
deleteCoupon Parameters
NAME
TYPE
DESCRIPTION
_id
string
ID of the coupon to delete.
Returns
Return Type:
Promise<
void
>Was this helpful?
Delete a coupon (dashboard page code)
Copy Code
1import { coupons } from 'wix-marketing.v2';23export function deleteCoupon(_id) {4 return coupons.deleteCoupon(_id);5}67// Returns a promise that is resolved when8// the coupon is deleted.9
Delete a coupon (export from backend code)
Copy Code
1import { Permissions, webMethod } from 'wix-web-module';2import { coupons } from 'wix-marketing.v2';34export const deleteCoupon = webMethod(Permissions.Admin, (_id) => {5 return coupons.deleteCoupon(_id);6});78// Returns a promise that is resolved when9// the coupon is deleted.