deleteTier( )


Deletes a loyalty tier.

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 deleteTier(tierId: string, revision: string): Promise<void>;
Method Parameters
tierIdstringRequired

ID of the tier to delete.


revisionstringRequired

Current revision of the tier to delete.

JavaScript
import { tiers } from "wix-loyalty.v2"; import { webMethod, Permissions } from "wix-web-module"; import { elevate } from "wix-auth"; /* Sample parameter values: * * { * "tierId": "0a429348-48c3-4085-a889-6858f33ce78a", * "revision": "2" * } */ const elevatedDeleteTier = elevate(tiers.deleteTier); export const deleteTier = webMethod( Permissions.Anyone, async (tierId, revision) => { try { const result = await elevatedDeleteTier(tierId, 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?