> 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: getLoyaltyProgram() # Method package: wixLoyaltyV2 # Method menu location: wixLoyaltyV2 --> programs --> getLoyaltyProgram # Method Link: https://dev.wix.com/docs/velo/apis/wix-loyalty-v2/programs/get-loyalty-program.md # Method Description: Retrieves the loyalty program. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## Get loyalty program ```javascript import { programs } from 'wix-loyalty.v2'; export async function myGetLoyaltyProgramFunction() { try { const myLoyaltyProgram = await programs.getLoyaltyProgram(); const name = myLoyaltyProgram.loyaltyProgram.name; const status = myLoyaltyProgram.loyaltyProgram.status; console.log('Success! The status of your loyalty program is:', status); return myLoyaltyProgram; } catch (error) { console.error(error); } } /* Promise resolves to: * { * "loyaltyProgram": { * "name": "Frequent Flower Program", * "pointDefinition": { * "customName": "Petals", * "icon": "shapes/8de38e8fe76f4e9f937ae23e9ba1eb04.svg" * }, * "status": "ACTIVE", * "_createdDate": "2022-11-07T15:26:12.798Z", * "_updatedDate": "2022-11-09T10:00:42.018Z" * } * } */ ``` ## Get loyalty program (export from backend code) ```javascript import { Permissions, webMethod } from 'wix-web-module'; import { programs } from 'wix-loyalty.v2'; export const myGetLoyaltyProgramFunction = webMethod(P ermissions.Anyone, async () => { try { const myLoyaltyProgram = await programs.getLoyaltyProgram(); const name = myLoyaltyProgram.loyaltyProgram.name; const status = myLoyaltyProgram.loyaltyProgram.status; console.log('Success! The status of your loyalty program is:', status); return myLoyaltyProgram; } catch (error) { console.error(error); } }); /* Promise resolves to: * { * "loyaltyProgram": { * "name": "Frequent Flower Program", * "pointDefinition": { * "customName": "Petals", * "icon": "shapes/8de38e8fe76f4e9f937ae23e9ba1eb04.svg" * }, * "status": "ACTIVE", * "_createdDate": "2022-11-07T15:26:12.798Z", * "_updatedDate": "2022-11-09T10:00:42.018Z" * } * } */ ``` ---