> 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

# QueryPoolDefinitionItems

# Package: benefitPrograms

# Namespace: PoolDefinitionItemService

# Method link: https://dev.wix.com/docs/api-reference/business-solutions/benefit-programs/pool-definition-items/query-pool-definition-items.md

## Permission Scopes:
Read benefit programs: SCOPE.BENEFIT_PROGRAMS.READ

## Introduction

Retrieves a list of up to 1,000 pool definition items, given the provided paging, filtering, and sorting.

Removed pool definition items aren't returned. Pool definition items are created and removed asynchronously after calls to [Add Items to Benefit](https://dev.wix.com/docs/api-reference/business-solutions/benefit-programs/pool-definition-items/add-items-to-benefit.md) and [Remove Items from Benefit](https://dev.wix.com/docs/api-reference/business-solutions/benefit-programs/pool-definition-items/remove-items-from-benefit.md), so recent changes may take a short time to appear in the results.

To include additional details in each returned pool definition item, pass 1 or more values in the `fields` parameter. If the related data isn't available, the enrichment details may be omitted from the response. The base fields of each pool definition item, including the `id` and `externalId` of each program definition, are always returned.

Query Pool Definition Items runs with these defaults, which you can override:

- `id` is sorted in `ASC` order
- `cursorPaging.limit` is `50`

To learn about working with Query methods, see [API Query Language](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language.md), [Sorting and Paging](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-sorting-and-paging.md), and [Field Projection](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-field-projection.md).

---

## REST API

### Schema

