> 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

# QueryTipDistributions

# Package: tips

# Namespace: TipsService

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

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

## Introduction

Retrieves a list of up to 100 tip distributions, given the provided paging, filtering, and sorting.

Query Tip Distributions runs with these defaults, which you can override:
- `cursorPaging.limit` is `50`

When setting a date filter remember to use
[UTC time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time).

To learn about working with _Query_ endpoints, see
[API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language),
[Sorting and Paging](https://dev.wix.com/api/rest/getting-started/sorting-and-paging),
and [Field Projection](https://dev.wix.com/api/rest/getting-started/field-projection).

---

## REST API

### Schema

```
 Method: queryTipDistributions
 Description: Retrieves a list of up to 100 tip distributions, given the provided paging, filtering, and sorting.  Query Tip Distributions runs with these defaults, which you can override: - `cursorPaging.limit` is `50`  When setting a date filter remember to use [UTC time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time).  To learn about working with _Query_ endpoints, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language), [Sorting and Paging](https://dev.wix.com/api/rest/getting-started/sorting-and-paging), and [Field Projection](https://dev.wix.com/api/rest/getting-started/field-projection).
 URL: https://www.wixapis.com/tips/v1/tips/tip-distributions/query
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  query
 Method parameters: 
   param name: query | type: CursorQuery   | required: true 
     - name: cursorPaging | type: CursorPaging | description: Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`.  
        - name: limit | type: integer | description: Number of items to load.  | validation: minimum 0, maximum 100, format int32
        - name: cursor | type: string | description: Pointer to the next or previous page in the list of results.  You can get the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request.  | validation: maxLength 16000
        - name: filter | type: object | description: Filter object in the following format: `"filter" : { "fieldName1": "value1", "fieldName2":{"$operator":"value2"} }` Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`  
        - name: sort | type: array<Sorting> | description: Sort object in the following format: `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`  | validation: maxItems 4
           - name: fieldName | type: string | description: Name of the field to sort by.  | validation: maxLength 50
           - name: order | type: SortOrder | description: Sort order.  
                 - enum: ASC, DESC
 Query fields:
   - field: id | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
 Return type: QueryTipDistributionsResponse
  - name: tipDistributions | type: array<TipDistribution> | description: Retrieved tip distributions.  
     - 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: pagingMetadata | type: CursorPagingMetadata | description: Paging metadata.  
     - name: count | type: integer | description: Number of items returned in the response.  | validation: format int32
     - name: cursors | type: Cursors | description: Offset that was requested.  
        - name: next | type: string | description: Cursor pointing to next page in the list of results.  | validation: maxLength 16000
        - name: prev | type: string | description: Cursor pointing to previous page in the list of results.  | validation: maxLength 16000
     - name: hasNext | type: boolean | description: Indicates if there are more results after the current page. If `true`, another page of results can be retrieved. If `false`, this is the last page.  


```

### Examples

### Query tip distributions
```curl
curl -X POST \
'https://www.wixapis.com/tips-service/v1/tips/tip-distributions/query' \
-H 'Authorization: <AUTH>' \
-d '{
  "query": {
    "filter": {
      "tipId": {
        "$eq": "6f54fea4-0504-4f19-9f49-cb04a55a99bc"
      }
    },
    "cursorPaging": {
      "limit": 15
    }
  }
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.ecom.tips.queryTipDistributions(query)
 Description: Retrieves a list of up to 100 tip distributions, given the provided paging, filtering, and sorting.  Query Tip Distributions runs with these defaults, which you can override: - `cursorPaging.limit` is `50`  When setting a date filter remember to use [UTC time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time).  To learn about working with _Query_ endpoints, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language), [Sorting and Paging](https://dev.wix.com/api/rest/getting-started/sorting-and-paging), and [Field Projection](https://dev.wix.com/api/rest/getting-started/field-projection).
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  query
 Method parameters: 
   param name: query | type: TipQuery   | required: true 
     - name: cursorPaging | type: CursorPaging | description: Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`.  
        - name: limit | type: integer | description: Number of items to load.  | validation: minimum 0, maximum 100, format int32
        - name: cursor | type: string | description: Pointer to the next or previous page in the list of results.  You can get the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request.  | validation: maxLength 16000
        - name: filter | type: object | description: Filter object in the following format: `"filter" : { "fieldName1": "value1", "fieldName2":{"$operator":"value2"} }` Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`  
        - name: sort | type: array<Sorting> | description: Sort object in the following format: `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`  | validation: maxItems 4
           - name: fieldName | type: string | description: Name of the field to sort by.  | validation: maxLength 50
           - name: order | type: SortOrder | description: Sort order.  
                 - enum: ASC, DESC
 Query fields:
   - field: _id | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
 Return type: PROMISE<QueryTipDistributionsResponse>
  - name: tipDistributions | type: array<TipDistribution> | description: Retrieved tip distributions.  
     - 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: pagingMetadata | type: CursorPagingMetadata | description: Paging metadata.  
     - name: count | type: integer | description: Number of items returned in the response.  | validation: format int32
     - name: cursors | type: Cursors | description: Offset that was requested.  
        - name: next | type: string | description: Cursor pointing to next page in the list of results.  | validation: maxLength 16000
        - name: prev | type: string | description: Cursor pointing to previous page in the list of results.  | validation: maxLength 16000
     - name: hasNext | type: boolean | description: Indicates if there are more results after the current page. If `true`, another page of results can be retrieved. If `false`, this is the last page.  


```

### Examples

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

async function queryTipDistributions(query) {
  const response = await tips.queryTipDistributions(query);
};
```

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

async function myQueryTipDistributionsMethod(query) {
  const elevatedQueryTipDistributions = auth.elevate(tips.queryTipDistributions);
  const response = await elevatedQueryTipDistributions(query);
}
```

### queryTipDistributions (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 queryTipDistributions(query) {
  const response = await myWixClient.tips.queryTipDistributions(query);
};
```

---