> 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 # CreateBillableItem # Package: getPaid # Namespace: BillableItems # Method link: https://dev.wix.com/docs/api-reference/business-management/get-paid/billable-items/create-billable-item.md ## Permission Scopes: Manage Billable Items: SCOPE.BILLABLE_ITEMS.MANAGE-BILLABLE-ITEMS ## Introduction Creates a billable item. --- ## REST API ### Schema ``` Method: createBillableItem Description: Creates a billable item. URL: https://www.wixapis.com/billable-items/v1/billable-items Method: POST # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: billableItem, 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: 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: CreateBillableItemResponse - name: billableItem | type: BillableItem | description: Created 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. Possible Errors: HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: TAX_GROUP_ID_NOT_FOUND | Description: Tax group not found. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: NO_META_SITE | Description: Site not found. HTTP Code: 500 | Status Code: INTERNAL | Application Code: APP_INSTALLATION_FAILED | Description: Billable items app failed to install. ``` ### Examples ### Create Billable Item Creates a Billable Item ```curl curl -X POST \ 'https://www.wixapis.com/billable-items/v1/billable-items' \ -H 'Authorization: ' \ -H 'Content-Type: application/json' \ --data-binary '{ "billableItem": { "name": "Premium Consultation", "description": "One hour consultation session with a senior expert", "price": "99.99", "taxGroupId": "b52a5d5c-f8f5-4e6c-a856-66578913921a", "image": { "id": "media/12345", "url": "https://static.wixstatic.com/media/12345.jpg", "height": 600, "width": 800, "altText": "Premium Consultation Service" } } }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.getPaid.BillableItems.createBillableItem(billableItem) Description: Creates a billable item. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: billableItem, 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: 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. Possible Errors: HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: TAX_GROUP_ID_NOT_FOUND | Description: Tax group not found. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: NO_META_SITE | Description: Site not found. HTTP Code: 500 | Status Code: INTERNAL | Application Code: APP_INSTALLATION_FAILED | Description: Billable items app failed to install. ``` ### Examples ### createBillableItem ```javascript import { billableItems } from '@wix/get-paid'; async function createBillableItem(billableItem) { const response = await billableItems.createBillableItem(billableItem); }; ``` ### createBillableItem (with elevated permissions) ```javascript import { billableItems } from '@wix/get-paid'; import { auth } from '@wix/essentials'; async function myCreateBillableItemMethod(billableItem) { const elevatedCreateBillableItem = auth.elevate(billableItems.createBillableItem); const response = await elevatedCreateBillableItem(billableItem); } ``` ### createBillableItem (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 createBillableItem(billableItem) { const response = await myWixClient.billableItems.createBillableItem(billableItem); }; ``` ---