```
 Method: queryPoolDefinitionItems
 Description: Retrieves a list of up to 1,000 pool definition items, given the provided paging, filtering, and sorting.  Removed pool definition items aren't returned. Pool definition items are created and removed asynchronously after calls to [Add Items to Benefit](https://dev.wix.com/docs/api-reference/business-solutions/benefit-programs/pool-definition-items/add-items-to-benefit.md) and [Remove Items from Benefit](https://dev.wix.com/docs/api-reference/business-solutions/benefit-programs/pool-definition-items/remove-items-from-benefit.md), so recent changes may take a short time to appear in the results.  To include additional details in each returned pool definition item, pass 1 or more values in the `fields` parameter. If the related data isn't available, the enrichment details may be omitted from the response. The base fields of each pool definition item, including the `id` and `externalId` of each program definition, are always returned.  Query Pool Definition Items runs with these defaults, which you can override:  - `id` is sorted in `ASC` order - `cursorPaging.limit` is `50`  To learn about working with Query methods, see [API Query Language](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language.md), [Sorting and Paging](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-sorting-and-paging.md), and [Field Projection](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-field-projection.md).
 URL: https://www.wixapis.com/benefit-programs/v1/pool-definition-items/query
 Method: POST
 Method parameters:
   param name: fields | type: array<fields> | description: Additional details to include in each returned pool definition item, such as display names and benefit pricing.  Each value adds lookups to related entities, so request only the details you need.  | validation: maxItems 4
                 - enum:
                 -     POOL_DEFINITION: Populates the `poolDefinition` field with the pool definition's display name, description, and credit configuration.
                 -     PROGRAM_DEFINITION: Populates `displayName` and `description` for each program definition in the `programDefinitions` array. Use it to show which plans give access to an item.
                 -     BENEFIT: Populates the `benefitInfo` field with the benefit's credit price, display name, and description.
                 -     ITEM: Populates the `itemInfo` field with the catalog item's display name.
   param name: query | type: CursorQuery    
     - 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: Maximum number of items to return in the results.  | validation: minimum 0, maximum 1000, format int32
        - name: cursor | type: string | description: Pointer to the next or previous page in the list of results.  Pass 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 5
           - name: fieldName | type: string | description: Name of the field to sort by.  | validation: maxLength 512
           - 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
   - field: externalId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: providerAppId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: category | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: namespace | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: poolDefinitionId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: createdDate | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: itemSetId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: programDefinitions.id | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: programDefinitions.externalId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: benefitKey | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: itemSearchKey | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
 Return type: QueryPoolDefinitionItemsResponse
  - name: poolDefinitionItems | type: array<PoolDefinitionItem> | description: Retrieved pool definition items.  
     - name: id | type: string | description: Pool definition item GUID.  The GUID is derived from `poolDefinitionId` and `itemId`, so it stays the same for a given pool definition and item.  | read-only: true | validation: format GUID
     - name: revision | type: string | description: Revision number, which increments by 1 each time the pool definition item is updated.  | read-only: true | validation: format int64
     - name: createdDate | type: string | description: Date and time the pool definition item was created.  | read-only: true | validation: format date-time
     - name: updatedDate | type: string | description: Date and time the pool definition item was updated.  | read-only: true | validation: format date-time
     - name: externalId | type: string | description: External item GUID assigned by the provider app.  For example, if the items are products, this GUID corresponds to the specific product GUID in the provider app's system.  | read-only: true | validation: format GUID, immutable
     - name: category | type: string | description: Item category. Groups benefit items together for organization and management. For example, `classes`, `posts`, or `groups`.  | read-only: true | validation: maxLength 20, immutable
     - name: providerAppId | type: string | description: GUID of the app that provides the item. Each item's `externalId` is unique within its provider app.  Inherited from the benefit's configuration in the pool definition.  | read-only: true | validation: format GUID, immutable
     - name: namespace | type: string | description: Namespace for your app or site's benefit programs. Namespaces allow you to distinguish between entities that you created and entities that other apps created.  Inherited from the benefit's configuration in the pool definition.  | read-only: true | validation: minLength 1, maxLength 20, immutable
     - name: poolDefinitionId | type: string | description: GUID of the pool definition that contains the benefit this item is assigned to.  | read-only: true | validation: format GUID, immutable
     - name: itemSetId | type: string | description: GUID of the item set that groups the items of this pool definition item's benefit.  To identify a benefit, use `poolDefinitionId` together with `benefitKey` instead of `itemSetId`.  | read-only: true | validation: format GUID, immutable
     - name: poolDefinition | type: PoolDefinitionInfo | description: Pool definition details, including display name, description, and credit configuration.  Returned only when `POOL_DEFINITION` is included in the `fields` request parameter.  | read-only: true 
        - name: displayName | type: string | description: Pool definition display name.  | validation: maxLength 64
        - name: description | type: string | description: Pool definition description.  | validation: maxLength 450
        - name: creditConfiguration | type: CreditConfiguration | description: Credit configuration of the pool definition.  Returned only when the pool definition uses credit-based pricing.  
           - name: amount | type: string | description: Number of credits granted to a beneficiary when a pool is created from this pool definition.  | validation: decimalValue {"gte":"0","maxScale":4}
           - name: unitDisplayName | type: string | description: Credit unit display name.  | validation: maxLength 32
           - name: unitType | type: string | description: Credit unit type. For example, `PUNCH_CARD` or `CREDIT`.  | validation: maxLength 16
     - name: programDefinitions | type: array<ProgramDefinitionInfo> | description: Program definitions that include this pool definition item's pool definition.  Each program definition's `id` and `externalId` are always returned. `displayName` and `description` are returned only when `PROGRAM_DEFINITION` is included in the `fields` request parameter.  | read-only: true | validation: maxItems 20
        - name: id | type: string | description: Program definition GUID.  | validation: format GUID
        - name: externalId | type: string | description: External program definition GUID, if set.  | validation: format GUID
        - name: displayName | type: string | description: Program definition display name.  Returned only when `PROGRAM_DEFINITION` is included in the `fields` request parameter.  | validation: maxLength 64
        - name: description | type: string | description: Program definition description.  Returned only when `PROGRAM_DEFINITION` is included in the `fields` request parameter.  | validation: maxLength 450
     - name: itemId | type: string | description: GUID of the item that's assigned to the benefit.  | read-only: true | validation: format GUID, immutable
     - name: benefitInfo | type: BenefitInfo | description: Benefit details, including credit price, display name, and description.  Returned only when `BENEFIT` is included in the `fields` request parameter.  | read-only: true 
        - name: price | type: string | description: Price of the benefit in credits. The price is the same for all of the benefit's items.  Returned only when the benefit uses credit-based pricing.  | validation: decimalValue {"gte":"0","maxScale":4}
        - name: displayName | type: string | description: Benefit display name.  | validation: maxLength 40
        - name: description | type: string | description: Benefit description.  | validation: maxLength 255
     - name: itemInfo | type: ItemInfo | description: Catalog item details, including display name.  Returned only when `ITEM` is included in the `fields` request parameter.  | read-only: true 
        - name: displayName | type: string | description: Item display name.  | validation: maxLength 400
     - name: benefitKey | type: string | description: Key of the benefit that the item is assigned to. Unique within the pool definition.  | read-only: true | validation: maxLength 64, immutable
     - name: itemSearchKey | type: string | description: Pre-computed search key for the item, built by joining `providerAppId`, `category`, and `externalId` with `/`. For example, `a1c7e2f4-3b5d-4e8a-9c6f-2d4b8e1a7c35/classes/7f3e9b21-4c8a-4d6e-b5f2-9a1c3e7d8b40`.  Filtering by `itemSearchKey` is more efficient than filtering by `providerAppId`, `category`, and `externalId` in 3 separate conditions.  | read-only: true | validation: maxLength 94, immutable
     - name: removed | type: boolean | description: Whether the pool definition item was removed.  [Query Pool Definition Items](https://dev.wix.com/docs/api-reference/business-solutions/benefit-programs/pool-definition-items/query-pool-definition-items.md) doesn't return removed pool definition items, so this field is always `false` or absent in query results.  | read-only: true 
  - name: metadata | type: CursorPagingMetadata | description: Metadata for paginated results.  
     - name: count | type: integer | description: Number of items returned in the response.  | validation: format int32
     - name: cursors | type: Cursors | description: Cursor strings that point to the next page, previous page, or both.  
        - name: next | type: string | description: Cursor string pointing to the next page in the list of results.  | validation: maxLength 16000
        - name: prev | type: string | description: Cursor pointing to the previous page in the list of results.  | validation: maxLength 16000
     - name: hasNext | type: boolean | description: Whether there are more pages to retrieve following the current page.  + `true`: Another page of results can be retrieved. + `false`: This is the last page.  


```

