> 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: activateLoyaltyProgram() # Method package: wixLoyaltyV2 # Method menu location: wixLoyaltyV2 --> programs --> activateLoyaltyProgram # Method Link: https://dev.wix.com/docs/velo/apis/wix-loyalty-v2/programs/activate-loyalty-program.md # Method Description: Activates a loyalty program. Initially, when a loyalty program is installed, the status is set to `"DRAFT"`. You can change the program's status to `"ACTIVE"` with this method or through the [dashboard](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Floyalty-accounts/wizard/). A site's customers can only earn or redeem points while the program is `"ACTIVE"`. This method only updates the status of a loyalty program. To make other updates to the program, call Update Loyalty Program. To temporarily pause your loyalty program, call Pause Loyalty Program and see [Pausing Your Loyalty Program](https://support.wix.com/en/article/wix-loyalty-program-pausing-your-loyalty-program) for more information. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## Activate loyalty program (dashboard page code) ```javascript import { programs } from 'wix-loyalty.v2'; export async function myActivateLoyaltyProgramFunction() { const elevatedActivateProgram = wixAuth.elevate(programs.activateLoyaltyProgram) try { const myLoyaltyProgram = await elevatedActivateProgram(); 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": "Star Loyalty Program", * "pointDefinition": { * "customName": "Stars", * "icon": "shapes/39dce0a5d1ce498f95526b1390eaf585.svg", * }, * "status": "ACTIVE", * "_createdDate": "2022-05-22T08:18:32.186Z", * "_updatedDate": "2022-05-25T10:36:32.430Z" * } * } */ ``` ## Activate loyalty program (export from backend code) ```javascript import { Permissions, webMethod } from 'wix-web-module'; import { programs } from 'wix-loyalty.v2'; import { elevate } from 'wix-auth'; export const myActivateLoyaltyProgramFunction = webMethod( Permissions.Anyone, async () => { const elevatedActivateProgram = elevate(programs.activateLoyaltyProgram) try { const myLoyaltyProgram = await elevatedActivateProgram(); 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": "Star Loyalty Program", * "pointDefinition": { * "customName": "Stars", * "icon": "shapes/39dce0a5d1ce498f95526b1390eaf585.svg", * }, * "status": "ACTIVE", * "_createdDate": "2022-05-22T08:18:32.186Z", * "_updatedDate": "2022-05-25T10:36:32.430Z" * } * } */ ``` ---