> 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 # UpdateBillableItem # Package: getPaid # Namespace: BillableItems # Method link: https://dev.wix.com/docs/api-reference/business-management/get-paid/billable-items/update-billable-item.md ## Permission Scopes: Manage Billable Items: SCOPE.BILLABLE_ITEMS.MANAGE-BILLABLE-ITEMS ## Introduction Updates a billable item. Each time the BillableItem is updated, `revision` increments by 1. The current `revision` must be passed when updating the billable item. This ensures you're working with the latest billable item and prevents unintended overwrites. --- ## REST API ### Schema ``` Method: updateBillableItem Description: Updates a billable item. Each time the BillableItem is updated, `revision` increments by 1. The current `revision` must be passed when updating the billable item. This ensures you're working with the latest billable item and prevents unintended overwrites. URL: https://www.wixapis.com/billable-items/v1/billable-items/{billableItem.id} Method: PATCH # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: billableItem, billableItem.id, billableItem.revision, billableItem.name, billableItem.price Method parameters: param name: billableItem | type: BillableItem | description: A billable item represents a billable product or service that can be added to invoices. You can create, manage, and organize these items to streamline your billing process. Billable items include details like name, description, price, and tax information. | 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. | required: true - 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. | required: true - 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. Return type: UpdateBillableItemResponse - name: billableItem | type: BillableItem | description: Updated billable item. - 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. ``` ### Examples ### Update BillableItem Updates an existing BillableItem with new information ```curl curl -X PATCH \ 'https://www.wixapis.com/billable-items/v1/billable-items/8046df3c-7575-4098-a5ab-c91ad8f33c47' \ -H 'Authorization: ' \ -H 'Content-Type: application/json' \ --data-binary '{ "billableItem": { "id": "8046df3c-7575-4098-a5ab-c91ad8f33c47", "revision": 1, "name": "Premium Consultation Plus", "description": "One hour consultation session with a senior expert including follow-up email", "price": "129.99" }, "fieldMask": { "paths": ["name", "description", "price"] } }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.getPaid.BillableItems.updateBillableItem(_id, billableItem) Description: Updates a billable item. Each time the BillableItem is updated, `revision` increments by 1. The current `revision` must be passed when updating the billable item. This ensures you're working with the latest billable item and prevents unintended overwrites. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: billableItem, _id, billableItem.revision, billableItem.name, billableItem.price Method parameters: param name: _id | type: string | description: Billable item GUID. | required: true param name: billableItem | type: UpdateBillableItem | description: A billable item represents a billable product or service that can be added to invoices. You can create, manage, and organize these items to streamline your billing process. Billable items include details like name, description, price, and tax information. | 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. | required: true - 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. | required: true - 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. Return type: PROMISE - 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. ``` ### Examples ### updateBillableItem ```javascript import { billableItems } from '@wix/get-paid'; async function updateBillableItem(_id,billableItem) { const response = await billableItems.updateBillableItem(_id,billableItem); }; ``` ### updateBillableItem (with elevated permissions) ```javascript import { billableItems } from '@wix/get-paid'; import { auth } from '@wix/essentials'; async function myUpdateBillableItemMethod(_id,billableItem) { const elevatedUpdateBillableItem = auth.elevate(billableItems.updateBillableItem); const response = await elevatedUpdateBillableItem(_id,billableItem); } ``` ### updateBillableItem (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 updateBillableItem(_id,billableItem) { const response = await myWixClient.billableItems.updateBillableItem(_id,billableItem); }; ``` ---