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';
2
3export function deleteCoupon(_id) {
4 return coupons.deleteCoupon(_id);
5}
6
7// Returns a promise that is resolved when
8// 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';
3
4export const deleteCoupon = webMethod(Permissions.Admin, (_id) => {
5 return coupons.deleteCoupon(_id);
6});
7
8// Returns a promise that is resolved when
9// the coupon is deleted.