### Examples

### Query the items assigned to a benefit
Retrieves the pool definition items assigned to a specific benefit in a pool definition, with item and benefit details.

```curl
curl -X POST \
'https://www.wixapis.com/benefit-programs/v1/pool-definition-items/query' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "query": {
    "filter": {
      "poolDefinitionId": {
        "$eq": "76bdb96b-9860-4fb6-a5b8-faf41ebdb26a"
      },
      "benefitKey": {
        "$eq": "yoga-class"
      }
    },
    "cursorPaging": {
      "limit": 50
    }
  },
  "fields": ["ITEM", "BENEFIT"]
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.benefitPrograms.poolDefinitionItems.queryPoolDefinitionItems(query, options)
 Description: Retrieves a list of up to 1,000 pool definition items, given the provided paging, filtering, and sorting.  Removed pool definition items aren't returned. Pool definition items are created and removed asynchronously after calls to [Add Items to Benefit](https://dev.wix.com/docs/api-reference/business-solutions/benefit-programs/pool-definition-items/add-items-to-benefit.md) and [Remove Items from Benefit](https://dev.wix.com/docs/api-reference/business-solutions/benefit-programs/pool-definition-items/remove-items-from-benefit.md), so recent changes may take a short time to appear in the results.  To include additional details in each returned pool definition item, pass 1 or more values in the `fields` parameter. If the related data isn't available, the enrichment details may be omitted from the response. The base fields of each pool definition item, including the `id` and `externalId` of each program definition, are always returned.  Query Pool Definition Items runs with these defaults, which you can override:  - `id` is sorted in `ASC` order - `cursorPaging.limit` is `50`  To learn about working with Query methods, see [API Query Language](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language.md), [Sorting and Paging](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-sorting-and-paging.md), and [Field Projection](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-field-projection.md).
 # 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: PoolDefinitionItemQuery   | 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: Maximum number of items to return in the results.  | validation: minimum 0, maximum 1000, format int32
        - name: cursor | type: string | description: Pointer to the next or previous page in the list of results.  Pass 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 5
           - name: fieldName | type: string | description: Name of the field to sort by.  | validation: maxLength 512
           - name: order | type: SortOrder | description: Sort order.  
                 - enum: ASC, DESC
   param name: options | type: QueryPoolDefinitionItemsOptions  none  
        - name: fields | type: array<RequestedFields> | description: Additional details to include in each returned pool definition item, such as display names and benefit pricing.  Each value adds lookups to related entities, so request only the details you need.  | validation: maxItems 4
             - enum:
             -     POOL_DEFINITION: Populates the `poolDefinition` field with the pool definition's display name, description, and credit configuration.
             -     PROGRAM_DEFINITION: Populates `displayName` and `description` for each program definition in the `programDefinitions` array. Use it to show which plans give access to an item.
             -     BENEFIT: Populates the `benefitInfo` field with the benefit's credit price, display name, and description.
             -     ITEM: Populates the `itemInfo` field with the catalog item's display name.
 Query fields:
   - field: _id | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: externalId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: providerAppId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: category | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: namespace | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: poolDefinitionId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: _createdDate | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: itemSetId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: programDefinitions._id | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: programDefinitions.externalId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: benefitKey | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: itemSearchKey | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
 Return type: PROMISE<QueryPoolDefinitionItemsResponse>
  - name: poolDefinitionItems | type: array<PoolDefinitionItem> | description: Retrieved pool definition items.  
     - name: _id | type: string | description: Pool definition item GUID.  The GUID is derived from `poolDefinitionId` and `itemId`, so it stays the same for a given pool definition and item.  | read-only: true | validation: format GUID
     - name: revision | type: string | description: Revision number, which increments by 1 each time the pool definition item is updated.  | read-only: true | validation: format int64
     - name: _createdDate | type: Date | description: Date and time the pool definition item was created.  | read-only: true 
     - name: _updatedDate | type: Date | description: Date and time the pool definition item was updated.  | read-only: true 
     - name: externalId | type: string | description: External item GUID assigned by the provider app.  For example, if the items are products, this GUID corresponds to the specific product GUID in the provider app's system.  | read-only: true | validation: format GUID, immutable
     - name: category | type: string | description: Item category. Groups benefit items together for organization and management. For example, `classes`, `posts`, or `groups`.  | read-only: true | validation: maxLength 20, immutable
     - name: providerAppId | type: string | description: GUID of the app that provides the item. Each item's `externalId` is unique within its provider app.  Inherited from the benefit's configuration in the pool definition.  | read-only: true | validation: format GUID, immutable
     - name: namespace | type: string | description: Namespace for your app or site's benefit programs. Namespaces allow you to distinguish between entities that you created and entities that other apps created.  Inherited from the benefit's configuration in the pool definition.  | read-only: true | validation: minLength 1, maxLength 20, immutable
     - name: poolDefinitionId | type: string | description: GUID of the pool definition that contains the benefit this item is assigned to.  | read-only: true | validation: format GUID, immutable
     - name: itemSetId | type: string | description: GUID of the item set that groups the items of this pool definition item's benefit.  To identify a benefit, use `poolDefinitionId` together with `benefitKey` instead of `itemSetId`.  | read-only: true | validation: format GUID, immutable
     - name: poolDefinition | type: PoolDefinitionInfo | description: Pool definition details, including display name, description, and credit configuration.  Returned only when `POOL_DEFINITION` is included in the `fields` request parameter.  | read-only: true 
        - name: displayName | type: string | description: Pool definition display name.  | validation: maxLength 64
        - name: description | type: string | description: Pool definition description.  | validation: maxLength 450
        - name: creditConfiguration | type: CreditConfiguration | description: Credit configuration of the pool definition.  Returned only when the pool definition uses credit-based pricing.  
           - name: amount | type: string | description: Number of credits granted to a beneficiary when a pool is created from this pool definition.  | validation: decimalValue {"gte":"0","maxScale":4}
           - name: unitDisplayName | type: string | description: Credit unit display name.  | validation: maxLength 32
           - name: unitType | type: string | description: Credit unit type. For example, `PUNCH_CARD` or `CREDIT`.  | validation: maxLength 16
     - name: programDefinitions | type: array<ProgramDefinitionInfo> | description: Program definitions that include this pool definition item's pool definition.  Each program definition's `id` and `externalId` are always returned. `displayName` and `description` are returned only when `PROGRAM_DEFINITION` is included in the `fields` request parameter.  | read-only: true | validation: maxItems 20
        - name: _id | type: string | description: Program definition GUID.  | validation: format GUID
        - name: externalId | type: string | description: External program definition GUID, if set.  | validation: format GUID
        - name: displayName | type: string | description: Program definition display name.  Returned only when `PROGRAM_DEFINITION` is included in the `fields` request parameter.  | validation: maxLength 64
        - name: description | type: string | description: Program definition description.  Returned only when `PROGRAM_DEFINITION` is included in the `fields` request parameter.  | validation: maxLength 450
     - name: itemId | type: string | description: GUID of the item that's assigned to the benefit.  | read-only: true | validation: format GUID, immutable
     - name: benefitInfo | type: BenefitInfo | description: Benefit details, including credit price, display name, and description.  Returned only when `BENEFIT` is included in the `fields` request parameter.  | read-only: true 
        - name: price | type: string | description: Price of the benefit in credits. The price is the same for all of the benefit's items.  Returned only when the benefit uses credit-based pricing.  | validation: decimalValue {"gte":"0","maxScale":4}
        - name: displayName | type: string | description: Benefit display name.  | validation: maxLength 40
        - name: description | type: string | description: Benefit description.  | validation: maxLength 255
     - name: itemInfo | type: ItemInfo | description: Catalog item details, including display name.  Returned only when `ITEM` is included in the `fields` request parameter.  | read-only: true 
        - name: displayName | type: string | description: Item display name.  | validation: maxLength 400
     - name: benefitKey | type: string | description: Key of the benefit that the item is assigned to. Unique within the pool definition.  | read-only: true | validation: maxLength 64, immutable
     - name: itemSearchKey | type: string | description: Pre-computed search key for the item, built by joining `providerAppId`, `category`, and `externalId` with `/`. For example, `a1c7e2f4-3b5d-4e8a-9c6f-2d4b8e1a7c35/classes/7f3e9b21-4c8a-4d6e-b5f2-9a1c3e7d8b40`.  Filtering by `itemSearchKey` is more efficient than filtering by `providerAppId`, `category`, and `externalId` in 3 separate conditions.  | read-only: true | validation: maxLength 94, immutable
     - name: removed | type: boolean | description: Whether the pool definition item was removed.  [Query Pool Definition Items](https://dev.wix.com/docs/api-reference/business-solutions/benefit-programs/pool-definition-items/query-pool-definition-items.md) doesn't return removed pool definition items, so this field is always `false` or absent in query results.  | read-only: true 
  - name: metadata | type: CursorPagingMetadata | description: Metadata for paginated results.  
     - name: count | type: integer | description: Number of items returned in the response.  | validation: format int32
     - name: cursors | type: Cursors | description: Cursor strings that point to the next page, previous page, or both.  
        - name: next | type: string | description: Cursor string pointing to the next page in the list of results.  | validation: maxLength 16000
        - name: prev | type: string | description: Cursor pointing to the previous page in the list of results.  | validation: maxLength 16000
     - name: hasNext | type: boolean | description: Whether there are more pages to retrieve following the current page.  + `true`: Another page of results can be retrieved. + `false`: This is the last page.  


```

