> 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

# QueryPoolItems

# Package: benefitPrograms

# Namespace: PoolItemService

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

## Permission Scopes:
Read benefit programs: SCOPE.BENEFIT_PROGRAMS.READ
SCOPE.BENEFIT_PROGRAMS.READ (PII): SCOPE.BENEFIT_PROGRAMS.READ_LIMITED

## Introduction

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

When called by a logged-in member, the response is automatically scoped to the calling member. App callers must include an explicit `beneficiary.memberId` filter to scope the response to a specific beneficiary.

Removed pool items aren't returned. Pool items are created and removed asynchronously as the underlying pools and items change, so recent changes may take a short time to appear in the results.

Query Pool 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: queryPoolItems
 Description: Retrieves a list of up to 1,000 pool items, given the provided paging, filtering, and sorting.  When called by a logged-in member, the response is automatically scoped to the calling member. App callers must include an explicit `beneficiary.memberId` filter to scope the response to a specific beneficiary.  Removed pool items aren't returned. Pool items are created and removed asynchronously as the underlying pools and items change, so recent changes may take a short time to appear in the results.  Query Pool 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-items/query
 Method: POST
 Method parameters:
   param name: fields | type: array<fields> | description: Additional details to include in each returned pool item, such as display names, benefit pricing, and the pool's credit balance.  Each value adds lookups to related entities, so request only the details you need.  | validation: maxItems 6
                 - enum:
                 -     POOL: Populates the `pool` field with the pool's display name, description, status, and credit configuration.
                 -     PROGRAM: Populates the `program` field with the program's ID, display name, and external ID, if set.
                 -     PROGRAM_DEFINITION: Populates the `programDefinition` field with the program definition's ID, display name, description, and external ID, if set.
                 -     ITEM: Populates the `itemInfo` field with the catalog item's display name.
                 -     BENEFIT: Populates the `benefitInfo` field with the benefit's key, credit price, display name, and description.
                 -     BALANCE: Populates the `balance` field with the pool's available credit balance.
   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: createdDate | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte | 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: category | 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: namespace | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: poolId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | 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: poolDefinitionId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: programDefinitionId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: programId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: beneficiary.memberId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: externalProgramDefinitionId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: externalProgramId | 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: QueryPoolItemsResponse
  - name: poolItems | type: array<PoolItem> | description: List of retrieved pool items.  
     - name: id | type: string | description: Pool item GUID. Generated deterministically from `poolId` and `itemId`.  | read-only: true | validation: format GUID
     - name: revision | type: string | description: Revision number, which increments by 1 each time the pool item is updated.  | read-only: true | validation: format int64
     - name: createdDate | type: string | description: Date and time the pool item was created.  | read-only: true | validation: format date-time
     - name: updatedDate | type: string | description: Date and time the pool 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 application that provides the benefit items. Each item's `externalId` is unique within its provider application.  | read-only: true | validation: format GUID, immutable
     - name: namespace | type: string | description: Namespace for your app or site's benefit programs. Namespaces let you distinguish between entities that you created and entities that other apps created.  | read-only: true | validation: minLength 1, maxLength 20, immutable
     - name: poolId | type: string | description: GUID of the pool that contains this item. A pool is the runtime container of benefits and items provisioned for a beneficiary.  | read-only: true | validation: format GUID, immutable
     - name: programId | type: string | description: GUID of the program that contains this pool item. The program is the runtime instance of a program definition for a specific beneficiary.  | read-only: true | validation: format GUID, immutable
     - name: externalProgramId | type: string | description: External program GUID assigned by the provider.  | read-only: true | validation: format GUID
     - name: programDefinitionId | type: string | description: GUID of the program definition that's the template for this pool item's program.  | read-only: true | validation: format GUID, immutable
     - name: externalProgramDefinitionId | type: string | description: External program definition GUID assigned by the provider.  | read-only: true | validation: format GUID, immutable
     - name: poolDefinitionId | type: string | description: GUID of the pool definition that's the template for this pool item's pool.  | read-only: true | validation: format GUID, immutable
     - name: itemSetId | type: string | description: GUID of the item set that groups the items of this pool item's benefit.  To identify a benefit, use `poolId` together with `benefitKey` instead of `itemSetId`.  | read-only: true | validation: format GUID, immutable
     - name: beneficiary | type: IdentificationData | description: Beneficiary of the pool. The member, contact, or visitor who can access this pool item.  | read-only: true | validation: immutable
        - ONE-OF: 
           - name: anonymousVisitorId | type: string | description: GUID of a site visitor that hasn't logged in to the site.  | validation: format GUID
           - name: memberId | type: string | description: GUID of a site member.  | validation: format GUID
           - name: wixUserId | type: string | description: GUID of a Wix user.  | validation: format GUID
     - name: pool | type: PoolInfo | description: Pool details, including display name and description.  Returned only when `POOL` is included in the `fields` request parameter.  | read-only: true 
        - name: displayName | type: string | description: Pool's display name. Often matches the name on the associated pool definition.  | validation: maxLength 64
        - name: description | type: string | description: Pool description.  | validation: maxLength 450
        - name: status | type: PoolStatus | description: Status of the pool that contains this item.  | read-only: true 
             - enum:
             -     ACTIVE: Pool is active.
             -     PAUSED: Pool is paused. It can be resumed.
             -     ENDED: Pool is ended. It can't be resumed.
             -     PROVISIONING: Pool provisioning is in progress. This status exists for a short time during processing.
             -     RENEWING: Pool renewing is in progress. This status exists for a short time during processing.
             -     PENDING: Pool is pending
        - name: creditConfiguration | type: CreditConfiguration | description: Credit configuration of the pool.  Returned only when the pool uses credit-based pricing.  | read-only: true 
           - name: amount | type: string | description: Number of credits allocated to the pool.  | 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, `point` or `token`.  | validation: maxLength 16
     - name: program | type: ProgramInfo | description: Program details, including the program's GUID, display name, and external GUID, if set.  Returned only when `PROGRAM` is included in the `fields` request parameter.  | read-only: true 
        - name: id | type: string | description: Program GUID.  | validation: format GUID
        - name: externalId | type: string | description: External program GUID assigned by the provider.  | validation: format GUID
        - name: displayName | type: string | description: Program's display name.  | validation: maxLength 64
     - name: programDefinition | type: ProgramDefinitionInfo | description: Program definition details, including the program definition's GUID, display name, description, and external GUID, if set.  Returned only when `PROGRAM_DEFINITION` is included in the `fields` request parameter.  | read-only: true 
        - name: id | type: string | description: Program definition GUID.  | validation: format GUID
        - name: externalId | type: string | description: External program definition GUID assigned by the provider.  | validation: format GUID
        - name: displayName | type: string | description: Program definition's display name.  | validation: maxLength 64
        - name: description | type: string | description: Program definition description.  | validation: maxLength 450
     - name: itemId | type: string | description: GUID of the catalog item that this pool item gives access to.  | read-only: true | validation: format GUID, immutable
     - name: itemInfo | type: ItemInfo | description: Display name for the catalog item.  Returned only when `ITEM` is included in the `fields` request parameter.  | read-only: true 
        - name: displayName | type: string | description: Item's display name.  | validation: maxLength 400
     - name: benefitInfo | type: BenefitInfo | description: Pricing and display information for the associated benefit, including credit price, name, and description.  Returned only when `BENEFIT` is included in the `fields` request parameter.  | read-only: true 
        - name: price | type: string | description: Cost of the benefit in credits. The cost is the same for all items in this benefit.  Credits are a configurable unit defined on the parent pool definition. The unit type is set in the pool definition's credit configuration. Absent when no credit-based pricing is configured for this benefit.  | validation: decimalValue {"gte":"0","maxScale":4}
        - name: benefitKey | type: string | description: Unique identifier for this benefit. Same value as `poolItem.benefitKey`.  | validation: maxLength 64
        - name: displayName | type: string | description: Benefit's display name.  | validation: maxLength 40
        - name: description | type: string | description: Benefit description.  | validation: maxLength 255
     - name: balance | type: BalanceInfo | description: Credit balance of the pool that contains this item.  Returned only when `BALANCE` is included in the `fields` request parameter.  | read-only: true 
        - name: available | type: string | description: Number of available credits in the pool.  Credits are a configurable unit defined on the parent pool definition.  | read-only: true | validation: decimalValue {"gte":"0","maxScale":4}
     - name: benefitKey | type: string | description: Key of the benefit that grants access to this item. Unique within the pool.  | read-only: true | validation: maxLength 64, immutable
     - name: itemSearchKey | type: string | description: Pre-computed search key for the catalog 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 item was removed.  [Query Pool Items](https://dev.wix.com/docs/api-reference/business-solutions/benefit-programs/pool-items/query-pool-items.md) doesn't return removed pool items, so this field is always `false` or absent in query results.  | read-only: true 
  - name: metadata | 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: 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 a member's access to a specific item
Retrieves the pool items that give a member access to a specific catalog item, with benefit and item details.

```curl
curl -X POST \
'https://www.wixapis.com/benefit-programs/v1/pool-items/query' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "query": {
    "filter": {
      "$and": [
        {
          "beneficiary.memberId": {
            "$eq": "d8f4a6c2-0e6a-4b89-bc3a-15e2dfe3c7a1"
          }
        },
        {
          "itemSearchKey": {
            "$eq": "a1c7e2f4-3b5d-4e8a-9c6f-2d4b8e1a7c35/classes/7f3e9b21-4c8a-4d6e-b5f2-9a1c3e7d8b40"
          }
        }
      ]
    },
    "cursorPaging": {
      "limit": 50
    }
  },
  "fields": ["BENEFIT", "ITEM"]
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.benefitPrograms.poolItems.queryPoolItems(query, options)
 Description: Retrieves a list of up to 1,000 pool items, given the provided paging, filtering, and sorting.  When called by a logged-in member, the response is automatically scoped to the calling member. App callers must include an explicit `beneficiary.memberId` filter to scope the response to a specific beneficiary.  Removed pool items aren't returned. Pool items are created and removed asynchronously as the underlying pools and items change, so recent changes may take a short time to appear in the results.  Query Pool 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: PoolItemQuery   | 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: QueryPoolItemsOptions  none  
        - name: fields | type: array<RequestedFields> | description: Additional details to include in each returned pool item, such as display names, benefit pricing, and the pool's credit balance.  Each value adds lookups to related entities, so request only the details you need.  | validation: maxItems 6
             - enum:
             -     POOL: Populates the `pool` field with the pool's display name, description, status, and credit configuration.
             -     PROGRAM: Populates the `program` field with the program's ID, display name, and external ID, if set.
             -     PROGRAM_DEFINITION: Populates the `programDefinition` field with the program definition's ID, display name, description, and external ID, if set.
             -     ITEM: Populates the `itemInfo` field with the catalog item's display name.
             -     BENEFIT: Populates the `benefitInfo` field with the benefit's key, credit price, display name, and description.
             -     BALANCE: Populates the `balance` field with the pool's available credit balance.
 Query fields:
   - field: _id | 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: externalId | 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: providerAppId | 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: poolId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | 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: poolDefinitionId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: programDefinitionId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: programId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: beneficiary.memberId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: externalProgramDefinitionId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: externalProgramId | 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<QueryPoolItemsResponse>
  - name: poolItems | type: array<PoolItem> | description: List of retrieved pool items.  
     - name: _id | type: string | description: Pool item GUID. Generated deterministically from `poolId` and `itemId`.  | read-only: true | validation: format GUID
     - name: revision | type: string | description: Revision number, which increments by 1 each time the pool item is updated.  | read-only: true | validation: format int64
     - name: _createdDate | type: Date | description: Date and time the pool item was created.  | read-only: true 
     - name: _updatedDate | type: Date | description: Date and time the pool 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 application that provides the benefit items. Each item's `externalId` is unique within its provider application.  | read-only: true | validation: format GUID, immutable
     - name: namespace | type: string | description: Namespace for your app or site's benefit programs. Namespaces let you distinguish between entities that you created and entities that other apps created.  | read-only: true | validation: minLength 1, maxLength 20, immutable
     - name: poolId | type: string | description: GUID of the pool that contains this item. A pool is the runtime container of benefits and items provisioned for a beneficiary.  | read-only: true | validation: format GUID, immutable
     - name: programId | type: string | description: GUID of the program that contains this pool item. The program is the runtime instance of a program definition for a specific beneficiary.  | read-only: true | validation: format GUID, immutable
     - name: externalProgramId | type: string | description: External program GUID assigned by the provider.  | read-only: true | validation: format GUID
     - name: programDefinitionId | type: string | description: GUID of the program definition that's the template for this pool item's program.  | read-only: true | validation: format GUID, immutable
     - name: externalProgramDefinitionId | type: string | description: External program definition GUID assigned by the provider.  | read-only: true | validation: format GUID, immutable
     - name: poolDefinitionId | type: string | description: GUID of the pool definition that's the template for this pool item's pool.  | read-only: true | validation: format GUID, immutable
     - name: itemSetId | type: string | description: GUID of the item set that groups the items of this pool item's benefit.  To identify a benefit, use `poolId` together with `benefitKey` instead of `itemSetId`.  | read-only: true | validation: format GUID, immutable
     - name: beneficiary | type: IdentificationData | description: Beneficiary of the pool. The member, contact, or visitor who can access this pool item.  | read-only: true | validation: immutable
        - ONE-OF: 
           - name: anonymousVisitorId | type: string | description: GUID of a site visitor that hasn't logged in to the site.  | validation: format GUID
           - name: memberId | type: string | description: GUID of a site member.  | validation: format GUID
           - name: wixUserId | type: string | description: GUID of a Wix user.  | validation: format GUID
     - name: pool | type: PoolInfo | description: Pool details, including display name and description.  Returned only when `POOL` is included in the `fields` request parameter.  | read-only: true 
        - name: displayName | type: string | description: Pool's display name. Often matches the name on the associated pool definition.  | validation: maxLength 64
        - name: description | type: string | description: Pool description.  | validation: maxLength 450
        - name: status | type: PoolStatus | description: Status of the pool that contains this item.  | read-only: true 
             - enum:
             -     ACTIVE: Pool is active.
             -     PAUSED: Pool is paused. It can be resumed.
             -     ENDED: Pool is ended. It can't be resumed.
             -     PROVISIONING: Pool provisioning is in progress. This status exists for a short time during processing.
             -     RENEWING: Pool renewing is in progress. This status exists for a short time during processing.
             -     PENDING: Pool is pending
        - name: creditConfiguration | type: CreditConfiguration | description: Credit configuration of the pool.  Returned only when the pool uses credit-based pricing.  | read-only: true 
           - name: amount | type: string | description: Number of credits allocated to the pool.  | 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, `point` or `token`.  | validation: maxLength 16
     - name: program | type: ProgramInfo | description: Program details, including the program's GUID, display name, and external GUID, if set.  Returned only when `PROGRAM` is included in the `fields` request parameter.  | read-only: true 
        - name: _id | type: string | description: Program GUID.  | validation: format GUID
        - name: externalId | type: string | description: External program GUID assigned by the provider.  | validation: format GUID
        - name: displayName | type: string | description: Program's display name.  | validation: maxLength 64
     - name: programDefinition | type: ProgramDefinitionInfo | description: Program definition details, including the program definition's GUID, display name, description, and external GUID, if set.  Returned only when `PROGRAM_DEFINITION` is included in the `fields` request parameter.  | read-only: true 
        - name: _id | type: string | description: Program definition GUID.  | validation: format GUID
        - name: externalId | type: string | description: External program definition GUID assigned by the provider.  | validation: format GUID
        - name: displayName | type: string | description: Program definition's display name.  | validation: maxLength 64
        - name: description | type: string | description: Program definition description.  | validation: maxLength 450
     - name: itemId | type: string | description: GUID of the catalog item that this pool item gives access to.  | read-only: true | validation: format GUID, immutable
     - name: itemInfo | type: ItemInfo | description: Display name for the catalog item.  Returned only when `ITEM` is included in the `fields` request parameter.  | read-only: true 
        - name: displayName | type: string | description: Item's display name.  | validation: maxLength 400
     - name: benefitInfo | type: BenefitInfo | description: Pricing and display information for the associated benefit, including credit price, name, and description.  Returned only when `BENEFIT` is included in the `fields` request parameter.  | read-only: true 
        - name: price | type: string | description: Cost of the benefit in credits. The cost is the same for all items in this benefit.  Credits are a configurable unit defined on the parent pool definition. The unit type is set in the pool definition's credit configuration. Absent when no credit-based pricing is configured for this benefit.  | validation: decimalValue {"gte":"0","maxScale":4}
        - name: benefitKey | type: string | description: Unique identifier for this benefit. Same value as `poolItem.benefitKey`.  | validation: maxLength 64
        - name: displayName | type: string | description: Benefit's display name.  | validation: maxLength 40
        - name: description | type: string | description: Benefit description.  | validation: maxLength 255
     - name: balance | type: BalanceInfo | description: Credit balance of the pool that contains this item.  Returned only when `BALANCE` is included in the `fields` request parameter.  | read-only: true 
        - name: available | type: string | description: Number of available credits in the pool.  Credits are a configurable unit defined on the parent pool definition.  | read-only: true | validation: decimalValue {"gte":"0","maxScale":4}
     - name: benefitKey | type: string | description: Key of the benefit that grants access to this item. Unique within the pool.  | read-only: true | validation: maxLength 64, immutable
     - name: itemSearchKey | type: string | description: Pre-computed search key for the catalog 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 item was removed.  [Query Pool Items](https://dev.wix.com/docs/api-reference/business-solutions/benefit-programs/pool-items/query-pool-items.md) doesn't return removed pool items, so this field is always `false` or absent in query results.  | read-only: true 
  - name: metadata | 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: 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 a member's access to a specific item
Retrieves the pool items that give a member access to a specific catalog item, with benefit and item details.

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

async function queryPoolItems() {
  const response = await poolItems.queryPoolItems(
    {
      filter: {
        "beneficiary.memberId": "d8f4a6c2-0e6a-4b89-bc3a-15e2dfe3c7a1",
        itemSearchKey: "a1c7e2f4-3b5d-4e8a-9c6f-2d4b8e1a7c35/classes/7f3e9b21-4c8a-4d6e-b5f2-9a1c3e7d8b40",
      },
      cursorPaging: { limit: 50 },
    },
    { fields: ["BENEFIT", "ITEM"] },
  );
}

/* Promise resolves to:
 * {
 *   "poolItems": [
 *     {
 *       "_id": "55012728-8027-4aeb-b2a8-bb06d9d32a53",
 *       "revision": "1",
 *       "_createdDate": "2026-09-02T11:00:45.524Z",
 *       "_updatedDate": "2026-09-02T11:00:45.524Z",
 *       "externalId": "7f3e9b21-4c8a-4d6e-b5f2-9a1c3e7d8b40",
 *       "category": "classes",
 *       "providerAppId": "a1c7e2f4-3b5d-4e8a-9c6f-2d4b8e1a7c35",
 *       "namespace": "fitness-app",
 *       "poolId": "e189a369-bb35-42c2-9a49-27c9a0a205d9",
 *       "programId": "8faed6d2-dfdf-44f1-8a71-bcc19d2fbdde",
 *       "externalProgramId": "b7d2e9f1-6a4c-4e3b-8f5d-1c9a7e2b4d60",
 *       "programDefinitionId": "e8c3366e-0c4f-3024-a034-1e0c79146d4c",
 *       "externalProgramDefinitionId": "c4a8f3e2-9b1d-4f6a-a7e5-3d2c8b9f1e07",
 *       "poolDefinitionId": "64244667-7c54-46da-8d8b-4a1a4ee9a598",
 *       "itemSetId": "3e5c0ffa-fdf9-4dd2-8841-70f30d873dd9",
 *       "beneficiary": {
 *         "memberId": "d8f4a6c2-0e6a-4b89-bc3a-15e2dfe3c7a1"
 *       },
 *       "itemId": "9a8b7c6d-5e4f-3210-fedc-ba9876543210",
 *       "itemInfo": {
 *         "displayName": "Morning Yoga"
 *       },
 *       "benefitInfo": {
 *         "price": "5",
 *         "benefitKey": "unlimited-classes",
 *         "displayName": "Group classes",
 *         "description": "Book any group class on the schedule."
 *       },
 *       "benefitKey": "unlimited-classes",
 *       "itemSearchKey": "a1c7e2f4-3b5d-4e8a-9c6f-2d4b8e1a7c35/classes/7f3e9b21-4c8a-4d6e-b5f2-9a1c3e7d8b40"
 *     }
 *   ],
 *   "metadata": {
 *     "count": 1,
 *     "hasNext": false
 *   }
 * }
 */

```

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

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


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

---