> 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`). > - 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/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: ' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.rewards.LoyaltyCoupons.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 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 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-hosted) Self-hosted 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); }; ``` ---