### Examples

### Query the items assigned to a benefit
Retrieves the pool definition items assigned to a specific benefit in a pool definition, with item and benefit details.

```javascript
import { poolDefinitionItems } from "@wix/benefit-programs";

async function queryPoolDefinitionItems() {
  const response = await poolDefinitionItems.queryPoolDefinitionItems(
    {
      filter: {
        poolDefinitionId: "76bdb96b-9860-4fb6-a5b8-faf41ebdb26a",
        benefitKey: "yoga-class",
      },
      cursorPaging: { limit: 50 },
    },
    { fields: ["ITEM", "BENEFIT"] },
  );
}

/* Promise resolves to:
 * {
 *   "poolDefinitionItems": [
 *     {
 *       "_id": "a47ac2d5-2213-3fef-8a0a-92f957498566",
 *       "revision": "1",
 *       "_createdDate": "2026-10-21T06:29:30.497Z",
 *       "_updatedDate": "2026-10-21T06:29:30.497Z",
 *       "externalId": "7f3e9b21-4c8a-4d6e-b5f2-9a1c3e7d8b40",
 *       "category": "classes",
 *       "providerAppId": "28b3fe48-a2d4-4e5c-aa0d-313ba7de5081",
 *       "namespace": "fitness-app",
 *       "poolDefinitionId": "76bdb96b-9860-4fb6-a5b8-faf41ebdb26a",
 *       "itemSetId": "0cc6e048-49a1-4fd2-80e8-453abc735423",
 *       "itemId": "0afb61fe-2f24-46dd-babc-3c0b1e037902",
 *       "benefitInfo": {
 *         "price": "3",
 *         "displayName": "Yoga Session",
 *         "description": "Access to weekly yoga classes"
 *       },
 *       "itemInfo": {
 *         "displayName": "Morning Yoga"
 *       },
 *       "benefitKey": "yoga-class",
 *       "itemSearchKey": "28b3fe48-a2d4-4e5c-aa0d-313ba7de5081/classes/7f3e9b21-4c8a-4d6e-b5f2-9a1c3e7d8b40"
 *     }
 *   ],
 *   "metadata": {
 *     "count": 1,
 *     "hasNext": false
 *   }
 * }
 */

```

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

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


async function queryPoolDefinitionItems(query,options) {
  const response = await myWixClient.poolDefinitionItems.queryPoolDefinitionItems(query,options);
};
```

---