> 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: archivePlan(_id: string) # Method package: wixPricingPlansV2 # Method menu location: wixPricingPlansV2 --> plans --> archivePlan # Method Link: https://dev.wix.com/docs/velo/apis/wix-pricing-plans-v2/plans/archive-plan.md # Method Description: Archives a single plan. When a plan is archived, it's no longer visible as a public plan that can be chosen by site members or visitors. This is because the plan's `public` property is automatically set to `false`. Archived plans can't be purchased or reactivated. Plan archiving doesn't impact existing orders made for the plan. All orders for the plan are still active and keep their perks, payment options, and terms. Wix users can see archived plans in a site's dashboard under **Pricing Plans -> Archived Plans**. > **Note:** An attempt to archive an already-archived plan throws an error. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## Archive a plan (dashboard page code) ```javascript import { plans } from 'wix-pricing-plans.v2'; /* Sample _id value: '1421abaa-44c7-42ae-8a75-960fe7a8aa55' */ export async function myArchivePlanFunction(_id) { try { const archivedPlan = await plans.archivePlan(_id); return archivedPlan; } catch(error) { console.error(error); // Handle the error } } /* Promise resolves to: * { * "_createdDate": "2023-12-31T11:23:01.664Z", * "_id": "1421abaa-44c7-42ae-8a75-960fe7a8aa55", * "_updatedDate": "2024-01-08T11:24:18.561Z", * "allowFutureStartDate": false, * "archived": true, * "buyerCanCancel": true, * "description": "Free Plan", * "formId": "ee62cefa-bdc2-4b5d-baab-6faeef83cecb", * "hasOrders": false, * "maxPurchasesPerBuyer": 0, * "name": "Basic", * "perks": { * "values": [] * }, * "pricing": { * "price": { * "currency": "EUR", * "value": "0" * }, * "singlePaymentForDuration": { * "count": 3, * "unit": "MONTH" * } * }, * "primary": false, * "public": false, * "slug": "basic", * "termsAndConditions": "After 90 day free trial ends, your plan will end and you will need to purchase a paid plan." * } */ ``` ## Archive a plan (export from backend code) ```javascript import { Permissions, webMethod } from 'wix-web-module'; import { plans } from 'wix-pricing-plans.v2'; import { elevate } from 'wix-auth'; /* Sample _id value: '1421abaa-44c7-42ae-8a75-960fe7a8aa55' */ export const myArchivePlanFunction = webMethod(Permissions.Anyone, async (_id) => { try { const elevatedArchivePlan = elevate(plans.archivePlan); const archivedPlan = await elevatedArchivePlan(_id); return archivedPlan; } catch(error) { console.error(error); // Handle the error } }); /* Promise resolves to: * { * "_createdDate": "2023-12-31T11:23:01.664Z", * "_id": "1421abaa-44c7-42ae-8a75-960fe7a8aa55", * "_updatedDate": "2024-01-08T11:24:18.561Z", * "allowFutureStartDate": false, * "archived": true, * "buyerCanCancel": true, * "description": "Free Plan", * "formId": "ee62cefa-bdc2-4b5d-baab-6faeef83cecb", * "hasOrders": false, * "maxPurchasesPerBuyer": 0, * "name": "Basic", * "perks": { * "values": [] * }, * "pricing": { * "price": { * "currency": "EUR", * "value": "0" * }, * "singlePaymentForDuration": { * "count": 3, * "unit": "MONTH" * } * }, * "primary": false, * "public": false, * "slug": "basic", * "termsAndConditions": "After 90 day free trial ends, your plan will end and you will need to purchase a paid plan." * } */ ``` ---