> 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

# PreviewTip

# Package: tips

# Namespace: TipsService

# Method link: https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/other-services/tips/tips/preview-tip?apiView=SDK.md

## Permission Scopes:
Manage Bookings: SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS

## Introduction

Previews a tip for a list of line items.


If you provide the Wix Bookings app ID ([SDK](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/apps-created-by-wix.md) | [REST](https://dev.wix.com/docs/rest/articles/getting-started/apps-created-by-wix.md))
as `lineItemInfo.catalogReference.appId`, the response includes tip
distributions for each associated
Bookings staff member ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/staff-members/introduction.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/staff-members/staff-member-object.md)).

If you don't provide a `tipSettingsId`, the `staffDistributionMethod` is
based on the site's default tip settings.

---

## REST API

### Schema

```
 Method: previewTip
 Description: Previews a tip for a list of line items.   If you provide the Wix Bookings app GUID ([SDK](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/apps-created-by-wix.md) | [REST](https://dev.wix.com/docs/rest/articles/getting-started/apps-created-by-wix.md)) as `lineItemInfo.catalogReference.appId`, the response includes tip distributions for each associated Bookings staff member ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/staff-members/introduction.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/staff-members/staff-member-object.md)).  If you don't provide a `tipSettingsId`, the `staffDistributionMethod` is based on the site's default tip settings.
 URL: https://www.wixapis.com/tips/v1/tips/preview
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  lineItemInfo, lineItemInfo.price, lineItemInfo.catalogReference.appId, lineItemInfo.catalogReference.catalogItemId, tipChoice, tipChoice.value, tipChoice.tipType
 Method parameters: 
   param name: draftOrderId | type: draftOrderId | description: GUID of draft order. If provided, we'll take overridden data from the draft.  | validation: format GUID
   param name: lineItemInfo | type: array<lineItemInfo> | description: Information about the line items to preview the tip for.  Min: 1 line item Max: 50 line items | required: true | validation: minItems 1, maxItems 50
              - name: lineItemId | type: string | description: IDs of the line items associated with the tip.  Min: 1 character <br/> Max: 100 characters  | validation: minLength 1, maxLength 100
              - name: catalogReference | type: CatalogReference | description: Information about the line item and the corresponding catalog. Catalogs include Wix Bookings and Wix Stores.  
                 - name: catalogItemId | type: string | description: GUID of the line item within its catalog, corresponding to: + `product.name` for Stores ([SDK](https://dev.wix.com/docs/sdk/backend-modules/stores/introduction.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/stores/about-wix-stores.md)). + `service.name` for Bookings ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/introduction.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/about-wix-bookings.md)). | required: true | validation: format GUID
                 - name: appId | type: string | description: GUID of the app ([SDK](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/apps-created-by-wix.md) | [REST](https://dev.wix.com/docs/rest/articles/getting-started/apps-created-by-wix.md)) to which the catalog belongs.  Supported app GUIDs: + [Wix Tips](https://www.wix.com/app-market/wix-tips): `"869a50c8-dd38-4324-b201-e33dc0747a5f"` + [Wix Stores](https://www.wix.com/app-market/wix-stores): `"215238eb-22a5-4c36-9e7b-e7c08025e04e"` + [Wix Bookings](https://www.wix.com/app-market/bookings): `"13d21c63-b5ec-5912-8397-c3a5ddb27a97"` + [Wix Restaurants Orders](https://www.wix.com/app-market/web-solution/wix-restaurants-orders-new): `"13e8d036-5516-6104-b456-c8466db39542"` | required: true | validation: format GUID
              - name: price | type: string | description: Price of the line item.  Min: `0.00` | required: true | validation: format DECIMAL_VALUE, decimalValue {"gte":"0","maxScale":2}
              - name: name | type: string | description: Name of the line item, which is identical to: + `product.name` for Stores ([SDK](https://dev.wix.com/docs/sdk/backend-modules/stores/introduction.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/stores/about-wix-stores.md)). + `service.name` for Bookings ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/introduction.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/about-wix-bookings.md)).  Min: 1 character  <br/> Max: 200 characters  | validation: minLength 1, maxLength 200
              - name: quantity | type: integer | description: Quantity of the line item.  Min: `1` <br/> Max: `100000` (one hundred thousand)  | validation: minimum 1, maximum 100000, format int32
   param name: tipChoice | type: TipChoice   | required: true 
        - name: value | type: string | description: Value of the tip choice. | required: true | validation: format DECIMAL_VALUE, decimalValue {"gte":"0","maxScale":2}
        - name: tipType | type: TipType | description: Type of the tip choice. | required: true 
             - enum:
             -     UNKNOWN_TIP_TYPE: There is no information about the tip type.
             -     PERCENTAGE: The tip is calculated as a percentage of the subtotal of associated line items.
             -     AMOUNT: The tip is a fixed value, pre-configured from the relevant settings presets.
             -     CUSTOM: The customer, or the business on behalf of the customer, manually set a tip amount, which may not match any preset values.
   param name: tipSettingsId | type: tipSettingsId | description: GUID of the tip settings used to preview the tip. If you don't provide a `tipSettingsId`, the `staffDistributionMethod` is based on the site's default tip settings.  | validation: format GUID
 Return type: PreviewTipResponse
  - name: tip | type: Tip | description: Tip.  
     - name: id | type: string | description: GUID of the tip. Identical to the `code` of the related `order.additionalFee`.  | read-only: true | validation: format GUID
     - name: lineItemSubtotal | type: string | description: Subtotal of all line items from the eCommerce order ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/introduction.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/order-object.md)) that's related to the tip. In the response of Preview Tip, there is no related eCommerce order. Then, value of this field corresponds to the sum of all line item prices passed in the request.  | read-only: true | validation: format DECIMAL_VALUE, decimalValue {"gte":"0","maxScale":2}
     - name: amount | type: string | description: Total amount of the tip.  Min: `0.00`  | validation: format DECIMAL_VALUE, decimalValue {"gte":"0","maxScale":2}
     - name: distributions | type: array<TipDistribution> | description: Details about how the tip is shared among staff. Available only if at least one staff member receives part of the tip, and it's not entirely allocated to the business.  Max: 50 distributions  | validation: minItems 0, maxItems 50
        - name: id | type: string | description: GUID of the tip distribution.  | read-only: true | validation: format GUID
        - name: tipId | type: string | description: GUID of the tip associated with the distribution. Matches the corresponding `order.additionalFee.code`.  | read-only: true | validation: format GUID
        - name: staff | type: Staff | description: Information about the business staff receiving the tip distribution.  
           - name: id | type: string | description: GUID of the staff receiving the tip. Matches `staffMemberId` if available, or `identificationData.wixUserId` if not.  | read-only: true | validation: format GUID
           - name: name | type: string | description: Staff name. Matches `staffMember.name` if the staff is a Bookings staff member, or the contact's `info.name` if not. See the Bookings Staff Members API and the Contacts API for additional details.  Max: 500 characters  | read-only: true | validation: maxLength 500
           - name: staffMemberId | type: string | description: GUID of the staff member ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/staff-members/introduction.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/staff-members/staff-member-object.md)). Available only if the staff is a staff member and not a [site collaborator](https://support.wix.com/en/article/inviting-people-to-contribute-to-your-site).  | validation: format GUID
           - name: identificationData | type: IdentificationData | description: Identification data. Available only if the staff is a contact on the Wix site. See the Contacts API for additional details.  Note that not all site collaborators qualify as staff members ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/staff-members/introduction.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/staff-members/staff-member-object.md)).  
              - ONE-OF: 
                 - name: anonymousVisitorId | type: string | description: GUID of a site visitor who hasn't logged in to the site.  | validation: format GUID
                 - name: memberId | type: string | description: GUID of a site visitor who has logged in to the site.  | validation: format GUID
                 - name: wixUserId | type: string | description: GUID of a Wix user. For example, the site owner or a [site collaborator](https://support.wix.com/en/article/inviting-people-to-contribute-to-your-site).  | validation: format GUID
                 - name: appId | type: string | description: GUID of an app.  | validation: format GUID
              - name: contactId | type: string | description: GUID of the contact in the site's [CRM by Ascend](https://www.wix.com/ascend/crm) system. See the Contacts API for additional details.  | validation: format GUID
        - name: amount | type: string | description: Amount of the tip distribution.  Min: `0.00`  | validation: format DECIMAL_VALUE, decimalValue {"gte":"0","maxScale":2}
        - name: lineItemInfo | type: array<LineItemInfo> | description: Details about the related line items from the eCommerce order ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/introduction.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/order-object.md)).  Max: 10 `lineItemInfo` objects  | validation: minItems 0, maxItems 12
           - name: lineItemId | type: string | description: IDs of the line items associated with the tip.  Min: 1 character <br/> Max: 100 characters  | validation: minLength 1, maxLength 100
           - name: catalogReference | type: CatalogReference | description: Information about the line item and the corresponding catalog. Catalogs include Wix Bookings and Wix Stores.  
              - name: catalogItemId | type: string | description: GUID of the line item within its catalog, corresponding to: + `product.name` for Stores ([SDK](https://dev.wix.com/docs/sdk/backend-modules/stores/introduction.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/stores/about-wix-stores.md)). + `service.name` for Bookings ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/introduction.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/about-wix-bookings.md)).  | validation: format GUID
              - name: appId | type: string | description: GUID of the app ([SDK](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/apps-created-by-wix.md) | [REST](https://dev.wix.com/docs/rest/articles/getting-started/apps-created-by-wix.md)) to which the catalog belongs.  Supported app GUIDs: + [Wix Tips](https://www.wix.com/app-market/wix-tips): `"869a50c8-dd38-4324-b201-e33dc0747a5f"` + [Wix Stores](https://www.wix.com/app-market/wix-stores): `"215238eb-22a5-4c36-9e7b-e7c08025e04e"` + [Wix Bookings](https://www.wix.com/app-market/bookings): `"13d21c63-b5ec-5912-8397-c3a5ddb27a97"` + [Wix Restaurants Orders](https://www.wix.com/app-market/web-solution/wix-restaurants-orders-new): `"13e8d036-5516-6104-b456-c8466db39542"`  | validation: format GUID
           - name: price | type: string | description: Price of the line item.  Min: `0.00`  | validation: format DECIMAL_VALUE, decimalValue {"gte":"0","maxScale":2}
           - name: name | type: string | description: Name of the line item, which is identical to: + `product.name` for Stores ([SDK](https://dev.wix.com/docs/sdk/backend-modules/stores/introduction.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/stores/about-wix-stores.md)). + `service.name` for Bookings ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/introduction.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/about-wix-bookings.md)).  Min: 1 character  <br/> Max: 200 characters  | validation: minLength 1, maxLength 200
           - name: quantity | type: integer | description: Quantity of the line item.  Min: `1` <br/> Max: `100000` (one hundred thousand)  | validation: minimum 1, maximum 100000, format int32
        - name: transaction | type: Transaction | description: Details of how the customer is charged for the tip. Available only if the transaction ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/order-transactions/setup.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/order-transactions/order-transactions-object.md)) has been created.  
           - name: id | type: string | description: GUID of the transaction that's associated with the tip distribution.  | validation: format GUID
           - name: date | type: string | description: Date and time the transaction was created in `YYYY-MM-DDThh:mm:ss.sssZ` format. Isn't identical to the time the customer was actually charged.  | validation: format date-time
        - name: orderId | type: string | description: GUID of the eCommerce order ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/introduction.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/order-object.md)) associated with the tip distribution. Identical for all distributions that belong to the same tip.  | read-only: true | validation: format GUID
        - name: createdDate | type: string | description: Date and time the distribution was created in `YYYY-MM-DDThh:mm:ss.sssZ` format.  | read-only: true | validation: format date-time
        - name: source | type: Source | description: Information about who created the tip distributions.  
             - enum:
             -     UNKNOWN_SOURCE: There is no information about who created the tip distributions.
             -     POS: The customer added the tip distributions via an external payment terminal.
             -     WEB: The customer added the tip distributions during an online eCommerce checkout ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/introduction.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/checkout/introduction.md)).
             -     DASHBOARD: The business added the tip distributions on behalf of the customer in the site's dashboard.
     - name: undistributedAmount | type: string | description: Undistributed tip amount. Calculated as the difference between `tip.amount` and the sum of all `tip.tipDistributions.amount` values.  Min: `0.01`  | read-only: true | validation: format DECIMAL_VALUE, decimalValue {"gt":"0","maxScale":2}

 Possible Errors:
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: CATALOG_ITEMS_NOT_FOUND | Description: Couldn't find the catalog items.
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: TIP_SETTINGS_NOT_FOUND | Description: Couldn't find the tip settings.


```

