> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# DeleteLoyaltyCoupon

# Package: rewards

# Namespace: LoyaltyCoupons

# Method link: https://dev.wix.com/docs/api-reference/crm/loyalty-program/rewards/coupons/delete-loyalty-coupon.md

## Permission Scopes:
Manage Loyalty: SCOPE.DC-LOYALTY.MANAGE-LOYALTY

## Introduction

Deletes a loyalty coupon.

The deletion of a loyalty coupon does not impact the functionality of the corresponding coupon itself.

---

## REST API

### Schema

```
 Method: deleteLoyaltyCoupon
 Description: Deletes a loyalty coupon.  The deletion of a loyalty coupon does not impact the functionality of the corresponding coupon itself.
 URL: https://www.wixapis.com/loyalty-coupons/v1/coupons/{id}
 Method: DELETE
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  id
 Method parameters: 
   param name: id | type:   none | required: true 
   query param name: revision | type: revision | description: 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.  
 Return type: DeleteLoyaltyCouponResponse
  EMPTY-OBJECT {}


```

### Examples

### Delete loyalty coupon
```curl
curl -X DELETE \
  'https://www.wixapis.com/loyalty-coupons/v1/coupons/c90918b2-e9a5-4147-b4a4-953e235b9ddd?revision=1' \
  -H 'Authorization: <AUTH>'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.loyalty.coupons.deleteLoyaltyCoupon(_id, revision)
 Description: Deletes a loyalty coupon.  The deletion of a loyalty coupon does not impact the functionality of the corresponding coupon itself.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  _id, revision
 Method parameters: 
   param name: _id | type: string | description: GUID of the loyalty coupon to delete. | required: true | validation: format GUID
   param name: revision | type: number | description: 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. | required: true 
 Return type: PROMISE<DeleteLoyaltyCouponResponse>
  EMPTY-OBJECT {}


```

### Examples

### Delete loyalty coupon (with elevated permissions)
```javascript
import { coupons } from "@wix/loyalty";
import { auth } from "@wix/essentials";

/* Sample parameter values:
 *
 * {
 *     "id": "4f2973ab-b0cf-4259-b46e-33716dc26d73",
 *     "revision": "2"
 * }
 */

const elevatedDeleteLoyaltyCoupon = auth.elevate(coupons.deleteLoyaltyCoupon);

async function deleteLoyaltyCoupon(id, revision) {
  try {
    const result = await elevatedDeleteLoyaltyCoupon(id, revision);
    return result;
  } catch (error) {
    console.error(error);
    // Handle the error
  }
}

/* Promise resolves to void */
```

### Delete loyalty coupon
```javascript
import { coupons } from "@wix/loyalty";

/* Sample parameter values:
 *
 * {
 *     "id": "4f2973ab-b0cf-4259-b46e-33716dc26d73",
 *     "revision": "2"
 * }
 */

async function deleteLoyaltyCoupon(id, revision) {
  try {
    const result = await coupons.deleteLoyaltyCoupon(id, revision);
    return result;
  } catch (error) {
    console.error(error);
    // Handle the error
  }
}

/* Promise resolves to void */
```

### deleteLoyaltyCoupon (self-managed)
Self-managed SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { coupons } from '@wix/loyalty';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { coupons },
  // Include the auth strategy and host as relevant
});


async function deleteLoyaltyCoupon(_id,revision) {
  const response = await myWixClient.coupons.deleteLoyaltyCoupon(_id,revision);
};
```

---