export interface Pool { /** * Pool ID. * @readonly */ id?: string | null; /** * Revision number, which increments by 1 each time the pool is updated. * To prevent conflicting changes, the current revision must be passed when updating the pool. * * Ignored when creating a pool. * @readonly */ revision?: string | null; /** * Date and time the pool was created. * @readonly */ createdDate?: Date | null; /** * Date and time the pool was updated. * @readonly */ updatedDate?: Date | null; /** * Pool definition from which this benefit pool was created. * @readonly */ poolDefinitionId?: string | null; /** * Program definition from which this benefit pool was provisioned. * @readonly */ programDefinitionId?: string | null; /** * ID of the program to which this benefit pool is associated. * @readonly */ programId?: string | null; /** * Benefit pool status. * @readonly */ status?: PoolStatus; /** Benefit pool owner. */ beneficiary?: CommonIdentificationData; /** * Benefit pool information. * * Includes the item, policy, and credit configurations. */ details?: Details; /** * Pool name. * * It's recommended to keep the same as the associated pool definition's `displayName`. */ displayName?: string; /** External system that is the source of the program creation. For example, `wix-pricing-plans`, `wix-loyalty`. */ namespace?: string | null; /** * Custom field data for the pool object. * [Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls. */ extendedFields?: ExtendedFields; /** * Program definition information. * @readonly */ programDefinition?: ProgramDefinitionInfo; /** * Program information. * @readonly */ program?: ProgramInfo; /** * Version of the associated pool definition at the this benefit pool was created. * * `poolDefinition.revision`. * @readonly */ poolDefinitionRevision?: string | null; /** * Number of times this benefit pool has been renewed. * @readonly */ renewalCount?: number | null; } export declare enum PoolStatus { UNDEFINED = "UNDEFINED", /** Active benefit pool. */ ACTIVE = "ACTIVE", /** Paused benefit pool. */ PAUSED = "PAUSED", /** * Inactive benefit pool. * * Benefits can't be redeemed or reserved. */ ENDED = "ENDED", /** Process state of activating the benefit pool's program. */ PROVISIONING = "PROVISIONING", /** * Process state of renewing the benefits. * Typically at the start of a new benefit renewal cycle. * Result of calling Renew Program API. */ RENEWING = "RENEWING" } export interface CommonIdentificationData extends CommonIdentificationDataIdOneOf { /** ID of a site visitor that has not logged in to the site. */ anonymousVisitorId?: string; /** ID of a site visitor that has logged in to the site. */ memberId?: string; /** ID of a Wix user (site owner, contributor, etc.). */ wixUserId?: string; } /** @oneof */ export interface CommonIdentificationDataIdOneOf { /** ID of a site visitor that has not logged in to the site. */ anonymousVisitorId?: string; /** ID of a site visitor that has logged in to the site. */ memberId?: string; /** ID of a Wix user (site owner, contributor, etc.). */ wixUserId?: string; } export declare enum IdentityType { /** Unknown type. This value is not used. */ UNKNOWN = "UNKNOWN", /** A site visitor who has not logged in. */ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR", /** A logged-in site member. */ MEMBER = "MEMBER", /** A Wix account holder, such as a site owner or contributor. */ WIX_USER = "WIX_USER" } export interface Details { /** Array of benefits, each containing price and policy settings specific to that benefit within the pool. */ benefits?: Benefit[]; /** * Settings that control the initial credits and renewal cycle configurations of the benefit pool. * * Default: Benefits may be redeemed without limit. */ creditConfiguration?: CreditConfiguration; /** * Defines the redemption policy for a benefit pool. This includes specifying the days of the week and the hours during which the benefits can be redeemed. * * Policy types may be either: * * + FIXED INTERVALS: Specifies the timing during the day. * * + RATE LIMITED: Specifies how many times the benefit can be redeemed within a given renewal cycle. * * Each selected policy type must have its corresponding policy options. For example, the `fixedInterval` type requires `fixedIntervalOptions` to be included in the parameters. * * This parameter is the default policy for all the benefits in the benefit pool. It may be overridden for specific benefits in the `details.benefits.policyExpression` parameter. */ policyExpression?: PolicyExpression; /** Additional info set by the benefit provider. */ additionalData?: Record | null; } export interface Benefit { /** * An unique identifier for a pool benefit. * * This key is consistent across the pool definition and all its associated benefit pools. */ benefitKey?: string; /** * Represents the associated benefit item that belongs to a benefit pool. * * This ID is returned when calling Create Item. * * It is used to link the specific benefit item to its corresponding location within the benefit pool, ensuring proper association between the item and the pool definition. * @readonly */ itemSetId?: string | null; /** * Price of the benefit item as expressed in credits. * Represents the cost to redeem the benefit. * * Don't set a price if the `details.creditConfiguration` is empty. Since the benefits have an unlimited redemption limit, they can't have an associated price. */ price?: string | null; /** * Defines the redemption policy for a specific benefit. This includes specifying the days of the week and the hours during which the benefits can be redeemed. * * Overrides the default policies in `benefit.details`. */ policyExpression?: PolicyExpression; /** Additional info that was set by the benefit provider. */ additionalData?: Record | null; /** ID of the app providing the benefit. */ providerAppId?: string | null; /** Benefit display name. */ displayName?: string | null; /** Benefit description. */ description?: string | null; } export interface PolicyExpression extends PolicyExpressionExpressionOneOf { /** Negates the expression. */ operatorNotOptions?: PolicyExpressionNot; /** Combines the expressions with an `AND` operator. */ operatorAndOptions?: PolicyExpressionAnd; /** Combines the expressions with an `OR` operator. */ operatorOrOptions?: PolicyExpressionOr; /** Defines policy terms for benefit redemption. */ policyOptions?: Policy; /** * Declare type of policy conditions or settings to use. Use together with the associated policy options to construct policy terms. * * Different operators can be used to combine multiple policy terms. */ type?: PolicyExpressionType; } /** @oneof */ export interface PolicyExpressionExpressionOneOf { /** Negates the expression. */ operatorNotOptions?: PolicyExpressionNot; /** Combines the expressions with an `AND` operator. */ operatorAndOptions?: PolicyExpressionAnd; /** Combines the expressions with an `OR` operator. */ operatorOrOptions?: PolicyExpressionOr; /** Defines policy terms for benefit redemption. */ policyOptions?: Policy; } export declare enum PolicyExpressionType { UNKNOWN = "UNKNOWN", /** Use with associated `operatorNotOptions`. */ OPERATOR_NOT = "OPERATOR_NOT", /** Use with associated `operatorAndOptions`. */ OPERATOR_AND = "OPERATOR_AND", /** Use with associated `operatorOrOptions`. */ OPERATOR_OR = "OPERATOR_OR", /** Use with associated `policyOptions` to define a policy. */ POLICY = "POLICY" } export interface PolicyExpressionNot { /** Specify policy terms where none of specified policy conditions should be met. Must specify an object with an `expressions` property. */ expression?: PolicyExpression; } export interface PolicyExpressionAnd { /** Specify policy terms where all policy conditions must be met. Must specify an object with an `expressions` property. */ expressions?: PolicyExpression[]; } export interface PolicyExpressionOr { /** Specify policy terms where at least one of the possible specified policy conditions is met. Must specify an object with an `expressions` property. */ expressions?: PolicyExpression[]; } export interface Policy extends PolicyPolicyOneOf { /** Defines the timing of benefit policy redemption for specific days or hours. */ fixedIntervalOptions?: FixedIntervalPolicy; /** Sets a limit on the number of times a benefit can be redeemed within a given renewal cycle. */ rateLimitedOptions?: RateLimitedPolicy; /** Custom policy definition that is controlled by the CustomPolicyProvider. */ customOptions?: CustomPolicy; /** Specific policy setting. Use together with its associated policy type options. For example, a fixed interval policy type should include a `fixedIntervalOptions` parameter. */ type?: Type; } /** @oneof */ export interface PolicyPolicyOneOf { /** Defines the timing of benefit policy redemption for specific days or hours. */ fixedIntervalOptions?: FixedIntervalPolicy; /** Sets a limit on the number of times a benefit can be redeemed within a given renewal cycle. */ rateLimitedOptions?: RateLimitedPolicy; /** Custom policy definition that is controlled by the CustomPolicyProvider. */ customOptions?: CustomPolicy; } export declare enum Type { /** Unknown policy type. */ UNKNOWN = "UNKNOWN", /** Fixed interval policy type. */ FIXED_INTERVAL = "FIXED_INTERVAL", /** Rate limited policy type. */ RATE_LIMITED = "RATE_LIMITED", CUSTOM = "CUSTOM" } export interface FixedIntervalPolicy { /** Weekday that this interval starts from. If this field is set, then `toWeekDay` must also be set. */ fromWeekDay?: WeekDay; /** Weekday that this interval ends at. If this field is set, then `fromWeekDay` must also be set. */ toWeekDay?: WeekDay; /** Hour that this interval starts from. If this field is set, then `toHour` must also be set. */ fromHour?: number | null; /** Hour that this interval ends at. If this field is set, then `fromHour` must also be set. */ toHour?: number | null; /** Minute that this interval starts from. If this field is set, then `toMinute` must also be set. */ fromMinute?: number | null; /** Minute that this interval ends at. If this field is set, then `fromMinute` must also be set. */ toMinute?: number | null; } export declare enum WeekDay { /** Unknown weekday. */ UNKNOWN = "UNKNOWN", /** Monday. */ MONDAY = "MONDAY", /** Tuesday. */ TUESDAY = "TUESDAY", /** Wednesday. */ WEDNESDAY = "WEDNESDAY", /** Thursday. */ THURSDAY = "THURSDAY", /** Friday. */ FRIDAY = "FRIDAY", /** Saturday. */ SATURDAY = "SATURDAY", /** Sunday. */ SUNDAY = "SUNDAY" } export interface RateLimitedPolicy extends RateLimitedPolicyPeriodOneOf { /** * Defines the timing of benefit policy redemption for specific days or hours. * * Used to set the timing policy for a maximum limit of redemptions. */ fixedIntervalOptions?: FixedIntervalPolicy; /** Maximum number of times benefit can be redeemed per renewal cycle. */ times?: number; /** Specific method of setting the benefit limit. `FIXED_INTERVAL` type must be used with its corresponding `fixIntervalPolicyOptions` parameter. */ type?: RateLimitedPolicyType; } /** @oneof */ export interface RateLimitedPolicyPeriodOneOf { /** * Defines the timing of benefit policy redemption for specific days or hours. * * Used to set the timing policy for a maximum limit of redemptions. */ fixedIntervalOptions?: FixedIntervalPolicy; } export declare enum RateLimitedPolicyType { /** Unknown rate limit method. */ UNKNOWN = "UNKNOWN", /** Fixed interval rate limit. The intervals are set using `fixIntervalPolicyOptions`. */ FIXED_INTERVAL = "FIXED_INTERVAL", /** Rate limit is set with `times` field above. */ PER_CYCLE = "PER_CYCLE" } /** Custom policy as implemented by the Entitlement Policy Provider */ export interface CustomPolicy { /** References a specific custom policy on the provider's system */ id?: string; /** Custom policy provider id */ appId?: string | null; /** Additional info for this custom policy. It's going to be passed to the policy provider during eligibility checks */ additionalData?: Record | null; } export interface CreditConfiguration { /** The initial total amount of credits available in this benefit pool. */ amount?: string; /** Rollover configuration. */ rolloverConfiguration?: RolloverConfiguration; /** Display name of the unit. */ unitDisplayName?: string | null; } export interface RolloverConfiguration { /** Determine whether unused credits are rolled over to the new cycle. */ enabled?: boolean | null; /** * The maximum amount of credits that can be transferred to the next benefit renewal cycle. * * If current balance exceeds this cap, no credits will transfer into the next renewal cycle until the balance is within the allowable limit. */ balanceCap?: string | null; } export interface ExtendedFields { /** * Extended field data. Each key corresponds to the namespace of the app that created the extended fields. * The value of each key is structured according to the schema defined when the extended fields were configured. * * You can only access fields for which you have the appropriate permissions. * * Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields). */ namespaces?: Record>; } export interface ProgramDefinitionInfo { /** * ID of the program definition that provisioned the program associated with this benefit pool. * @readonly */ id?: string; /** * External ID of the program definition that provisioned this program. * * This identifies the source program definition in the external system. * @readonly */ externalId?: string | null; } export interface ProgramInfo { /** * ID of the program associated with this benefit pool. * @readonly */ id?: string; /** * External ID of the program associated with this benefit pool. * * This identifies the source program in the external system. * @readonly */ externalId?: string | null; } export declare enum PoolOrigin { /** Unknown pool origin. */ UNKNOWN = "UNKNOWN", /** Benefit pool created by a program provision. */ PROVISION = "PROVISION", /** Benefit pool was created when pool definition was added to program definition. */ CASCADE = "CASCADE" } export interface PoolProvisioned { /** Pool which has been provisioned */ pool?: Pool; } export interface PoolRenewed { /** Pool which has been granted */ pool?: Pool; } export interface BenefitRedeemed { /** Pool which has been redeemed */ pool?: Pool; /** Details of the redemption */ redemptionDetails?: RedemptionDetails; } export interface RedemptionDetails { /** Id of the redemption transaction */ transactionId?: string; /** Reference of the item that is being redeemed */ itemReference?: ItemReference; /** Number of of items to redeem */ itemCount?: number; /** * Date at which the item will be used. Target date does not necessarily equal the redemption date. Credits are redeemed immediately. * This date is only used for validations that may be performed by entitlement providers */ targetDate?: Date | null; /** Idempotency key */ idempotencyKey?: string; /** Additional info provided during redemption */ additionalData?: Record | null; /** Beneficiary of the entitlement */ beneficiary?: CommonIdentificationData; } export interface ItemReference { /** External ID of the item. */ externalId?: string; /** Item category. */ category?: string; /** ID of the application providing the benefits. */ providerAppId?: string; } export interface PoolPaused { /** Pool which has been paused */ pool?: Pool; } export interface PoolResumed { /** Pool which has been resumed */ pool?: Pool; } export interface PoolEnded { /** Pool which has been ended */ pool?: Pool; } export interface BenefitReserved { /** Pool which was used to perform this transaction */ pool?: Pool; /** Details of the redemption */ redemptionDetails?: RedemptionDetails; } export interface BenefitReservationCanceled { /** Pool which was used to perform this transaction */ pool?: Pool; /** Id of the canceled reservation transaction */ transactionId?: string; } export interface BenefitReservationReleased { /** Pool which was used to perform this transaction */ pool?: Pool; /** Id of the released reservation transaction */ transactionId?: string; } export interface CreatePoolRequest { /** Pool to be created. */ pool?: Pool; } export interface CreatePoolResponse { /** Created pool. */ pool?: Pool; } export interface GetPoolRequest { /** ID of the pool to retrieve. */ poolId: string; } export interface GetPoolResponse { /** Retrieved pool. */ pool?: Pool; } export interface UpdatePoolRequest { /** Pool to be updated. */ pool: Pool; } export interface UpdatePoolResponse { /** Updated pool. */ pool?: Pool; } export interface DeletePoolRequest { /** ID of the pool to delete. */ poolId?: string; } export interface DeletePoolResponse { } export interface QueryPoolsRequest { /** Query to select pools. */ query: CursorQuery; } export interface CursorQuery extends CursorQueryPagingMethodOneOf { /** 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`. */ cursorPaging?: CursorPaging; /** * 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` */ filter?: Record | null; /** * Sort object in the following format: * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]` */ sort?: Sorting[]; } /** @oneof */ export interface CursorQueryPagingMethodOneOf { /** 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`. */ cursorPaging?: CursorPaging; } export interface Sorting { /** Name of the field to sort by. */ fieldName?: string; /** Sort order. */ order?: SortOrder; } export declare enum SortOrder { /** Ascending sort order. */ ASC = "ASC", /** Descending sort order. */ DESC = "DESC" } export interface CursorPaging { /** Maximum number of items to return in the results. */ limit?: number | null; /** * 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. */ cursor?: string | null; } export interface QueryPoolsResponse { /** List of pools. */ pools?: Pool[]; /** Metadata for the paginated results. */ metadata?: CursorPagingMetadata; } export interface CursorPagingMetadata { /** Number of items returned in the response. */ count?: number | null; /** Cursor strings that point to the next page, previous page, or both. */ cursors?: Cursors; /** * 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. */ hasNext?: boolean | null; } export interface Cursors { /** Cursor string pointing to the next page in the list of results. */ next?: string | null; /** Cursor pointing to the previous page in the list of results. */ prev?: string | null; } export interface RedeemBenefitRequest { /** ID of the benefit pool being redeemed. */ poolId: string; /** Reference of the benefit item that is being redeemed. */ itemReference: ItemReference; /** * Key of the specific benefit to be redeemed. * * This needs to be specified to ensure the correct benefit is redeemed. */ benefitKey: string; /** Number of of items to redeem. */ count?: number; /** * Date when the benefit item will be used. * * While credit balance is adjusted immediately upon the redemption request, the target date may be set for a later time than the date of the request. * * Used for the app providing the benefit items to manage the logistics associated with the item. */ targetDate?: Date | null; /** * Unique identifier, generated by the client. * Used to recognize repeated attempts to make the same request. */ idempotencyKey: string; /** Additional information. */ additionalData?: Record | null; /** Benefit pool owner. */ beneficiary?: CommonIdentificationData; /** * Module that is the source of the benefit pool creation. * * Must match the previously defined namespace in the associated pool definition. */ namespace: string; } export interface RedeemBenefitResponse { /** Id of the resulting transaction. */ transactionId?: string; } export interface NotEnoughBalance { /** Pool ID */ poolId?: string; /** Item reference */ itemReference?: ItemReference; /** Price of the item expressed in credits */ availableBalance?: string; /** Price of the item expressed in credits */ requestedBalance?: string; } export interface PolicyExpressionEvaluatedToFalse { /** Pool ID */ poolId?: string; /** Item reference */ itemReference?: ItemReference; /** Failure details */ failureDetails?: FailureDetails[]; } export interface FailureDetails { /** Failure code */ code?: string; /** Failure message */ message?: string | null; /** Policy id */ policyId?: string | null; /** App that owns the policy */ appId?: string | null; /** Information provided by the policy */ errorData?: Record | null; } export interface PoolNotActive { /** Pool ID */ poolId?: string; /** Pool status */ poolStatus?: PoolStatus; } export interface PoolNotFound { /** Pool ID */ poolId?: string; } export interface BenefitAlreadyRedeemed { /** Pool ID */ poolId?: string; /** Idempotency key of the request that failed */ idempotencyKey?: string; } export interface BenefitNotFound { /** Pool ID */ poolId?: string; /** Key of the referenced benefit, if provided */ benefitKey?: string | null; } export interface ReserveBenefitRequest { /** Id of the pool that is being redeemed from */ poolId?: string; /** Reference of the item that is being redeemed. */ itemReference?: ItemReference; /** * Key of the benefit to be redeemed, associated with a particular benefit. * * This key must be specified to ensure the correct benefit is redeemed. * * Default: The first eligible benefit in the benefit pool will be redeemed. */ benefitKey?: string | null; /** Number of items to redeem. */ count?: number; /** * Date when the benefit item will be used. * * While the credit balance is adjusted immediately upon the redemption request, the target date may be set for a later time than the date of the request. * * Used for the app providing the benefit items to manage the logistics associated with the item. */ targetDate?: Date | null; /** Idempotency key */ idempotencyKey?: string; /** Additional info */ additionalData?: Record | null; /** Benefit pool owner. */ beneficiary?: CommonIdentificationData; /** * Module that is the source of the benefit pool creation. * * This value must correspond with the previously defined namespace established when creating the associated pool definition. * * It ensures efficient processing and management of pools and benefits. */ namespace?: string; } export interface ReserveBenefitResponse { /** Id of the transaction that was created as a result of this request */ transactionId?: string; } export interface CancelBenefitReservationRequest { /** Id of the transaction that was created as a result of this request */ transactionId?: string; } export interface CancelBenefitReservationResponse { /** Id of the transaction that was created as a result of this request */ transactionId?: string; } export interface ReleaseBenefitReservationRequest { /** Id of the transaction that was created as a result of this request */ transactionId?: string; } export interface ReleaseBenefitReservationResponse { /** Id of the transaction that was created as a result of this request */ transactionId?: string; } export interface CheckBenefitEligibilityRequest { /** ID of the benefit pool to check eligibility against. */ poolId: string; /** * Key of the benefit to be redeemed, associated with a particular benefit. * * This key must be specified to ensure the correct benefit is redeemed. * * Default: The first eligible benefit in the benefit pool will be redeemed. */ benefitKey?: string | null; /** Reference of the item for which to check benefit's eligibility. */ itemReference: ItemReference; /** * Number of items for which to check eligibility. * * This number will be evaluated against the policies and credit balance of the benefit pool to determine if sufficient funds are met for the specified number of items. */ count?: number; /** * Date when the benefit item will be used. * * While credit balance is adjusted immediately upon the redemption request, the target date may be set for a later time than the date of the request. * * Used for the app providing the benefit items to manage the logistics associated with the item. */ targetDate?: Date | null; /** Additional info */ additionalData?: Record | null; /** Benefit pool owner. */ beneficiary?: CommonIdentificationData; /** * Module that is the source of the benefit pool creation. * * This value must correspond with the previously defined namespace established when creating the associated pool definition. * * It ensures efficient processing and management of pools and benefits. */ namespace: string; } export interface CheckBenefitEligibilityResponse { /** * Result of the eligibility check. Includes the benefit's eligibility. * * If the benefit is not eligible for redemption, provides a reason for ineligiblity. */ result?: EligibilityCheckResult; } export interface EligibilityCheckResult extends EligibilityCheckResultResultOneOf { /** Set when eligibility check passed. */ eligibleOptions?: Eligible; /** Set when balance is insufficient. */ notEnoughBalanceOptions?: NotEnoughBalance; /** Set when policy expression evaluates to false. */ policyExpressionEvaluatedToFalseOptions?: PolicyExpressionEvaluatedToFalse; /** Set when pool is inactive. */ poolNotActiveOptions?: PoolNotActive; /** Set when benefit can't be found. */ benefitNotFoundOptions?: BenefitNotFound; /** Set when pool can't be found. */ poolNotFoundOptions?: PoolNotFound; /** Eligibility status. */ type?: EligibilityCheckResultType; } /** @oneof */ export interface EligibilityCheckResultResultOneOf { /** Set when eligibility check passed. */ eligibleOptions?: Eligible; /** Set when balance is insufficient. */ notEnoughBalanceOptions?: NotEnoughBalance; /** Set when policy expression evaluates to false. */ policyExpressionEvaluatedToFalseOptions?: PolicyExpressionEvaluatedToFalse; /** Set when pool is inactive. */ poolNotActiveOptions?: PoolNotActive; /** Set when benefit can't be found. */ benefitNotFoundOptions?: BenefitNotFound; /** Set when pool can't be found. */ poolNotFoundOptions?: PoolNotFound; } export interface EligibleBenefit { /** * Pool ID * @readonly */ poolId?: string; /** Key of the specific benefit. */ benefitKey?: string; /** Item reference */ itemReference?: ItemReference; /** Price of the item expressed in credits */ price?: string | null; } export declare enum EligibilityCheckResultType { /** Unknown pool eligibility. */ UNKNOWN = "UNKNOWN", /** Eligible pool. */ ELIGIBLE = "ELIGIBLE", /** Insufficient pool balance. */ NOT_ENOUGH_BALANCE = "NOT_ENOUGH_BALANCE", /** Policy is false. */ POLICY_EXPRESSION_EVALUATED_TO_FALSE = "POLICY_EXPRESSION_EVALUATED_TO_FALSE", /** Inactive pool. */ POOL_NOT_ACTIVE = "POOL_NOT_ACTIVE", /** Invalid benefit. */ BENEFIT_NOT_FOUND = "BENEFIT_NOT_FOUND", /** Invalid pool. */ POOL_NOT_FOUND = "POOL_NOT_FOUND" } export interface Eligible { /** Eligible benefits. */ eligibleBenefits?: EligibleBenefit[]; } export interface BulkCheckBenefitEligibilityRequest { /** Benefits to check eligibility. */ benefitSelectors?: BenefitSelector[]; /** * Module that is the source of the benefit pool creation. * * This value must correspond with the previously defined namespace established when creating the associated pool definition. * * It ensures efficient processing and management of pools and benefits. */ namespace: string; /** Benefit pool owner. */ beneficiary?: CommonIdentificationData; } export interface BenefitSelector { /** ID of the pool to check for eligibility. */ poolId?: string; /** ID of the benefit to check for eligibility. */ benefitKey?: string | null; /** Reference of the item for which to check benefit's eligibility. */ itemReference?: ItemReference; /** * Number of items for which to check eligibility. * * This number will be evaluated against the policies and credit balance of the benefit pool to determine if sufficient funds are met for the specified number of items. */ count?: number; /** * Date when the benefit item will be used. * * While credit balance is adjusted immediately upon the redemption request, the target date may be set for a later time than the date of the request. * * Used for the app providing the benefit items to manage the logistics associated with the item. */ targetDate?: Date | null; /** Additional info */ additionalData?: Record | null; } export interface BulkCheckBenefitEligibilityResponse { /** List of results for pool benefit eligibility. */ results?: BulkEligibilityCheckResult[]; } export interface BulkEligibilityCheckResult { /** Retrieved information for each benefit pool. */ benefitSelector?: BenefitSelector; /** Outcome of the eligibility check. */ result?: EligibilityCheckResult; } export interface GetEligibleBenefitsRequest { /** Reference of the item for which all eligible pools will be returned. */ itemReference: ItemReference; /** * Number of items for which to check eligibility. * * This number will be evaluated against the policies and credit balance of the benefit pool to determine if sufficient funds are met for the specified number of items. */ count?: number; /** * Date when the benefit item will be used. * * While credit balance is adjusted immediately upon the redemption request, the target date may be set for a later time than the date of the request. * * Used for the app providing the benefit items to manage the logistics associated with the item. */ targetDate?: Date | null; /** Additional information. */ additionalData?: Record | null; /** Benefit pool owner. */ beneficiary?: CommonIdentificationData; /** * Module that is the source of the benefit pool creation. * * This value must correspond with the previously defined namespace established when creating the associated pool definition. * * It ensures efficient processing and management of pools and benefits. */ namespace: string; } export interface GetEligibleBenefitsResponse { /** Retrieved eligible benefits. */ eligibleBenefits?: EligibleBenefit[]; } export interface ListPoolsRequest { /** The filter */ filter?: Filter; /** Cursor paging */ cursorPaging?: CursorPaging; } export declare enum ListPoolsRequestType { UNKNOWN_FILTER = "UNKNOWN_FILTER", BY_ITEM_REFERENCE = "BY_ITEM_REFERENCE" } export interface ByItemReference { /** A list of filters */ filters?: ByItemReferenceFilter[]; /** Beneficiary of the pool */ beneficiary?: CommonIdentificationData; /** Returns pools that are in the following statuses */ poolStatuses?: PoolStatus[]; } export interface ByItemReferenceFilter { /** Reference of the item */ itemReference?: ItemReference; } export interface Filter extends FilterFilterOneOf { /** A list of filters by reference */ byItemReferenceOptions?: ByItemReference; /** Type of the filter */ type?: ListPoolsRequestType; /** * Module that is the source of the benefit pool creation. * * This value must correspond with the previously defined namespace established when creating the associated pool definition. * * It ensures efficient processing and management of pools and benefits. */ namespace?: string; } /** @oneof */ export interface FilterFilterOneOf { /** A list of filters by reference */ byItemReferenceOptions?: ByItemReference; } export interface ListPoolsResponse { /** The retrieved pools */ pools?: PoolWithItems[]; /** Paging information */ metadata?: CursorPagingMetadata; } export interface PoolWithItems { /** The pool */ pool?: Pool; /** The items in the pool */ itemReference?: ItemReference[]; } export interface BulkUpdatePoolsRequest { /** Pools to update. */ pools?: MaskedPool[]; /** * Whether to return the full pool definition entities. * * Default: `false` */ returnEntity?: boolean; } export interface MaskedPool { /** Pool to update. */ pool?: Pool; /** Explicit list of fields to update. */ fieldMask?: string[]; } export interface BulkUpdatePoolsResponse { /** * List of results for each pool. * * Includes the pool, pool metadata, and whether the update was successful. */ results?: BulkPoolResult[]; /** Bulk action metadata. */ bulkActionMetadata?: BulkActionMetadata; } export interface BulkPoolResult { /** Pool metadata. */ poolMetadata?: ItemMetadata; /** Only exists if `returnEntity` was set to true in the request */ pool?: Pool; } export interface ItemMetadata { /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */ id?: string | null; /** Index of the item within the request array. Allows for correlation between request and response items. */ originalIndex?: number; /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */ success?: boolean; /** Details about the error in case of failure. */ error?: ApplicationError; } export interface ApplicationError { /** Error code. */ code?: string; /** Description of the error. */ description?: string; /** Data related to the error. */ data?: Record | null; } export interface BulkActionMetadata { /** Number of items that were successfully processed. */ totalSuccesses?: number; /** Number of items that couldn't be processed. */ totalFailures?: number; /** Number of failures without details because detailed failure threshold was exceeded. */ undetailedFailures?: number; } export interface ProvisionPoolsForProgramRequest { /** Reference of the template that is used to provision the pools */ poolDefinitionLookupId?: PoolDefinitionLookupId; /** Program that the provisioned pools are part of */ programId?: string; } export interface PoolDefinitionLookupId extends PoolDefinitionLookupIdIdOneOf { /** Pool definition ID. */ poolDefinitionId?: string; /** Program definition ID. */ programDefinitionId?: string; } /** @oneof */ export interface PoolDefinitionLookupIdIdOneOf { /** Pool definition ID. */ poolDefinitionId?: string; /** Program definition ID. */ programDefinitionId?: string; } export interface ProvisionPoolsForProgramResponse extends ProvisionPoolsForProgramResponseResultOneOf { /** Sync result */ syncOptions?: SyncResult; /** Async result */ asyncOptions?: AsyncResult; /** Job ID of the program provision associated with this pool. */ jobId?: string; /** Type of the result */ type?: ProvisionPoolsForProgramResponseType; } /** @oneof */ export interface ProvisionPoolsForProgramResponseResultOneOf { /** Sync result */ syncOptions?: SyncResult; /** Async result */ asyncOptions?: AsyncResult; } export declare enum ProvisionPoolsForProgramResponseType { /** Unknown result type */ UNKNOWN = "UNKNOWN", /** Sync result */ SYNC = "SYNC", /** Async result */ ASYNC = "ASYNC" } export interface SyncResult { /** Indicates if the operation was successful */ success?: boolean; } export interface AsyncResult { /** Job ID of the program provision associated with this pool. */ jobId?: string; } export interface InvalidPoolDefinitionReference { /** Reference of the template that didn't find any pool definitions */ poolDefinitionLookupId?: PoolDefinitionLookupId; } export interface RenewPoolsForProgramRequest { /** Package of pools to grant. Package id should be the same that was used to provision programs. */ programId?: string; } export interface RenewPoolsForProgramResponse { /** Job id of the renewal job */ jobId?: string; } export interface UpdatePoolStatusRequest extends UpdatePoolStatusRequestPoolSelectorOneOf { /** Pool selector by pool definition id and program definition id */ byPoolDefinitionIdAndProgramDefinitionIdOptions?: ByPoolDefinitionIdAndProgramDefinitionIdOptions; /** Pool selector by program id */ byProgramIdOptions?: ByProgramIdOptions; /** New pool status */ status?: PoolStatus; /** Pool selector type */ poolSelectorType?: PoolSelectorType; } /** @oneof */ export interface UpdatePoolStatusRequestPoolSelectorOneOf { /** Pool selector by pool definition id and program definition id */ byPoolDefinitionIdAndProgramDefinitionIdOptions?: ByPoolDefinitionIdAndProgramDefinitionIdOptions; /** Pool selector by program id */ byProgramIdOptions?: ByProgramIdOptions; } export declare enum PoolSelectorType { UNKNOWN_SELECTOR = "UNKNOWN_SELECTOR", BY_POOL_DEFINITION_ID_AND_PROGRAM_DEFINITION_ID = "BY_POOL_DEFINITION_ID_AND_PROGRAM_DEFINITION_ID", BY_PROGRAM_ID = "BY_PROGRAM_ID" } export interface ByPoolDefinitionIdAndProgramDefinitionIdOptions { /** Pool definition id */ poolDefinitionId?: string; /** Program definition id */ programDefinitionId?: string | null; } export interface ByProgramIdOptions { /** Program id */ programId?: string; /** Additional data that gets added to the event once the async job completes */ additionalData?: Record | null; } export interface UpdatePoolStatusResponse { /** Job ID of the program provision associated with this pool. */ jobId?: string; } export interface CountNumberOfPoolsInProvisioningStatusRequest { /** Program id */ programId?: string; } export interface CountNumberOfPoolsInProvisioningStatusResponse { /** Number of pools in provisioning status */ count?: number; } export interface DomainEvent extends DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; /** * Unique event ID. * Allows clients to ignore duplicate webhooks. */ id?: string; /** * Assumes actions are also always typed to an entity_type * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction */ entityFqdn?: string; /** * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug) * This is although the created/updated/deleted notion is duplication of the oneof types * Example: created/updated/deleted/started/completed/email_opened */ slug?: string; /** ID of the entity associated with the event. */ entityId?: string; /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */ eventTime?: Date | null; /** * Whether the event was triggered as a result of a privacy regulation application * (for example, GDPR). */ triggeredByAnonymizeRequest?: boolean | null; /** If present, indicates the action that triggered the event. */ originatedFrom?: string | null; /** * A sequence number defining the order of updates to the underlying entity. * For example, given that some entity was updated at 16:00 and than again at 16:01, * it is guaranteed that the sequence number of the second update is strictly higher than the first. * As the consumer, you can use this value to ensure that you handle messages in the correct order. * To do so, you will need to persist this number on your end, and compare the sequence number from the * message against the one you have stored. Given that the stored number is higher, you should ignore the message. */ entityEventSequence?: string | null; } /** @oneof */ export interface DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; } export interface EntityCreatedEvent { entityAsJson?: string; /** Indicates the event was triggered by a restore-from-trashbin operation for a previously deleted entity */ restoreInfo?: RestoreInfo; } export interface RestoreInfo { deletedDate?: Date | null; } export interface EntityUpdatedEvent { /** * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff. * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects. * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it. */ currentEntityAsJson?: string; } export interface EntityDeletedEvent { /** Entity that was deleted */ deletedEntityAsJson?: string | null; } export interface ActionEvent { bodyAsJson?: string; } export interface MessageEnvelope { /** App instance ID. */ instanceId?: string | null; /** Event type. */ eventType?: string; /** The identification type and identity data. */ identity?: IdentificationData; /** Stringify payload. */ data?: string; } export interface IdentificationData extends IdentificationDataIdOneOf { /** ID of a site visitor that has not logged in to the site. */ anonymousVisitorId?: string; /** ID of a site visitor that has logged in to the site. */ memberId?: string; /** ID of a Wix user (site owner, contributor, etc.). */ wixUserId?: string; /** ID of an app. */ appId?: string; /** @readonly */ identityType?: WebhookIdentityType; } /** @oneof */ export interface IdentificationDataIdOneOf { /** ID of a site visitor that has not logged in to the site. */ anonymousVisitorId?: string; /** ID of a site visitor that has logged in to the site. */ memberId?: string; /** ID of a Wix user (site owner, contributor, etc.). */ wixUserId?: string; /** ID of an app. */ appId?: string; } export declare enum WebhookIdentityType { UNKNOWN = "UNKNOWN", ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR", MEMBER = "MEMBER", WIX_USER = "WIX_USER", APP = "APP" } interface CommonIdentificationDataNonNullableFields { anonymousVisitorId: string; memberId: string; wixUserId: string; identityType: IdentityType; } interface PolicyExpressionNotNonNullableFields { expression?: PolicyExpressionNonNullableFields; } interface PolicyExpressionAndNonNullableFields { expressions: PolicyExpressionNonNullableFields[]; } interface PolicyExpressionOrNonNullableFields { expressions: PolicyExpressionNonNullableFields[]; } interface FixedIntervalPolicyNonNullableFields { fromWeekDay: WeekDay; toWeekDay: WeekDay; } interface RateLimitedPolicyNonNullableFields { fixedIntervalOptions?: FixedIntervalPolicyNonNullableFields; times: number; type: RateLimitedPolicyType; } interface CustomPolicyNonNullableFields { id: string; } interface PolicyNonNullableFields { fixedIntervalOptions?: FixedIntervalPolicyNonNullableFields; rateLimitedOptions?: RateLimitedPolicyNonNullableFields; customOptions?: CustomPolicyNonNullableFields; type: Type; } interface PolicyExpressionNonNullableFields { operatorNotOptions?: PolicyExpressionNotNonNullableFields; operatorAndOptions?: PolicyExpressionAndNonNullableFields; operatorOrOptions?: PolicyExpressionOrNonNullableFields; policyOptions?: PolicyNonNullableFields; type: PolicyExpressionType; } interface BenefitNonNullableFields { benefitKey: string; policyExpression?: PolicyExpressionNonNullableFields; } interface CreditConfigurationNonNullableFields { amount: string; } interface DetailsNonNullableFields { benefits: BenefitNonNullableFields[]; creditConfiguration?: CreditConfigurationNonNullableFields; policyExpression?: PolicyExpressionNonNullableFields; } interface ProgramDefinitionInfoNonNullableFields { id: string; } interface ProgramInfoNonNullableFields { id: string; } interface PoolNonNullableFields { status: PoolStatus; beneficiary?: CommonIdentificationDataNonNullableFields; details?: DetailsNonNullableFields; displayName: string; programDefinition?: ProgramDefinitionInfoNonNullableFields; program?: ProgramInfoNonNullableFields; previousStatus: PoolStatus; origin: PoolOrigin; } export interface GetPoolResponseNonNullableFields { pool?: PoolNonNullableFields; } export interface UpdatePoolResponseNonNullableFields { pool?: PoolNonNullableFields; } export interface QueryPoolsResponseNonNullableFields { pools: PoolNonNullableFields[]; } export interface RedeemBenefitResponseNonNullableFields { transactionId: string; } interface ItemReferenceNonNullableFields { externalId: string; category: string; providerAppId: string; } interface EligibleBenefitNonNullableFields { poolId: string; benefitKey: string; itemReference?: ItemReferenceNonNullableFields; } interface EligibleNonNullableFields { eligibleBenefits: EligibleBenefitNonNullableFields[]; } interface NotEnoughBalanceNonNullableFields { poolId: string; itemReference?: ItemReferenceNonNullableFields; availableBalance: string; requestedBalance: string; } interface FailureDetailsNonNullableFields { code: string; } interface PolicyExpressionEvaluatedToFalseNonNullableFields { poolId: string; itemReference?: ItemReferenceNonNullableFields; failureDetails: FailureDetailsNonNullableFields[]; } interface PoolNotActiveNonNullableFields { poolId: string; poolStatus: PoolStatus; } interface BenefitNotFoundNonNullableFields { poolId: string; } interface PoolNotFoundNonNullableFields { poolId: string; } interface EligibilityCheckResultNonNullableFields { eligibleOptions?: EligibleNonNullableFields; notEnoughBalanceOptions?: NotEnoughBalanceNonNullableFields; policyExpressionEvaluatedToFalseOptions?: PolicyExpressionEvaluatedToFalseNonNullableFields; poolNotActiveOptions?: PoolNotActiveNonNullableFields; benefitNotFoundOptions?: BenefitNotFoundNonNullableFields; poolNotFoundOptions?: PoolNotFoundNonNullableFields; type: EligibilityCheckResultType; } export interface CheckBenefitEligibilityResponseNonNullableFields { result?: EligibilityCheckResultNonNullableFields; } interface BenefitSelectorNonNullableFields { poolId: string; itemReference?: ItemReferenceNonNullableFields; count: number; } interface BulkEligibilityCheckResultNonNullableFields { benefitSelector?: BenefitSelectorNonNullableFields; result?: EligibilityCheckResultNonNullableFields; } export interface BulkCheckBenefitEligibilityResponseNonNullableFields { results: BulkEligibilityCheckResultNonNullableFields[]; } export interface GetEligibleBenefitsResponseNonNullableFields { eligibleBenefits: EligibleBenefitNonNullableFields[]; } interface ApplicationErrorNonNullableFields { code: string; description: string; } interface ItemMetadataNonNullableFields { originalIndex: number; success: boolean; error?: ApplicationErrorNonNullableFields; } interface BulkPoolResultNonNullableFields { poolMetadata?: ItemMetadataNonNullableFields; pool?: PoolNonNullableFields; } interface BulkActionMetadataNonNullableFields { totalSuccesses: number; totalFailures: number; undetailedFailures: number; } export interface BulkUpdatePoolsResponseNonNullableFields { results: BulkPoolResultNonNullableFields[]; bulkActionMetadata?: BulkActionMetadataNonNullableFields; } export {};