> 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 # Method name: listTiers() # Method package: wixLoyaltyV2 # Method menu location: wixLoyaltyV2 --> tiers --> listTiers # Method Link: https://dev.wix.com/docs/velo/apis/wix-loyalty-v2/tiers/list-tiers.md # Method Description: Retrieves a list of loyalty tiers. To retrieve a specific tier, call Get Tier. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## Get a list of loyalty tiers ```javascript import { tier } from 'wix-loyalty-backend'; export async function myListTiersFunction() { try { const tiersList = await tier.listTiers(); const firstTierId = tiersList.tiers[0]._id; const firstTierPointsRequired = tiersList.tiers[0].requiredPoints; console.log('Success! First tier ID: ', firstTierId, ' requires ', firstTierPointsRequired, ' points.'); return tiersList; } catch (error) { console.error(error); } } /* Promise resolves to: * * { * "tiers": [ * { * "tierDefinition": { * "icon": "shapes/11062b_667183149f4c40809fd860a1d7109296.svg", * "name": "Silver Tier", * "description": "Silver Tier Benefits" * }, * "_createdDate": "2024-06-06T10:33:19.121Z", * "_id": "7e26e41b-3bb6-40c9-bb7e-855b9f4f69e2", * "_updatedDate": "2024-06-11T12:17:05.000Z", * "requiredPoints": 100, * "revision": "6" * }, * { * "tierDefinition": { * "icon": "shapes/c0bec42304a6414990bfd882f637ac0a.svg", * "name": "Gold", * "description": "Gold Tier Benefits" * }, * "_createdDate": "2024-06-06T10:33:56.430Z", * "_id": "b8501f07-a34f-4608-b9b0-168e6c6c505a", * "_updatedDate": "2024-06-11T12:17:12.382Z", * "requiredPoints": 200, * "revision": "4" * }, * { * "tierDefinition": { * "icon": "shapes/43e4c49bed6b47e8a85bc1dd5fbcfd71.svg", * "name": "Diamond", * "description": "Diamond Tier Benefits" * }, * "_createdDate": "2024-06-11T12:14:14.809Z", * "_id": "a9fc3669-1cf4-4dff-8f4c-d6a22c62eadb", * "_updatedDate": "2024-06-11T12:17:24.724Z", * "requiredPoints": 500, * "revision": "2" * } * ] */ ``` ## Get a list of loyalty tiers (export from backend code) ```javascript import { Permissions, webMethod } from "wix-web-module"; import { tiers } from "wix-loyalty.v2"; export const myListTiersFunction = webMethod( Permissions.Anyone, async () => { try { const tiersList = await tiers.listTiers(); const firstTierId = tiersList.tiers[0]._id; const firstTierPointsRequired = tiersList.tiers[0].requiredPoints; console.log( "Success! First tier ID: ", firstTierId, " requires ", firstTierPointsRequired, " points.", ); return tiersList; } catch (error) { console.error(error); } }); /* Promise resolves to: * * { * "tiers": [ * { * "tierDefinition": { * "icon": "shapes/11062b_667183149f4c40809fd860a1d7109296.svg", * "name": "Silver Tier", * "description": "Silver Tier Benefits" * }, * "_createdDate": "2024-06-06T10:33:19.121Z", * "_id": "7e26e41b-3bb6-40c9-bb7e-855b9f4f69e2", * "_updatedDate": "2024-06-11T12:17:05.000Z", * "requiredPoints": 100, * "revision": "6" * }, * { * "tierDefinition": { * "icon": "shapes/c0bec42304a6414990bfd882f637ac0a.svg", * "name": "Gold", * "description": "Gold Tier Benefits" * }, * "_createdDate": "2024-06-06T10:33:56.430Z", * "_id": "b8501f07-a34f-4608-b9b0-168e6c6c505a", * "_updatedDate": "2024-06-11T12:17:12.382Z", * "requiredPoints": 200, * "revision": "4" * }, * { * "tierDefinition": { * "icon": "shapes/43e4c49bed6b47e8a85bc1dd5fbcfd71.svg", * "name": "Diamond", * "description": "Diamond Tier Benefits" * }, * "_createdDate": "2024-06-11T12:14:14.809Z", * "_id": "a9fc3669-1cf4-4dff-8f4c-d6a22c62eadb", * "_updatedDate": "2024-06-11T12:17:24.724Z", * "requiredPoints": 500, * "revision": "2" * } * ] */ ``` ---