> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> 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`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# BulkUpdateBillableItemTags

# Package: getPaid

# Namespace: BillableItems

# Method link: https://dev.wix.com/docs/api-reference/business-management/get-paid/billable-items/bulk-update-billable-item-tags.md

## Permission Scopes:
Manage Billable Items: SCOPE.BILLABLE_ITEMS.MANAGE-BILLABLE-ITEMS

## Introduction

Updates tags for multiple billable items.
A tag that appears both in the list of assign and unassign tags, will be assigned.

---

## REST API

### Schema

```
 Method: bulkUpdateBillableItemTags
 Description: Updates tags for multiple billable items. A tag that appears both in the list of assign and unassign tags, will be assigned.
 URL: https://www.wixapis.com/billable-items/v1/bulk/billable-items/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:  billableItemIds
 Method parameters: 
   param name: assignTags | type: Tags | description: Common object for tags. Should be use as in this example: message Foo { string id = 1; ... Tags tags = 5 }  example of taggable entity { id: "123" tags: { 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: tags | type: TagList | description: Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors.  
   param name: billableItemIds | type: array<billableItemIds> | description: IDs of billable items which tags will be updated. | required: true | validation: minItems 1, maxItems 100, format GUID
   param name: unassignTags | type: Tags | description: Common object for tags. Should be use as in this example: message Foo { string id = 1; ... Tags tags = 5 }  example of taggable entity { id: "123" tags: { 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: tags | type: TagList | description: Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors.  
 Return type: BulkUpdateBillableItemTagsResponse
  - name: results | type: array<BulkUpdateBillableItemTagsResult> | description: Billable items update tags results including metadata.  | validation: minItems 1, maxItems 100
     - name: itemMetadata | type: ItemMetadata | description: Billable item's update tags operation metadata.  
        - 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: Bulk update tags 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: none


```

### Examples

### Bulk Update Billable Item Tags
Updates tags for multiple Billable Items

```curl
curl -X POST \
  'https://www.wixapis.com/billable-items/v1/bulk/billable-items/update-tags' \
  -H 'Authorization: <AUTH>' \
  -H 'Content-Type: application/json' \
  --data-binary '{
  "billableItemIds": [
    "8046df3c-7575-4098-a5ab-c91ad8f33c47",
    "afbcced4-dac4-451e-80f2-9366999c8587"
  ],
  "assignTags": {
    "tags": {
      "tagIds": ["featured", "seasonal"]
    }
  },
  "unassignTags": {
    "tags": {
      "tagIds": ["outdated"]
    }
  }
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.getPaid.billableItems.bulkUpdateBillableItemTags(billableItemIds, options)
 Description: Updates tags for multiple billable items. A tag that appears both in the list of assign and unassign tags, will be assigned.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  billableItemIds
 Method parameters: 
   param name: billableItemIds | type: array<string> | description: IDs of billable items which tags will be updated. | required: true | validation: minItems 1, maxItems 100, format GUID
   param name: options | type: BulkUpdateBillableItemTagsOptions  none  
        - name: assignTags | type: Tags | description: List of tags to assign.  
           - 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: tags | 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: List of tags to unassign.  
 Return type: PROMISE<BulkUpdateBillableItemTagsResponse>
  - name: results | type: array<BulkUpdateBillableItemTagsResult> | description: Billable items update tags results including metadata.  | validation: minItems 1, maxItems 100
     - name: itemMetadata | type: ItemMetadata | description: Billable item's update tags operation metadata.  
        - 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: Bulk update tags 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: none


```

### Examples

### bulkUpdateBillableItemTags
```javascript
import { billableItems } from '@wix/get-paid';

async function bulkUpdateBillableItemTags(billableItemIds,options) {
  const response = await billableItems.bulkUpdateBillableItemTags(billableItemIds,options);
};
```

### bulkUpdateBillableItemTags (with elevated permissions)
```javascript
import { billableItems } from '@wix/get-paid';
import { auth } from '@wix/essentials';

async function myBulkUpdateBillableItemTagsMethod(billableItemIds,options) {
  const elevatedBulkUpdateBillableItemTags = auth.elevate(billableItems.bulkUpdateBillableItemTags);
  const response = await elevatedBulkUpdateBillableItemTags(billableItemIds,options);
}
```

### bulkUpdateBillableItemTags (self-managed)
Self-managed 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 { billableItems } from '@wix/get-paid';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { billableItems },
  // Include the auth strategy and host as relevant
});


async function bulkUpdateBillableItemTags(billableItemIds,options) {
  const response = await myWixClient.billableItems.bulkUpdateBillableItemTags(billableItemIds,options);
};
```

---