> 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 # 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 | description: List of tag GUIDs - 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 | description: IDs of billable items which tags will be updated. | required: true 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 | description: Billable items update tags results including metadata. - 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). - 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: ' \ -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 | description: IDs of billable items which tags will be updated. | required: true 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 | description: List of tag GUIDs - 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 - name: results | type: array | description: Billable items update tags results including metadata. - 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). - 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-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 { 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); }; ``` ---