> 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 # BulkUpdateBillableItems # Package: getPaid # Namespace: BillableItems # Method link: https://dev.wix.com/docs/api-reference/business-management/get-paid/billable-items/bulk-update-billable-items.md ## Permission Scopes: Manage Billable Items: SCOPE.BILLABLE_ITEMS.MANAGE-BILLABLE-ITEMS ## Introduction Updates multiple billable items. --- ## REST API ### Schema ``` Method: bulkUpdateBillableItems Description: Updates multiple billable items. URL: https://www.wixapis.com/billable-items/v1/bulk/billable-items/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: billableItems, billableItems.billableItem, billableItems.billableItem.id, billableItems.billableItem.revision Method parameters: param name: billableItems | type: array | description: Billable items to update. | required: true - name: billableItem | type: BillableItem | description: Billable items to update. May be partial. | required: true - name: id | type: string | description: Billable item GUID. | required: true - name: revision | type: string | description: Revision number, which increments by 1 each time the billable item is updated. To prevent conflicting changes, the current revision must be passed when updating the billable item. Ignored when creating a billable item. | required: true - name: name | type: string | description: Billable item name, for display on invoices. - name: description | type: string | description: Detailed description of the billable item. Provides additional information about the product or service. - name: price | type: string | description: Price of the billable item in decimal format with up to 4 decimal places. Represents the base cost before taxes are applied. This is a required field when creating a new billable item. - name: taxGroupId | type: string | description: Reference to a tax group that defines the tax rules applicable to this billable item. Use the Tax Groups API ([SDK](https://dev.wix.com/docs/sdk/backend-modules/billing/tax-groups/introduction.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/tax/tax-groups/introduction.md)) to retrieve available tax groups for the business. The tax group determines how taxes are calculated when this item is added to an invoice. If not specified, the default tax rules for the business will apply. - name: image | type: Image | description: Billable item image, stored in the Wix Media Manager. Upload an image with the Media Manager API ([SDK](https://dev.wix.com/docs/sdk/backend-modules/media/introduction.md) | [REST](https://dev.wix.com/docs/rest/assets/media/media-manager/introduction.md)) or the site dashboard before associating it to a billable item. - name: id | type: string | description: WixMedia image GUID. - name: url | type: string | description: Image URL. - name: altText | type: string | description: Image alt text. - name: extendedFields | type: ExtendedFields | description: Custom field data for the billable item. Extended fields must be configured in the app dashboard before they can be accessed with API calls. - 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: tags | type: Tags | description: Tags. - 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: returnEntity | type: returnEntity | description: Return updated billable items in the response. Return type: BulkUpdateBillableItemsResponse - name: results | type: array | description: Billable items update operation results including metadata. - name: itemMetadata | type: ItemMetadata | description: Billable item's update 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: item | type: BillableItem | description: Updated billable item if `returnEntity` was set `true` in the request. - name: id | type: string | description: Billable item GUID. - name: revision | type: string | description: Revision number, which increments by 1 each time the billable item is updated. To prevent conflicting changes, the current revision must be passed when updating the billable item. Ignored when creating a billable item. - name: createdDate | type: string | description: Date and time the billable item was created. - name: updatedDate | type: string | description: Date and time the billable item was last updated. - name: name | type: string | description: Billable item name, for display on invoices. - name: description | type: string | description: Detailed description of the billable item. Provides additional information about the product or service. - name: price | type: string | description: Price of the billable item in decimal format with up to 4 decimal places. Represents the base cost before taxes are applied. This is a required field when creating a new billable item. - name: taxGroupId | type: string | description: Reference to a tax group that defines the tax rules applicable to this billable item. Use the Tax Groups API ([SDK](https://dev.wix.com/docs/sdk/backend-modules/billing/tax-groups/introduction.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/tax/tax-groups/introduction.md)) to retrieve available tax groups for the business. The tax group determines how taxes are calculated when this item is added to an invoice. If not specified, the default tax rules for the business will apply. - name: image | type: Image | description: Billable item image, stored in the Wix Media Manager. Upload an image with the Media Manager API ([SDK](https://dev.wix.com/docs/sdk/backend-modules/media/introduction.md) | [REST](https://dev.wix.com/docs/rest/assets/media/media-manager/introduction.md)) or the site dashboard before associating it to a billable item. - name: id | type: string | description: WixMedia image GUID. - name: url | type: string | description: Image URL. - 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: extendedFields | type: ExtendedFields | description: Custom field data for the billable item. Extended fields must be configured in the app dashboard before they can be accessed with API calls. - 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: tags | type: Tags | description: Tags. - 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: bulkActionMetadata | type: BulkActionMetadata | description: Metadata regarding the bulk update operation. - 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. ``` ### Examples ### Bulk Update Billable Items Updates multiple Billable Items ```curl curl -X POST \ 'https://www.wixapis.com/billable-items/v1/bulk/billable-items/update' \ -H 'Authorization: ' \ -H 'Content-Type: application/json' \ --data-binary '{ "billableItems": [ { "billableItem": { "id": "8046df3c-7575-4098-a5ab-c91ad8f33c47", "revision": 3, "price": "109.99", "description": "Updated premium consultation with extended follow-up support" }, "fieldMask": { "paths": ["price", "description"] } }, { "billableItem": { "id": "9157ef4d-8686-5109-b967-d92be8f44c58", "revision": 2, "price": "89.99" }, "fieldMask": { "paths": ["price"] } } ], "returnEntity": true }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.getPaid.BillableItems.bulkUpdateBillableItems(billableItems, options) Description: Updates multiple billable items. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: billableItems, billableItems.billableItem, billableItems.billableItem._id, billableItems.billableItem.revision Method parameters: param name: billableItems | type: array | description: Billable items to update. | required: true - name: billableItem | type: BillableItem | description: Billable items to update. May be partial. | required: true - name: _id | type: string | description: Billable item GUID. | required: true - name: revision | type: string | description: Revision number, which increments by 1 each time the billable item is updated. To prevent conflicting changes, the current revision must be passed when updating the billable item. Ignored when creating a billable item. | required: true - name: name | type: string | description: Billable item name, for display on invoices. - name: description | type: string | description: Detailed description of the billable item. Provides additional information about the product or service. - name: price | type: string | description: Price of the billable item in decimal format with up to 4 decimal places. Represents the base cost before taxes are applied. This is a required field when creating a new billable item. - name: taxGroupId | type: string | description: Reference to a tax group that defines the tax rules applicable to this billable item. Use the Tax Groups API ([SDK](https://dev.wix.com/docs/sdk/backend-modules/billing/tax-groups/introduction.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/tax/tax-groups/introduction.md)) to retrieve available tax groups for the business. The tax group determines how taxes are calculated when this item is added to an invoice. If not specified, the default tax rules for the business will apply. - name: image | type: string | description: Billable item image, stored in the Wix Media Manager. Upload an image with the Media Manager API ([SDK](https://dev.wix.com/docs/sdk/backend-modules/media/introduction.md) | [REST](https://dev.wix.com/docs/rest/assets/media/media-manager/introduction.md)) or the site dashboard before associating it to a billable item. - name: extendedFields | type: ExtendedFields | description: Custom field data for the billable item. Extended fields must be configured in the app dashboard before they can be accessed with API calls. - 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: tags | type: Tags | description: Tags. - 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: options | type: BulkUpdateBillableItemsOptions none - name: returnEntity | type: boolean | description: Return updated billable items in the response. Return type: PROMISE - name: results | type: array | description: Billable items update operation results including metadata. - name: itemMetadata | type: ItemMetadata | description: Billable item's update 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: item | type: BillableItem | description: Updated billable item if `returnEntity` was set `true` in the request. - name: _id | type: string | description: Billable item GUID. - name: revision | type: string | description: Revision number, which increments by 1 each time the billable item is updated. To prevent conflicting changes, the current revision must be passed when updating the billable item. Ignored when creating a billable item. - name: _createdDate | type: Date | description: Date and time the billable item was created. - name: _updatedDate | type: Date | description: Date and time the billable item was last updated. - name: name | type: string | description: Billable item name, for display on invoices. - name: description | type: string | description: Detailed description of the billable item. Provides additional information about the product or service. - name: price | type: string | description: Price of the billable item in decimal format with up to 4 decimal places. Represents the base cost before taxes are applied. This is a required field when creating a new billable item. - name: taxGroupId | type: string | description: Reference to a tax group that defines the tax rules applicable to this billable item. Use the Tax Groups API ([SDK](https://dev.wix.com/docs/sdk/backend-modules/billing/tax-groups/introduction.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/tax/tax-groups/introduction.md)) to retrieve available tax groups for the business. The tax group determines how taxes are calculated when this item is added to an invoice. If not specified, the default tax rules for the business will apply. - name: image | type: string | description: Billable item image, stored in the Wix Media Manager. Upload an image with the Media Manager API ([SDK](https://dev.wix.com/docs/sdk/backend-modules/media/introduction.md) | [REST](https://dev.wix.com/docs/rest/assets/media/media-manager/introduction.md)) or the site dashboard before associating it to a billable item. - name: extendedFields | type: ExtendedFields | description: Custom field data for the billable item. Extended fields must be configured in the app dashboard before they can be accessed with API calls. - 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: tags | type: Tags | description: Tags. - 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: bulkActionMetadata | type: BulkActionMetadata | description: Metadata regarding the bulk update operation. - 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. ``` ### Examples ### bulkUpdateBillableItems ```javascript import { billableItems } from '@wix/get-paid'; async function bulkUpdateBillableItems(billableItems,options) { const response = await billableItems.bulkUpdateBillableItems(billableItems,options); }; ``` ### bulkUpdateBillableItems (with elevated permissions) ```javascript import { billableItems } from '@wix/get-paid'; import { auth } from '@wix/essentials'; async function myBulkUpdateBillableItemsMethod(billableItems,options) { const elevatedBulkUpdateBillableItems = auth.elevate(billableItems.bulkUpdateBillableItems); const response = await elevatedBulkUpdateBillableItems(billableItems,options); } ``` ### bulkUpdateBillableItems (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 bulkUpdateBillableItems(billableItems,options) { const response = await myWixClient.billableItems.bulkUpdateBillableItems(billableItems,options); }; ``` ---