Gets statistics about the pricing plans. Currently provides only the total number of pricing plans, including archived plans.
This function requires elevated permissions and runs only on the backend and on dashboard pages.
function getPlanStats(): Promise<GetPlanStatsResponse>;
import { plans } from "wix-pricing-plans.v2";
export async function myGetPlanStatsFunction() {
try {
const planStats = plans.getPlanStats();
return planStats;
} catch (error) {
console.error(error);
// Handle the error
}
}
/* Promise resolves to:
* {
* "totalPlans": 8
* }
*/
There is 1 error with this status code.
This method may also return standard errors. Learn more about standard Wix errors.