> 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

# BulkUpdatePlanTags

# Package: pricingPlans

# Namespace: PlanService

# Method link: https://dev.wix.com/docs/api-reference/business-solutions/pricing-plans/plans-v3/bulk-update-plan-tags.md

## Permission Scopes:
Manage Pricing Plans: SCOPE.DC-PAIDPLANS.MANAGE-PLANS

## Introduction

Adds or removes tags on multiple plans.

Specify which tags to assign and which tags to unassign. A tag that appears in both the list to
assign and the list to unassign is assigned. Tags that don't exist are ignored.

---

## REST API

### Schema

```
 Method: bulkUpdatePlanTags
 Description: Adds or removes tags on multiple plans.  Specify which tags to assign and which tags to unassign. A tag that appears in both the list to assign and the list to unassign is assigned. Tags that don't exist are ignored.
 URL: https://www.wixapis.com/pricing-plans/v3/bulk/plans/update-tags
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  planIds
 Method parameters: 
   param name: assignTags | type: Tags | description: Common object for tags. Should be used as in this example: message Foo { string id = 1; ... Tags tags = 5 }  example of taggable entity { id: "123" tags: { public_tags: { tag_ids:["11","22"] }, private_tags: { tag_ids: ["33", "44"] } } }  
        - name: privateTags | type: TagList | description: Tags that require an additional permission in order to access them, normally not given to site members or visitors.  
           - name: tagIds | type: array<string> | description: List of tag GUIDs  | validation: maxItems 100, maxLength 5
        - name: publicTags | type: TagList | description: Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors.  
   param name: planIds | type: array<planIds> | description: IDs of plans whose tags to update. | required: true | validation: minItems 1, maxItems 100, format GUID
   param name: unassignTags | type: Tags | description: Common object for tags. Should be used as in this example: message Foo { string id = 1; ... Tags tags = 5 }  example of taggable entity { id: "123" tags: { public_tags: { tag_ids:["11","22"] }, private_tags: { tag_ids: ["33", "44"] } } }  
        - name: privateTags | type: TagList | description: Tags that require an additional permission in order to access them, normally not given to site members or visitors.  
        - name: publicTags | type: TagList | description: Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors.  
 Return type: BulkUpdatePlanTagsResponse
  - name: results | type: array<BulkUpdatePlanTagsResult> | description: Tag update results.  | validation: minItems 1, maxItems 100
     - name: itemMetadata | type: ItemMetadata | description: Metadata for a specific updated plan.  
        - name: id | type: string | description: Item GUID. Should always be available, unless it's impossible (for example, when failing to create an item).  | validation: format GUID
        - 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: 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: EMPTY_ASSIGN_AND_UNASSIGN_LISTS | Description: Neither `assignTags` nor `unassignTags` contains any tag GUIDs.


```

### Examples

### Bulk Update Plan Tags
Assigns a private tag to two plans and unassigns another private tag from them.

```curl
curl -X POST \
'https://www.wixapis.com/pricing-plans/v3/bulk/plans/update-tags' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "planIds": [
    "5d1c47f5-0ec7-4c9c-9f9c-a87be388e3f9",
    "bece39da-e515-4e31-8fc1-79edcbb3b57e"
  ],
  "assignTags": {
    "privateTags": {
      "tagIds": [
        "vN3xQ"
      ]
    }
  },
  "unassignTags": {
    "privateTags": {
      "tagIds": [
        "gY7dW"
      ]
    }
  }
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.pricingPlans.plansV3.bulkUpdatePlanTags(planIds, options)
 Description: Adds or removes tags on multiple plans.  Specify which tags to assign and which tags to unassign. A tag that appears in both the list to assign and the list to unassign is assigned. Tags that don't exist are ignored.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  planIds
 Method parameters: 
   param name: options | type: BulkUpdatePlanTagsOptions  none  
        - name: assignTags | type: Tags | description: Tags to assign to the plans.  
           - name: privateTags | type: TagList | description: Tags that require an additional permission in order to access them, normally not given to site members or visitors.  
              - name: tagIds | type: array<string> | description: List of tag GUIDs  | validation: maxItems 100, maxLength 5
           - name: publicTags | type: TagList | description: Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors.  
        - name: unassignTags | type: Tags | description: Tags to unassign from the plans.  
   param name: planIds | type: array<array> | description: IDs of plans whose tags to update. | required: true | validation: minItems 1, maxItems 100, format GUID
 Return type: PROMISE<BulkUpdatePlanTagsResponse>
  - name: results | type: array<BulkUpdatePlanTagsResult> | description: Tag update results.  | validation: minItems 1, maxItems 100
     - name: itemMetadata | type: ItemMetadata | description: Metadata for a specific updated plan.  
        - name: _id | type: string | description: Item GUID. Should always be available, unless it's impossible (for example, when failing to create an item).  | validation: format GUID
        - 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: 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: EMPTY_ASSIGN_AND_UNASSIGN_LISTS | Description: Neither `assignTags` nor `unassignTags` contains any tag GUIDs.


```

### Examples

### Assign tags to plans
Assigns a private tag to specific plans by ID. A tag listed in both assignTags and unassignTags is assigned.

```javascript
import { plansV3 } from "@wix/pricing-plans";

async function bulkUpdatePlanTags() {
  const response = await plansV3.bulkUpdatePlanTags(
    [
      "5d1c47f5-0ec7-4c9c-9f9c-a87be388e3f9",
      "bece39da-e515-4e31-8fc1-79edcbb3b57e",
    ],
    {
      assignTags: {
        privateTags: { tagIds: ["vN3xQ"] },
      },
      unassignTags: {
        privateTags: { tagIds: ["gY7dW"] },
      },
    },
  );
}

/* Promise resolves to:
 * {
 *   "results": [
 *     {
 *       "itemMetadata": {
 *         "_id": "5d1c47f5-0ec7-4c9c-9f9c-a87be388e3f9",
 *         "originalIndex": 0,
 *         "success": true
 *       }
 *     },
 *     {
 *       "itemMetadata": {
 *         "_id": "bece39da-e515-4e31-8fc1-79edcbb3b57e",
 *         "originalIndex": 1,
 *         "success": true
 *       }
 *     }
 *   ],
 *   "bulkActionMetadata": {
 *     "totalSuccesses": 2,
 *     "totalFailures": 0,
 *     "undetailedFailures": 0
 *   }
 * }
 */

```

### bulkUpdatePlanTags (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 bulkUpdatePlanTags(planIds,options) {
  const response = await myWixClient.plansV3.bulkUpdatePlanTags(planIds,options);
};
```

---