> 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 # BulkUpdatePlans # Package: pricingPlans # Namespace: PlanService # Method link: https://dev.wix.com/docs/api-reference/business-solutions/pricing-plans/plans-v3/bulk-update-plans.md ## Permission Scopes: Manage Pricing Plans: SCOPE.DC-PAIDPLANS.MANAGE-PLANS Manage Pricing Plans: SCOPE.DC-PAIDPLANS.MANAGE-PLANS ## Introduction Updates multiple plans at once. You can't change plan names with this method. To update a single plan, call Update Plan. --- ## REST API ### Schema ``` Method: bulkUpdatePlans Description: Updates multiple plans at once. You can't change plan names with this method. To update a single plan, call Update Plan. URL: https://www.wixapis.com/pricing-plans/v3/bulk/plans/update Method: POST # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: plans, plans.plan, plans.plan.id, plans.plan.revision Method parameters: param name: plans | type: array | description: Plans to update. | required: true - name: plan | type: Plan | description: Plan to update. | required: true - name: id | type: string | description: Plan GUID. | required: true - name: revision | type: string | description: Revision number, which increments by 1 each time the plan is updated. | required: true - name: name | type: string | description: Plan name displayed to customers. - name: description | type: string | description: Plan description that explains what customers get with this plan. - name: image | type: Image | description: Plan image displayed during checkout and on the site's **Plans & Pricing** page. - name: id | type: string | description: WixMedia image GUID. - name: altText | type: string | description: Image alt text. - name: slug | type: string | description: Unique identifier for this plan within the Wix site. If not provided, generated automatically from the plan name. - name: termsAndConditions | type: string | description: Terms and conditions text that customers must agree to when purchasing this plan. - name: maxPurchasesPerBuyer | type: integer | description: Maximum number of times the same customer can purchase this plan. Use `0` for unlimited purchases or `1` to limit to one purchase per customer. - name: perks | type: array | description: List of text snippets describing what the plan offers. For display purposes only. - name: id | type: string | description: Perk GUID. - name: description | type: string | description: Perk description. - name: visibility | type: Visibility | description: Plan visibility. - enum: - PUBLIC: Plan is visible and available for purchase by all customers. - PRIVATE: Plan isn't visible to new customers unless they get a specific link to the plan. Existing buyers can continue using it. - name: buyable | type: boolean | description: Whether customers can currently purchase this plan. If set to `false`, customer won't be able to buy a plan themselves. In this case a Wix user has to assign the plan through the [dashboard](https://support.wix.com/en/article/pricing-plans-selling-plans-offline). - name: formId | type: string | description: GUID of the form associated with the plan at checkout. - name: buyerCanCancel | type: boolean | description: Whether buyers can cancel their subscription to this plan. - name: extendedFields | type: ExtendedFields | description: Data extensions. Learn more about [extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions.md). - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured. You can only access fields for which you have the appropriate permissions. Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md). param name: returnEntity | type: returnEntity | description: Set the value to `true` to receive details of the updated plans. Return type: BulkUpdatePlansResponse - name: results | type: array | description: Updated plans. - name: itemMetadata | type: ItemMetadata | description: Metadata for a specific updated item. - name: id | type: string | description: Item GUID. Should always be available, unless it's impossible (for example, when failing to create an item). - name: originalIndex | type: integer | description: Index of the item within the request array. Allows for correlation between request and response items. - name: success | type: boolean | description: Whether the requested action was successful for this item. When `false`, the `error` field is populated. - name: error | type: ApplicationError | description: Details about the error in case of failure. - name: code | type: string | description: Error code. - name: description | type: string | description: Description of the error. - name: data | type: object | description: Data related to the error. - name: item | type: Plan | description: Updated plan details. Only returned if the `returnEntity` field was set to `true`. - name: id | type: string | description: Plan GUID. - name: revision | type: string | description: Revision number, which increments by 1 each time the plan is updated. - name: createdDate | type: string | description: Date and time the plan was created. - name: updatedDate | type: string | description: Date and time the plan was last updated. - name: name | type: string | description: Plan name displayed to customers. - name: description | type: string | description: Plan description that explains what customers get with this plan. - name: image | type: Image | description: Plan image displayed during checkout and on the site's **Plans & Pricing** page. - name: id | type: string | description: WixMedia image GUID. - name: height | type: integer | description: Original image height. - name: width | type: integer | description: Original image width. - name: altText | type: string | description: Image alt text. - name: slug | type: string | description: Unique identifier for this plan within the Wix site. If not provided, generated automatically from the plan name. - name: termsAndConditions | type: string | description: Terms and conditions text that customers must agree to when purchasing this plan. - name: maxPurchasesPerBuyer | type: integer | description: Maximum number of times the same customer can purchase this plan. Use `0` for unlimited purchases or `1` to limit to one purchase per customer. - name: perks | type: array | description: List of text snippets describing what the plan offers. For display purposes only. - name: id | type: string | description: Perk GUID. - name: description | type: string | description: Perk description. - name: visibility | type: Visibility | description: Plan visibility. - enum: - PUBLIC: Plan is visible and available for purchase by all customers. - PRIVATE: Plan isn't visible to new customers unless they get a specific link to the plan. Existing buyers can continue using it. - name: buyable | type: boolean | description: Whether customers can currently purchase this plan. If set to `false`, customer won't be able to buy a plan themselves. In this case a Wix user has to assign the plan through the [dashboard](https://support.wix.com/en/article/pricing-plans-selling-plans-offline). - name: formId | type: string | description: GUID of the form associated with the plan at checkout. - name: buyerCanCancel | type: boolean | description: Whether buyers can cancel their subscription to this plan. - name: currency | type: string | description: Three-letter currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format. - name: extendedFields | type: ExtendedFields | description: Data extensions. Learn more about [extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions.md). - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured. You can only access fields for which you have the appropriate permissions. Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md). - name: bulkActionMetadata | type: BulkActionMetadata | description: Action metadata. - name: totalSuccesses | type: integer | description: Number of items that were successfully processed. - name: totalFailures | type: integer | description: Number of items that couldn't be processed. - name: undetailedFailures | type: integer | description: Number of failures without details because detailed failure threshold was exceeded. Possible Errors: HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: BULK_UPDATE_NOT_SUPPORTED | Description: Bulk update doesn't support updating plan names. Use Update Plan instead. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: REQUIRED_FIELD | Description: The `slug` field can't be empty. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: AT_LEAST_ONE_ACTIVE_VARIANT | Description: At least one pricing variant must be active. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: PERK_IDS_UNIQUE | Description: All perk GUIDs in the plan must be unique. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: FEE_IDS_UNIQUE | Description: All fee GUIDs in the plan must be unique. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: PRICING_VARIANT_IDS_UNIQUE | Description: All pricing variant GUIDs in the plan must be unique. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: CYCLES_COMPLETED_END_OPTION_IS_APPLICABLE | Description: Plans with `endType` set to `CYCLES_COMPLETED` must specify the number of billing cycles. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: FREE_TRIAL_IS_APPLICABLE | Description: Only recurring paid plans can have a free trial. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: FREE_PRICING_VARIANT_IS_NOT_RECURRING | Description: Recurring plans can't be free. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: VALID_PLAN_DURATION | Description: Plan duration can't exceed 10 years. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: VALID_BILLING_CYCLE | Description: Billing cycle must be at least 7 days and can't exceed 10 years. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: NAME_NOT_BLANK | Description: Plan or fee `name` can't be blank. ``` ### Examples ### Bulk Update Plans ```curl curl -X POST \ 'https://www.wixapis.com/pricing-plans/v3/bulk/plans/update' \ -H 'Authorization: ' \ -H 'Content-Type: application/json' \ -d '{ "plans": [ { "id": "5d1c47f5-0ec7-4c9c-9f9c-a87be388e3f9", "revision": "1", "pricingVariants": [ { "id": "6304bd66-128e-454e-8c95-e389b78cc7e1", "name": "Monthly", "billingTerms": { "startType": "ON_PURCHASE", "endType": "UNTIL_CANCELLED" }, "pricingStrategies": [ { "flatRate": { "amount": "2.99" } } ] } ] }, { "id": "bece39da-e515-4e31-8fc1-79edcbb3b57e", "revision": "1", "pricingVariants": [ { "id": "30f9715d-7e02-420f-a13a-087cbf5f5790", "name": "Single", "billingTerms": { "startType": "ON_PURCHASE", "endType": "UNTIL_CANCELLED" }, "pricingStrategies": [ { "flatRate": { "amount": "8.99" } } ] } ] } ], "returnEntity": true }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.pricingPlans.PlanService.bulkUpdatePlans(plans, options) Description: Updates multiple plans at once. You can't change plan names with this method. To update a single plan, call Update Plan. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: plans, plans.plan, plans.plan._id, plans.plan.revision Method parameters: param name: options | type: BulkUpdatePlansOptions none - name: returnEntity | type: boolean | description: Set the value to `true` to receive details of the updated plans. param name: plans | type: array | description: Plans to update. | required: true - name: plan | type: Plan | description: Plan to update. | required: true - name: _id | type: string | description: Plan GUID. | required: true - name: revision | type: string | description: Revision number, which increments by 1 each time the plan is updated. | required: true - name: name | type: string | description: Plan name displayed to customers. - name: description | type: string | description: Plan description that explains what customers get with this plan. - name: image | type: string | description: Plan image displayed during checkout and on the site's **Plans & Pricing** page. - name: slug | type: string | description: Unique identifier for this plan within the Wix site. If not provided, generated automatically from the plan name. - name: termsAndConditions | type: string | description: Terms and conditions text that customers must agree to when purchasing this plan. - name: maxPurchasesPerBuyer | type: integer | description: Maximum number of times the same customer can purchase this plan. Use `0` for unlimited purchases or `1` to limit to one purchase per customer. - name: perks | type: array | description: List of text snippets describing what the plan offers. For display purposes only. - name: _id | type: string | description: Perk GUID. - name: description | type: string | description: Perk description. - name: visibility | type: Visibility | description: Plan visibility. - enum: - PUBLIC: Plan is visible and available for purchase by all customers. - PRIVATE: Plan isn't visible to new customers unless they get a specific link to the plan. Existing buyers can continue using it. - name: buyable | type: boolean | description: Whether customers can currently purchase this plan. If set to `false`, customer won't be able to buy a plan themselves. In this case a Wix user has to assign the plan through the [dashboard](https://support.wix.com/en/article/pricing-plans-selling-plans-offline). - name: formId | type: string | description: GUID of the form associated with the plan at checkout. - name: buyerCanCancel | type: boolean | description: Whether buyers can cancel their subscription to this plan. - name: extendedFields | type: ExtendedFields | description: Data extensions. Learn more about [extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions.md). - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured. You can only access fields for which you have the appropriate permissions. Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md). Return type: PROMISE - name: results | type: array | description: Updated plans. - name: itemMetadata | type: ItemMetadata | description: Metadata for a specific updated item. - name: _id | type: string | description: Item GUID. Should always be available, unless it's impossible (for example, when failing to create an item). - name: originalIndex | type: integer | description: Index of the item within the request array. Allows for correlation between request and response items. - name: success | type: boolean | description: Whether the requested action was successful for this item. When `false`, the `error` field is populated. - name: error | type: ApplicationError | description: Details about the error in case of failure. - name: code | type: string | description: Error code. - name: description | type: string | description: Description of the error. - name: data | type: object | description: Data related to the error. - name: item | type: Plan | description: Updated plan details. Only returned if the `returnEntity` field was set to `true`. - name: _id | type: string | description: Plan GUID. - name: revision | type: string | description: Revision number, which increments by 1 each time the plan is updated. - name: _createdDate | type: Date | description: Date and time the plan was created. - name: _updatedDate | type: Date | description: Date and time the plan was last updated. - name: name | type: string | description: Plan name displayed to customers. - name: description | type: string | description: Plan description that explains what customers get with this plan. - name: image | type: string | description: Plan image displayed during checkout and on the site's **Plans & Pricing** page. - name: slug | type: string | description: Unique identifier for this plan within the Wix site. If not provided, generated automatically from the plan name. - name: termsAndConditions | type: string | description: Terms and conditions text that customers must agree to when purchasing this plan. - name: maxPurchasesPerBuyer | type: integer | description: Maximum number of times the same customer can purchase this plan. Use `0` for unlimited purchases or `1` to limit to one purchase per customer. - name: perks | type: array | description: List of text snippets describing what the plan offers. For display purposes only. - name: _id | type: string | description: Perk GUID. - name: description | type: string | description: Perk description. - name: visibility | type: Visibility | description: Plan visibility. - enum: - PUBLIC: Plan is visible and available for purchase by all customers. - PRIVATE: Plan isn't visible to new customers unless they get a specific link to the plan. Existing buyers can continue using it. - name: buyable | type: boolean | description: Whether customers can currently purchase this plan. If set to `false`, customer won't be able to buy a plan themselves. In this case a Wix user has to assign the plan through the [dashboard](https://support.wix.com/en/article/pricing-plans-selling-plans-offline). - name: formId | type: string | description: GUID of the form associated with the plan at checkout. - name: buyerCanCancel | type: boolean | description: Whether buyers can cancel their subscription to this plan. - name: currency | type: string | description: Three-letter currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format. - name: extendedFields | type: ExtendedFields | description: Data extensions. Learn more about [extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions.md). - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured. You can only access fields for which you have the appropriate permissions. Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md). - name: bulkActionMetadata | type: BulkActionMetadata | description: Action metadata. - name: totalSuccesses | type: integer | description: Number of items that were successfully processed. - name: totalFailures | type: integer | description: Number of items that couldn't be processed. - name: undetailedFailures | type: integer | description: Number of failures without details because detailed failure threshold was exceeded. Possible Errors: HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: BULK_UPDATE_NOT_SUPPORTED | Description: Bulk update doesn't support updating plan names. Use Update Plan instead. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: REQUIRED_FIELD | Description: The `slug` field can't be empty. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: AT_LEAST_ONE_ACTIVE_VARIANT | Description: At least one pricing variant must be active. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: PERK_IDS_UNIQUE | Description: All perk GUIDs in the plan must be unique. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: FEE_IDS_UNIQUE | Description: All fee GUIDs in the plan must be unique. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: PRICING_VARIANT_IDS_UNIQUE | Description: All pricing variant GUIDs in the plan must be unique. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: CYCLES_COMPLETED_END_OPTION_IS_APPLICABLE | Description: Plans with `endType` set to `CYCLES_COMPLETED` must specify the number of billing cycles. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: FREE_TRIAL_IS_APPLICABLE | Description: Only recurring paid plans can have a free trial. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: FREE_PRICING_VARIANT_IS_NOT_RECURRING | Description: Recurring plans can't be free. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: VALID_PLAN_DURATION | Description: Plan duration can't exceed 10 years. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: VALID_BILLING_CYCLE | Description: Billing cycle must be at least 7 days and can't exceed 10 years. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: NAME_NOT_BLANK | Description: Plan or fee `name` can't be blank. ``` ### Examples ### bulkUpdatePlans ```javascript import { plansV3 } from '@wix/pricing-plans'; async function bulkUpdatePlans(plans,options) { const response = await plansV3.bulkUpdatePlans(plans,options); }; ``` ### bulkUpdatePlans (with elevated permissions) ```javascript import { plansV3 } from '@wix/pricing-plans'; import { auth } from '@wix/essentials'; async function myBulkUpdatePlansMethod(plans,options) { const elevatedBulkUpdatePlans = auth.elevate(plansV3.bulkUpdatePlans); const response = await elevatedBulkUpdatePlans(plans,options); } ``` ### bulkUpdatePlans (self-hosted) Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md). ```javascript import { createClient } from '@wix/sdk'; import { plansV3 } from '@wix/pricing-plans'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { plansV3 }, // Include the auth strategy and host as relevant }); async function bulkUpdatePlans(plans,options) { const response = await myWixClient.plansV3.bulkUpdatePlans(plans,options); }; ``` ---