> 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

# 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 | read-only: true | validation: format 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. | required: true | read-only: true | validation: format int64
        - name: name | type: string | description: Billable item name, for display on invoices. | required: true | validation: minLength 1, maxLength 200
        - name: description | type: string | description: Detailed description of the billable item. Provides additional information about the product or service.  | validation: minLength 1, maxLength 600
        - 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 | validation: format DECIMAL_VALUE, decimalValue {"gte":"-1000000000000000","lte":"1000000000000000","maxScale":4}
        - 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.  | validation: format GUID
        - 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).  | validation: format map
        - 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<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.  
 Return type: UpdateBillableItemResponse
  - name: billableItem | type: BillableItem | description: Updated billable item.  
     - name: id | type: string | description: Billable item GUID.  | read-only: true | validation: format 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.  | read-only: true | validation: format int64
     - name: createdDate | type: string | description: Date and time the billable item was created.  | read-only: true | validation: format date-time
     - name: updatedDate | type: string | description: Date and time the billable item was last updated.  | read-only: true | validation: format date-time
     - name: name | type: string | description: Billable item name, for display on invoices.  | validation: minLength 1, maxLength 200
     - name: description | type: string | description: Detailed description of the billable item. Provides additional information about the product or service.  | validation: minLength 1, maxLength 600
     - 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.  | validation: format DECIMAL_VALUE, decimalValue {"gte":"-1000000000000000","lte":"1000000000000000","maxScale":4}
     - 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.  | validation: format GUID
     - 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.  | read-only: true 
        - name: width | type: integer | description: Original image width.  | read-only: true 
        - 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).  | validation: format map
     - 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<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.  


```

### 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: <AUTH>' \
  -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 | validation: format GUID
   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 | read-only: true | validation: format int64
        - name: name | type: string | description: Billable item name, for display on invoices. | required: true | validation: minLength 1, maxLength 200
        - name: description | type: string | description: Detailed description of the billable item. Provides additional information about the product or service.  | validation: minLength 1, maxLength 600
        - 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 | validation: format DECIMAL_VALUE, decimalValue {"gte":"-1000000000000000","lte":"1000000000000000","maxScale":4}
        - 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.  | validation: format GUID
        - 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).  | validation: format map
        - 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<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.  
 Return type: PROMISE<BillableItem>
  - name: _id | type: string | description: Billable item GUID.  | read-only: true | validation: format 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.  | read-only: true | validation: format int64
  - name: _createdDate | type: Date | description: Date and time the billable item was created.  | read-only: true 
  - name: _updatedDate | type: Date | description: Date and time the billable item was last updated.  | read-only: true 
  - name: name | type: string | description: Billable item name, for display on invoices.  | validation: minLength 1, maxLength 200
  - name: description | type: string | description: Detailed description of the billable item. Provides additional information about the product or service.  | validation: minLength 1, maxLength 600
  - 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.  | validation: format DECIMAL_VALUE, decimalValue {"gte":"-1000000000000000","lte":"1000000000000000","maxScale":4}
  - 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.  | validation: format GUID
  - 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).  | validation: format map
  - 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<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.  


```

### 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-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 updateBillableItem(_id,billableItem) {
  const response = await myWixClient.billableItems.updateBillableItem(_id,billableItem);
};
```

---