### Examples

### Preview tip
```curl
curl -X POST \
'https://www.wixapis.com/tips-service/v1/tips/preview' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "lineItemInfo": [
    {
      "price": "44.44",
      "name": "Line Item #1"
    },
    {
      "price": "33.33",
      "catalogReference": {
        "catalogItemId": "0d6f9e8f-4950-4d32-b362-29165b0eb22c",
        "appId": "13d21c63-b5ec-5912-8397-c3a5ddb27a97"
      },
      "name": "Line Item #2"
    }
  ],
  "tipChoice": {
    "value": "10",
    "tipType": "PERCENTAGE"
  }
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.ecom.tips.previewTip(lineItemInfo, options)
 Description: Previews a tip for a list of line items.   If you provide the Wix Bookings app GUID ([SDK](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/apps-created-by-wix.md) | [REST](https://dev.wix.com/docs/rest/articles/getting-started/apps-created-by-wix.md)) as `lineItemInfo.catalogReference.appId`, the response includes tip distributions for each associated Bookings staff member ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/staff-members/introduction.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/staff-members/staff-member-object.md)).  If you don't provide a `tipSettingsId`, the `staffDistributionMethod` is based on the site's default tip settings.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  lineItemInfo, lineItemInfo.price, lineItemInfo.catalogReference.appId, lineItemInfo.catalogReference.catalogItemId, options.tipChoice, options.tipChoice.value, options.tipChoice.tipType, options
 Method parameters: 
   param name: lineItemInfo | type: array<LineItemInfo> | description: Information about the line items to preview the tip for.  Min: 1 line item Max: 50 line items | required: true | validation: minItems 1, maxItems 50
              - name: lineItemId | type: string | description: IDs of the line items associated with the tip.  Min: 1 character <br/> Max: 100 characters  | validation: minLength 1, maxLength 100
              - name: catalogReference | type: CatalogReference | description: Information about the line item and the corresponding catalog. Catalogs include Wix Bookings and Wix Stores.  
                 - name: catalogItemId | type: string | description: GUID of the line item within its catalog, corresponding to: + `product.name` for Stores ([SDK](https://dev.wix.com/docs/sdk/backend-modules/stores/introduction.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/stores/about-wix-stores.md)). + `service.name` for Bookings ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/introduction.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/about-wix-bookings.md)). | required: true | validation: format GUID
                 - name: appId | type: string | description: GUID of the app ([SDK](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/apps-created-by-wix.md) | [REST](https://dev.wix.com/docs/rest/articles/getting-started/apps-created-by-wix.md)) to which the catalog belongs.  Supported app GUIDs: + [Wix Tips](https://www.wix.com/app-market/wix-tips): `"869a50c8-dd38-4324-b201-e33dc0747a5f"` + [Wix Stores](https://www.wix.com/app-market/wix-stores): `"215238eb-22a5-4c36-9e7b-e7c08025e04e"` + [Wix Bookings](https://www.wix.com/app-market/bookings): `"13d21c63-b5ec-5912-8397-c3a5ddb27a97"` + [Wix Restaurants Orders](https://www.wix.com/app-market/web-solution/wix-restaurants-orders-new): `"13e8d036-5516-6104-b456-c8466db39542"` | required: true | validation: format GUID
              - name: price | type: string | description: Price of the line item.  Min: `0.00` | required: true | validation: format DECIMAL_VALUE, decimalValue {"gte":"0","maxScale":2}
              - name: name | type: string | description: Name of the line item, which is identical to: + `product.name` for Stores ([SDK](https://dev.wix.com/docs/sdk/backend-modules/stores/introduction.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/stores/about-wix-stores.md)). + `service.name` for Bookings ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/introduction.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/about-wix-bookings.md)).  Min: 1 character  <br/> Max: 200 characters  | validation: minLength 1, maxLength 200
              - name: quantity | type: integer | description: Quantity of the line item.  Min: `1` <br/> Max: `100000` (one hundred thousand)  | validation: minimum 1, maximum 100000, format int32
   param name: options | type: PreviewTipOptions  none | required: true 
        - name: tipChoice | type: TipChoice | description: Information about how to calculate the total tip amount and the distribution amounts. | required: true 
           - name: value | type: string | description: Value of the tip choice. | required: true | validation: format DECIMAL_VALUE, decimalValue {"gte":"0","maxScale":2}
           - name: tipType | type: TipType | description: Type of the tip choice. | required: true 
                 - enum:
                 -     UNKNOWN_TIP_TYPE: There is no information about the tip type.
                 -     PERCENTAGE: The tip is calculated as a percentage of the subtotal of associated line items.
                 -     AMOUNT: The tip is a fixed value, pre-configured from the relevant settings presets.
                 -     CUSTOM: The customer, or the business on behalf of the customer, manually set a tip amount, which may not match any preset values.
        - name: tipSettingsId | type: string | description: GUID of the tip settings used to preview the tip. If you don't provide a `tipSettingsId`, the `staffDistributionMethod` is based on the site's default tip settings.  | validation: format GUID
        - name: draftOrderId | type: string | description: GUID of draft order. If provided, we'll take overridden data from the draft.  | validation: format GUID
 Return type: PROMISE<PreviewTipResponse>
  - name: tip | type: Tip | description: Tip.  
     - name: _id | type: string | description: GUID of the tip. Identical to the `code` of the related `order.additionalFee`.  | read-only: true | validation: format GUID
     - name: lineItemSubtotal | type: string | description: Subtotal of all line items from the eCommerce order ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/introduction.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/order-object.md)) that's related to the tip. In the response of Preview Tip, there is no related eCommerce order. Then, value of this field corresponds to the sum of all line item prices passed in the request.  | read-only: true | validation: format DECIMAL_VALUE, decimalValue {"gte":"0","maxScale":2}
     - name: amount | type: string | description: Total amount of the tip.  Min: `0.00`  | validation: format DECIMAL_VALUE, decimalValue {"gte":"0","maxScale":2}
     - name: distributions | type: array<TipDistribution> | description: Details about how the tip is shared among staff. Available only if at least one staff member receives part of the tip, and it's not entirely allocated to the business.  Max: 50 distributions  | validation: minItems 0, maxItems 50
        - name: _id | type: string | description: GUID of the tip distribution.  | read-only: true | validation: format GUID
        - name: tipId | type: string | description: GUID of the tip associated with the distribution. Matches the corresponding `order.additionalFee.code`.  | read-only: true | validation: format GUID
        - name: staff | type: Staff | description: Information about the business staff receiving the tip distribution.  
           - name: _id | type: string | description: GUID of the staff receiving the tip. Matches `staffMemberId` if available, or `identificationData.wixUserId` if not.  | read-only: true | validation: format GUID
           - name: name | type: string | description: Staff name. Matches `staffMember.name` if the staff is a Bookings staff member, or the contact's `info.name` if not. See the Bookings Staff Members API and the Contacts API for additional details.  Max: 500 characters  | read-only: true | validation: maxLength 500
           - name: staffMemberId | type: string | description: GUID of the staff member ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/staff-members/introduction.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/staff-members/staff-member-object.md)). Available only if the staff is a staff member and not a [site collaborator](https://support.wix.com/en/article/inviting-people-to-contribute-to-your-site).  | validation: format GUID
           - name: identificationData | type: IdentificationData | description: Identification data. Available only if the staff is a contact on the Wix site. See the Contacts API for additional details.  Note that not all site collaborators qualify as staff members ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/staff-members/introduction.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/staff-members/staff-member-object.md)).  
              - ONE-OF: 
                 - name: anonymousVisitorId | type: string | description: GUID of a site visitor who hasn't logged in to the site.  | validation: format GUID
                 - name: memberId | type: string | description: GUID of a site visitor who has logged in to the site.  | validation: format GUID
                 - name: wixUserId | type: string | description: GUID of a Wix user. For example, the site owner or a [site collaborator](https://support.wix.com/en/article/inviting-people-to-contribute-to-your-site).  | validation: format GUID
                 - name: appId | type: string | description: GUID of an app.  | validation: format GUID
              - name: contactId | type: string | description: GUID of the contact in the site's [CRM by Ascend](https://www.wix.com/ascend/crm) system. See the Contacts API for additional details.  | validation: format GUID
        - name: amount | type: string | description: Amount of the tip distribution.  Min: `0.00`  | validation: format DECIMAL_VALUE, decimalValue {"gte":"0","maxScale":2}
        - name: lineItemInfo | type: array<LineItemInfo> | description: Details about the related line items from the eCommerce order ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/introduction.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/order-object.md)).  Max: 10 `lineItemInfo` objects  | validation: minItems 0, maxItems 12
           - name: lineItemId | type: string | description: IDs of the line items associated with the tip.  Min: 1 character <br/> Max: 100 characters  | validation: minLength 1, maxLength 100
           - name: catalogReference | type: CatalogReference | description: Information about the line item and the corresponding catalog. Catalogs include Wix Bookings and Wix Stores.  
              - name: catalogItemId | type: string | description: GUID of the line item within its catalog, corresponding to: + `product.name` for Stores ([SDK](https://dev.wix.com/docs/sdk/backend-modules/stores/introduction.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/stores/about-wix-stores.md)). + `service.name` for Bookings ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/introduction.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/about-wix-bookings.md)).  | validation: format GUID
              - name: appId | type: string | description: GUID of the app ([SDK](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/apps-created-by-wix.md) | [REST](https://dev.wix.com/docs/rest/articles/getting-started/apps-created-by-wix.md)) to which the catalog belongs.  Supported app GUIDs: + [Wix Tips](https://www.wix.com/app-market/wix-tips): `"869a50c8-dd38-4324-b201-e33dc0747a5f"` + [Wix Stores](https://www.wix.com/app-market/wix-stores): `"215238eb-22a5-4c36-9e7b-e7c08025e04e"` + [Wix Bookings](https://www.wix.com/app-market/bookings): `"13d21c63-b5ec-5912-8397-c3a5ddb27a97"` + [Wix Restaurants Orders](https://www.wix.com/app-market/web-solution/wix-restaurants-orders-new): `"13e8d036-5516-6104-b456-c8466db39542"`  | validation: format GUID
           - name: price | type: string | description: Price of the line item.  Min: `0.00`  | validation: format DECIMAL_VALUE, decimalValue {"gte":"0","maxScale":2}
           - name: name | type: string | description: Name of the line item, which is identical to: + `product.name` for Stores ([SDK](https://dev.wix.com/docs/sdk/backend-modules/stores/introduction.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/stores/about-wix-stores.md)). + `service.name` for Bookings ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/introduction.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/about-wix-bookings.md)).  Min: 1 character  <br/> Max: 200 characters  | validation: minLength 1, maxLength 200
           - name: quantity | type: integer | description: Quantity of the line item.  Min: `1` <br/> Max: `100000` (one hundred thousand)  | validation: minimum 1, maximum 100000, format int32
        - name: transaction | type: Transaction | description: Details of how the customer is charged for the tip. Available only if the transaction ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/order-transactions/setup.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/order-transactions/order-transactions-object.md)) has been created.  
           - name: _id | type: string | description: GUID of the transaction that's associated with the tip distribution.  | validation: format GUID
           - name: date | type: Date | description: Date and time the transaction was created in `YYYY-MM-DDThh:mm:ss.sssZ` format. Isn't identical to the time the customer was actually charged.  
        - name: orderId | type: string | description: GUID of the eCommerce order ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/introduction.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/order-object.md)) associated with the tip distribution. Identical for all distributions that belong to the same tip.  | read-only: true | validation: format GUID
        - name: _createdDate | type: Date | description: Date and time the distribution was created in `YYYY-MM-DDThh:mm:ss.sssZ` format.  | read-only: true 
        - name: source | type: Source | description: Information about who created the tip distributions.  
             - enum:
             -     UNKNOWN_SOURCE: There is no information about who created the tip distributions.
             -     POS: The customer added the tip distributions via an external payment terminal.
             -     WEB: The customer added the tip distributions during an online eCommerce checkout ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/introduction.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/checkout/introduction.md)).
             -     DASHBOARD: The business added the tip distributions on behalf of the customer in the site's dashboard.
     - name: undistributedAmount | type: string | description: Undistributed tip amount. Calculated as the difference between `tip.amount` and the sum of all `tip.tipDistributions.amount` values.  Min: `0.01`  | read-only: true | validation: format DECIMAL_VALUE, decimalValue {"gt":"0","maxScale":2}

 Possible Errors:
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: CATALOG_ITEMS_NOT_FOUND | Description: Couldn't find the catalog items.
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: TIP_SETTINGS_NOT_FOUND | Description: Couldn't find the tip settings.


```

### Examples

### previewTip
```javascript
import { tips } from '@wix/ecom';

async function previewTip(lineItemInfo,options) {
  const response = await tips.previewTip(lineItemInfo,options);
};
```

### previewTip (with elevated permissions)
```javascript
import { tips } from '@wix/ecom';
import { auth } from '@wix/essentials';

async function myPreviewTipMethod(lineItemInfo,options) {
  const elevatedPreviewTip = auth.elevate(tips.previewTip);
  const response = await elevatedPreviewTip(lineItemInfo,options);
}
```

### previewTip (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 { tips } from '@wix/ecom';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { tips },
  // Include the auth strategy and host as relevant
});


async function previewTip(lineItemInfo,options) {
  const response = await myWixClient.tips.previewTip(lineItemInfo,options);
};
```

---