deleteReward( )


Deletes a reward.

Authentication

This function requires elevated permissions and runs only on the backend and on dashboard pages.

Permissions
Manage Loyalty
Learn more about app permissions.
Method Declaration
Copy
function deleteReward(_id: string, revision: string): Promise<void>;
Method Parameters
_idstringRequired

ID of the reward to delete.


revisionstringRequired

Revision number, which increments by 1 each time the reward is updated.

To prevent conflicting changes, the current revision must be passed when deleting the reward.

JavaScript
import { rewards } from "wix-loyalty.v2"; async function deleteReward(id, revision) { try { const result = await rewards.deleteReward(id, revision); return result; } catch (error) { console.error(error); // Handle the error } }
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?