> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # RemoveItemsFromBenefit # Package: benefitPrograms # Namespace: PoolDefinitionItemService # Method link: https://dev.wix.com/docs/api-reference/business-solutions/benefit-programs/pool-definition-items/remove-items-from-benefit.md ## Permission Scopes: Manage benefit programs: SCOPE.BENEFIT_PROGRAMS.MANAGE ## Introduction Removes items from a benefit. The service removes items asynchronously. They may briefly still appear in Query Pool Definition Items results after the call returns. Item references not matching any registered item appear in results as per-item failures with `itemMetadata.error.code` set to `NOT_FOUND`. --- ## REST API ### Schema ``` Method: removeItemsFromBenefit Description: Removes items from a benefit. The service removes items asynchronously. They may briefly still appear in Query Pool Definition Items results after the call returns. Item references not matching any registered item appear in results as per-item failures with `itemMetadata.error.code` set to `NOT_FOUND`. URL: https://www.wixapis.com/benefit-programs/v1/pool-definition-items/remove-items-from-benefit Method: POST # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: itemReferences, itemReferences.externalId, poolDefinitionId, benefitKey Method parameters: param name: benefitKey | type: benefitKey | description: Key identifying the benefit in the pool definition. | required: true param name: itemReferences | type: array | description: Items to remove from the benefit's item set. | required: true - name: externalId | type: string | description: External item GUID assigned by the provider. | required: true - name: category | type: string | description: Item category. param name: poolDefinitionId | type: poolDefinitionId | description: GUID of the pool definition associated with the benefit. | required: true Return type: RemoveItemsFromBenefitResponse - name: results | type: array | description: Per-item results aligned 1:1 with `itemReferences` from the request. `itemMetadata.originalIndex` always refers to the position in the request. Item references that didn't match any registered item appear here as failures with `itemMetadata.error.code` set to `NOT_FOUND`. - name: itemMetadata | type: ItemMetadata | description: Outcome metadata for a single item, including the underlying item GUID, success flag, and error details on failure. - name: id | type: string | description: Item GUID. Should always be available, unless it's impossible (for example, when failing to create an item). - name: originalIndex | type: integer | description: Index of the item within the request array. Allows for correlation between request and response items. - name: success | type: boolean | description: Whether the requested action was successful for this item. When `false`, the `error` field is populated. - name: error | type: ApplicationError | description: Details about the error in case of failure. - name: code | type: string | description: Error code. - name: description | type: string | description: Description of the error. - name: data | type: object | description: Data related to the error. - name: bulkActionMetadata | type: BulkActionMetadata | description: Aggregate counts for the bulk operation, including successes and failures. The service counts unresolved item references as failures. - name: totalSuccesses | type: integer | description: Number of items that were successfully processed. - name: totalFailures | type: integer | description: Number of items that couldn't be processed. - name: undetailedFailures | type: integer | description: Number of failures without details because detailed failure threshold was exceeded. Possible Errors: HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: POOL_DEFINITION_BENEFIT_NOT_FOUND | Description: No benefit is configured for the given `poolDefinitionId` and `benefitKey` pair. ``` ### Examples ### RemoveItemsFromBenefit ```curl ~~~cURL curl -X POST "https://www.wixapis.com/benefit-programs/v1/pool-definition-items/remove-items-from-benefit" \ -H 'Content-type: application/json' \ -H 'Authorization: ' \ -d '{ "item_references": [ { "external_id": "00000000-6666-6666-0000-000000000001", "category": "class" } ], "pool_definition_id": "201db180-5043-45cf-a501-bd9c06df5ae5", "benefit_key": "unlimited-classes" }' ~~~ ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.benefitPrograms.PoolDefinitionItemService.removeItemsFromBenefit(itemReferences, options) Description: Removes items from a benefit. The service removes items asynchronously. They may briefly still appear in Query Pool Definition Items results after the call returns. Item references not matching any registered item appear in results as per-item failures with `itemMetadata.error.code` set to `NOT_FOUND`. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: itemReferences, itemReferences.externalId, options.poolDefinitionId, options.benefitKey, options Method parameters: param name: itemReferences | type: array | description: Items to remove from the benefit's item set. | required: true - name: externalId | type: string | description: External item GUID assigned by the provider. | required: true - name: category | type: string | description: Item category. param name: options | type: RemoveItemsFromBenefitOptions none | required: true - name: poolDefinitionId | type: string | description: GUID of the pool definition associated with the benefit. | required: true - name: benefitKey | type: string | description: Key identifying the benefit in the pool definition. | required: true Return type: PROMISE - name: results | type: array | description: Per-item results aligned 1:1 with `itemReferences` from the request. `itemMetadata.originalIndex` always refers to the position in the request. Item references that didn't match any registered item appear here as failures with `itemMetadata.error.code` set to `NOT_FOUND`. - name: itemMetadata | type: ItemMetadata | description: Outcome metadata for a single item, including the underlying item GUID, success flag, and error details on failure. - name: _id | type: string | description: Item GUID. Should always be available, unless it's impossible (for example, when failing to create an item). - name: originalIndex | type: integer | description: Index of the item within the request array. Allows for correlation between request and response items. - name: success | type: boolean | description: Whether the requested action was successful for this item. When `false`, the `error` field is populated. - name: error | type: ApplicationError | description: Details about the error in case of failure. - name: code | type: string | description: Error code. - name: description | type: string | description: Description of the error. - name: data | type: object | description: Data related to the error. - name: bulkActionMetadata | type: BulkActionMetadata | description: Aggregate counts for the bulk operation, including successes and failures. The service counts unresolved item references as failures. - name: totalSuccesses | type: integer | description: Number of items that were successfully processed. - name: totalFailures | type: integer | description: Number of items that couldn't be processed. - name: undetailedFailures | type: integer | description: Number of failures without details because detailed failure threshold was exceeded. Possible Errors: HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: POOL_DEFINITION_BENEFIT_NOT_FOUND | Description: No benefit is configured for the given `poolDefinitionId` and `benefitKey` pair. ``` ### Examples ### removeItemsFromBenefit ```javascript import { poolDefinitionItems } from '@wix/benefit-programs'; async function removeItemsFromBenefit(itemReferences,options) { const response = await poolDefinitionItems.removeItemsFromBenefit(itemReferences,options); }; ``` ### removeItemsFromBenefit (with elevated permissions) ```javascript import { poolDefinitionItems } from '@wix/benefit-programs'; import { auth } from '@wix/essentials'; async function myRemoveItemsFromBenefitMethod(itemReferences,options) { const elevatedRemoveItemsFromBenefit = auth.elevate(poolDefinitionItems.removeItemsFromBenefit); const response = await elevatedRemoveItemsFromBenefit(itemReferences,options); } ``` ### removeItemsFromBenefit (self-hosted) Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md). ```javascript import { createClient } from '@wix/sdk'; import { 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 removeItemsFromBenefit(itemReferences,options) { const response = await myWixClient.poolDefinitionItems.removeItemsFromBenefit(itemReferences,options); }; ``` ---