> 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 # BulkCheckBenefitEligibility # Package: benefitPrograms # Namespace: PoolService # Method link: https://dev.wix.com/docs/api-reference/business-solutions/benefit-programs/pools/bulk-check-benefit-eligibility.md ## Permission Scopes: Manage benefit programs: SCOPE.BENEFIT_PROGRAMS.MANAGE ## Introduction Checks if benefits can currently be redeemed. To be redeemed, a benefit's pool must be active and the associated balance must be greater than the cost of the benefit. Each benefit is checked independently. For example, if there is a benefit with a price of 3 credits and a benefit with a price of 4 credits, and there are 5 available credits, both benefits would be returned as eligible, but they can't both be redeemed. --- ## REST API ### Schema ``` Method: bulkCheckBenefitEligibility Description: Checks if benefits can currently be redeemed. To be redeemed, a benefit's pool must be active and the associated balance must be greater than the cost of the benefit. Each benefit is checked independently. For example, if there is a benefit with a price of 3 credits and a benefit with a price of 4 credits, and there are 5 available credits, both benefits would be returned as eligible, but they can't both be redeemed. URL: https://www.wixapis.com/benefit-programs/v1/bulk/benefits/check-eligibility Method: POST # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: benefitSelectors.poolId, benefitSelectors.itemReference, benefitSelectors.itemReference.externalId, benefitSelectors.itemReference.providerAppId, namespace Method parameters: param name: beneficiary | type: IdentificationData - ONE-OF: - name: anonymousVisitorId | type: string | description: GUID of a site visitor that hasn't logged in to the site. - name: memberId | type: string | description: GUID of a site member. - name: wixUserId | type: string | description: GUID of a Wix user. param name: benefitSelectors | type: array | description: List of benefits to check. - name: poolId | type: string | description: GUID of the pool that the benefit to check belongs to. | required: true - name: benefitKey | type: string | description: Key of the benefit to check. - name: itemReference | type: ItemReference | description: Information about the item to check. | required: true - name: externalId | type: string | description: External GUID of the item. | required: true - name: category | type: string | description: Item category. - name: providerAppId | type: string | description: GUID of the app providing the item. | required: true - name: count | type: integer | description: Amount of items to check. Ensures the balance is high enough to redeem this many items. - name: targetDate | type: string | description: Date that the item will be provided to the beneficiary. This parameter should be used to manage the potential logistics of providing the item. - name: additionalData | type: object | description: Additional information. param name: namespace | type: namespace | 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. | required: true Return type: BulkCheckBenefitEligibilityResponse - name: results | type: array | description: List of results checking each benefit. - name: benefitSelector | type: BenefitSelector | description: Benefit information specified in API call. - name: poolId | type: string | description: GUID of the pool that the benefit to check belongs to. - name: benefitKey | type: string | description: Key of the benefit to check. - name: itemReference | type: ItemReference | description: Information about the item to check. - name: externalId | type: string | description: External GUID of the item. - name: category | type: string | description: Item category. - name: providerAppId | type: string | description: GUID of the app providing the item. - name: count | type: integer | description: Amount of items to check. Ensures the balance is high enough to redeem this many items. - name: targetDate | type: string | description: Date that the item will be provided to the beneficiary. This parameter should be used to manage the potential logistics of providing the item. - name: additionalData | type: object | description: Additional information. - name: result | type: EligibilityCheckResult | description: Result of the eligibility check. - name: benefitResults | type: array | description: Eligibility status. - ONE-OF: - name: eligibleBenefitOptions | type: EligibleBenefit | description: Returned when item is eligible to be redeemed. - name: poolId | type: string | description: Pool GUID. - name: benefitKey | type: string | description: Benefit key. - name: itemReference | type: ItemReference | description: Item reference. - name: price | type: string | description: Price of the benefit in credits. - name: notEnoughBalanceOptions | type: NotEnoughBalance | description: Returned when the pool's associated balance is lower than the cost of redeeming the items. - name: poolId | type: string | description: Pool GUID. - name: itemReference | type: ItemReference | description: Item reference. - name: availableBalance | type: string | description: Pool's associated balance amount in credits. - name: requestedBalance | type: string | description: Price of the item in credits. - name: policyExpressionEvaluatedToFalseOptions | type: PolicyExpressionEvaluatedToFalse | description: Returned when the policy is false. - name: poolId | type: string | description: Pool GUID. - name: itemReference | type: ItemReference | description: Item reference. - name: failureDetails | type: array | description: Failure details. - name: code | type: string | description: Failure code - name: message | type: string | description: Failure message - name: policyId | type: string | description: Policy id - name: appId | type: string | description: App that owns the policy - name: errorData | type: object | description: Information provided by the policy - name: poolNotActiveOptions | type: PoolNotActive | description: Returned when the pool isn't active. - name: poolId | type: string | description: Pool GUID. - name: poolStatus | type: PoolStatus | description: Pool status. - 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: benefitNotFoundOptions | type: BenefitNotFound | description: Returned when invalid benefit details are provided. - name: poolId | type: string | description: Pool GUID. - name: benefitKey | type: string | description: Specified benefit key. - name: poolNotFoundOptions | type: PoolNotFound | description: Returned when invalid pool details are provided. - name: poolId | type: string | description: Pool GUID. - name: type | type: Type | description: Eligibility status. - enum: - ELIGIBLE_BENEFIT: Item is eligible to be redeemed. - NOT_ENOUGH_BALANCE: Balance is lower than the cost of redeeming the items. - POOL_NOT_ACTIVE: Pool isn't active. - BENEFIT_NOT_FOUND: Invalid benefit details provided. - POOL_NOT_FOUND: Invalid pool details provided. ``` ### Examples ### BulkCheckBenefitEligibility ```curl ~~~cURL curl --request POST https://www.wixapis.com/benefit-programs/v1/bulk/benefits/check-eligibility \ -H "Content-Type: application/json" \ -H "Authorization: " \ --data '{ "benefit_selectors": [ { "pool_id": "4a4de95d-867a-4089-98a8-83af77e38eca", "item_reference": { "external_id": "57273802-b873-495c-8eba-b8f054452e6c", "provider_app_id": "00000000-0000-0000-0000-000000000000" }, "count": 2 }, { "pool_id": "4a4de95d-867a-4089-98a8-83af77e38eca", "item_reference": { "external_id": "1fe298a0-2538-41e1-b13b-fb48fa5558e4", "provider_app_id": "00000000-0000-0000-0000-000000000000" }, "count": 1 } ], "namespace": "benefit_programs_app", "beneficiary": { "identity_type": "MEMBER", "member_id": "00000000-0000-0000-0000-000000000000" } }' ~~~ ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.benefitPrograms.PoolService.bulkCheckBenefitEligibility(options) Description: Checks if benefits can currently be redeemed. To be redeemed, a benefit's pool must be active and the associated balance must be greater than the cost of the benefit. Each benefit is checked independently. For example, if there is a benefit with a price of 3 credits and a benefit with a price of 4 credits, and there are 5 available credits, both benefits would be returned as eligible, but they can't both be redeemed. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: options.benefitSelectors.poolId, options.benefitSelectors.itemReference, options.benefitSelectors.itemReference.externalId, options.benefitSelectors.itemReference.providerAppId, options.namespace, options Method parameters: param name: options | type: BulkCheckBenefitEligibilityOptions none | required: true - name: benefitSelectors | type: array | description: List of benefits to check. - name: poolId | type: string | description: GUID of the pool that the benefit to check belongs to. - name: benefitKey | type: string | description: Key of the benefit to check. - name: itemReference | type: ItemReference | description: Information about the item to check. - name: externalId | type: string | description: External GUID of the item. - name: category | type: string | description: Item category. - name: providerAppId | type: string | description: GUID of the app providing the item. - name: count | type: integer | description: Amount of items to check. Ensures the balance is high enough to redeem this many items. - name: targetDate | type: Date | description: Date that the item will be provided to the beneficiary. This parameter should be used to manage the potential logistics of providing the item. - name: additionalData | type: object | description: Additional information. - 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. | required: true - name: beneficiary | type: IdentificationData | description: Pool beneficiary. - ONE-OF: - name: anonymousVisitorId | type: string | description: GUID of a site visitor that hasn't logged in to the site. - name: memberId | type: string | description: GUID of a site member. - name: wixUserId | type: string | description: GUID of a Wix user. Return type: PROMISE - name: results | type: array | description: List of results checking each benefit. - name: benefitSelector | type: BenefitSelector | description: Benefit information specified in API call. - name: poolId | type: string | description: GUID of the pool that the benefit to check belongs to. - name: benefitKey | type: string | description: Key of the benefit to check. - name: itemReference | type: ItemReference | description: Information about the item to check. - name: externalId | type: string | description: External GUID of the item. - name: category | type: string | description: Item category. - name: providerAppId | type: string | description: GUID of the app providing the item. - name: count | type: integer | description: Amount of items to check. Ensures the balance is high enough to redeem this many items. - name: targetDate | type: Date | description: Date that the item will be provided to the beneficiary. This parameter should be used to manage the potential logistics of providing the item. - name: additionalData | type: object | description: Additional information. - name: result | type: EligibilityCheckResult | description: Result of the eligibility check. - name: benefitResults | type: array | description: Eligibility status. - ONE-OF: - name: eligibleBenefitOptions | type: EligibleBenefit | description: Returned when item is eligible to be redeemed. - name: poolId | type: string | description: Pool GUID. - name: benefitKey | type: string | description: Benefit key. - name: itemReference | type: ItemReference | description: Item reference. - name: price | type: string | description: Price of the benefit in credits. - name: notEnoughBalanceOptions | type: NotEnoughBalance | description: Returned when the pool's associated balance is lower than the cost of redeeming the items. - name: poolId | type: string | description: Pool GUID. - name: itemReference | type: ItemReference | description: Item reference. - name: availableBalance | type: string | description: Pool's associated balance amount in credits. - name: requestedBalance | type: string | description: Price of the item in credits. - name: policyExpressionEvaluatedToFalseOptions | type: PolicyExpressionEvaluatedToFalse | description: Returned when the policy is false. - name: poolId | type: string | description: Pool GUID. - name: itemReference | type: ItemReference | description: Item reference. - name: failureDetails | type: array | description: Failure details. - name: code | type: string | description: Failure code - name: message | type: string | description: Failure message - name: policyId | type: string | description: Policy id - name: appId | type: string | description: App that owns the policy - name: errorData | type: object | description: Information provided by the policy - name: poolNotActiveOptions | type: PoolNotActive | description: Returned when the pool isn't active. - name: poolId | type: string | description: Pool GUID. - name: poolStatus | type: PoolStatus | description: Pool status. - 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: benefitNotFoundOptions | type: BenefitNotFound | description: Returned when invalid benefit details are provided. - name: poolId | type: string | description: Pool GUID. - name: benefitKey | type: string | description: Specified benefit key. - name: poolNotFoundOptions | type: PoolNotFound | description: Returned when invalid pool details are provided. - name: poolId | type: string | description: Pool GUID. - name: type | type: Type | description: Eligibility status. - enum: - ELIGIBLE_BENEFIT: Item is eligible to be redeemed. - NOT_ENOUGH_BALANCE: Balance is lower than the cost of redeeming the items. - POOL_NOT_ACTIVE: Pool isn't active. - BENEFIT_NOT_FOUND: Invalid benefit details provided. - POOL_NOT_FOUND: Invalid pool details provided. ``` ### Examples ### bulkCheckBenefitEligibility ```javascript import { pools } from '@wix/benefit-programs'; async function bulkCheckBenefitEligibility(options) { const response = await pools.bulkCheckBenefitEligibility(options); }; ``` ### bulkCheckBenefitEligibility (with elevated permissions) ```javascript import { pools } from '@wix/benefit-programs'; import { auth } from '@wix/essentials'; async function myBulkCheckBenefitEligibilityMethod(options) { const elevatedBulkCheckBenefitEligibility = auth.elevate(pools.bulkCheckBenefitEligibility); const response = await elevatedBulkCheckBenefitEligibility(options); } ``` ### bulkCheckBenefitEligibility (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 { pools } from '@wix/benefit-programs'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { pools }, // Include the auth strategy and host as relevant }); async function bulkCheckBenefitEligibility(options) { const response = await myWixClient.pools.bulkCheckBenefitEligibility(options); }; ``` ---