Changes the program status to PAUSED
.
This function requires elevated permissions and runs only on the backend and on dashboard pages.
function pauseLoyaltyProgram(): Promise<PauseLoyaltyProgramResponse>;
import { programs } from "wix-loyalty.v2";
import { webMethod, Permissions } from "wix-web-module";
import { elevate } from "wix-auth";
const elevatedPauseLoyaltyProgram = elevate(programs.pauseLoyaltyProgram);
export const pauseLoyaltyProgram = webMethod(Permissions.Anyone, async () => {
try {
const result = await elevatedPauseLoyaltyProgram();
return result;
} catch (error) {
console.error(error);
// Handle the error
}
});
/* Promise resolves to:
*
* {
* "loyaltyProgram": {
* "_createdDate": "2024-06-05T20:31:49.155Z",
* "_updatedDate": "2024-06-10T07:04:27.130Z",
* "name": "Loyalty",
* "pointDefinition": {
* "icon": "shapes/8de7ee72dcd944caa60f9e226d900f1d.svg"
* },
* "premiumFeatures": {
* "loyaltyProgram": true,
* "tiers": true,
* "pointsExpiration": true
* },
* "pointsExpiration": {
* "status": "ENABLED",
* "monthsOfInactivity": 3,
* "expiringPointsPercentage": 100
* },
* "status": "PAUSED"
* }
* }
*/
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.