> 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 # GetTier # Package: loyaltyProgramManagement # Namespace: LoyaltyTiers # Method link: https://dev.wix.com/docs/api-reference/crm/loyalty-program/loyalty-program-management/tiers/get-tier.md ## Permission Scopes: Read Loyalty: SCOPE.DC-LOYALTY.READ-LOYALTY ## Introduction Retrieves a specified loyalty tier. To retrieve a list of all of a site's tiers, use List Tiers. --- ## REST API ### Schema ``` Method: getTier Description: Retrieves a specified loyalty tier. To retrieve a list of all of a site's tiers, use List Tiers. URL: https://www.wixapis.com/v1/tiers/{tierId} Method: GET # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: tierId Method parameters: param name: tierId | type: none | required: true Return type: GetTierResponse - name: tier | type: Tier | description: Retrieved loyalty tier. - name: id | type: string | description: Tier GUID. - name: tierDefinition | type: TierDefinition | description: Information about the tier. - name: icon | type: Image | description: Details about the tier icon. - name: id | type: string | description: WixMedia image GUID. - name: url | type: string | description: Image URL. - name: height | type: integer | description: Original image height. - name: width | type: integer | description: Original image width. - name: altText | type: string | description: Image alt text. - name: filename | type: string | description: Image filename. - name: name | type: string | description: Tier name. - name: description | type: string | description: Tier description. - name: requiredPoints | type: integer | description: The amount of points required to be in this tier. - name: revision | type: string | description: Revision number, which increments by 1 each time the loyalty tier is updated. To prevent conflicting changes, the current `revision` must be passed when updating the loyalty tier. - name: createdDate | type: string | description: Date and time the tier was created. - name: updatedDate | type: string | description: Date and time the tier was last updated. ``` ### Examples ### Get tier ```curl curl -X GET \ 'https://www.wixapis.com/loyalty-tiers/v1/tiers/acddc0e0-5e27-4a1b-a52d-b3785ac258cb' \ -H 'Authorization: ' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.loyaltyProgramManagement.LoyaltyTiers.getTier(tierId) Description: Retrieves a specified loyalty tier. To retrieve a list of all of a site's tiers, use List Tiers. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: tierId Method parameters: param name: tierId | type: string | description: GUID of the tier to retrieve. | required: true Return type: PROMISE - name: _id | type: string | description: Tier GUID. - name: tierDefinition | type: TierDefinition | description: Information about the tier. - name: icon | type: string | description: Details about the tier icon. - name: name | type: string | description: Tier name. - name: description | type: string | description: Tier description. - name: requiredPoints | type: integer | description: The amount of points required to be in this tier. - name: revision | type: string | description: Revision number, which increments by 1 each time the loyalty tier is updated. To prevent conflicting changes, the current `revision` must be passed when updating the loyalty tier. - name: _createdDate | type: Date | description: Date and time the tier was created. - name: _updatedDate | type: Date | description: Date and time the tier was last updated. ``` ### Examples ### Get tier ```javascript import { tiers } from "@wix/loyalty"; /* Sample tierId value: * * { * "tierId": "f882b4b5-44c4-42b4-a380-9662b55bbe71" * } */ async function getTier(tierId) { try { const result = await tiers.getTier(tierId); return result; } catch (error) { console.error(error); // Handle the error } } /* Promise resolves to: * * { * "_createdDate": "2024-06-10T07:07:35.686Z", * "_id": "f882b4b5-44c4-42b4-a380-9662b55bbe71", * "_updatedDate": "2024-06-10T07:07:35.686Z", * "requiredPoints": 40, * "revision": "1", * "tierDefinition": { * "name": "Super API Tier", * "description": "Tiers created from API" * } * } */ ``` ### getTier (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 { tiers } from '@wix/loyalty'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { tiers }, // Include the auth strategy and host as relevant }); async function getTier(tierId) { const response = await myWixClient.tiers.getTier(tierId); }; ``` ---