Search...
deleteReward( )
Developer Preview
Deletes a reward.
Admin Method
This function requires elevated permissions to run. This function is not universal and runs only on the backend.
Syntax
function deleteReward(_id: string, revision: string): Promise<void>
deleteReward Parameters
NAME
TYPE
DESCRIPTION
_id
string
ID of the reward to delete.
revision
string
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.
Returns
Return Type:
Promise<
void
>Was this helpful?
deleteReward example
Copy Code
1import { rewards } from 'wix-loyalty.v2';23 async function deleteReward(id, revision) {4 try {5 const result = await rewards.deleteReward(id, revision);67 return result;8 } catch (error) {9 console.error(error);10 // Handle the error11 }12 }13