import { GetPoolRequest as GetPoolRequest$1, GetPoolResponse as GetPoolResponse$1, UpdatePoolRequest as UpdatePoolRequest$1, UpdatePoolResponse as UpdatePoolResponse$1, QueryPoolsRequest as QueryPoolsRequest$1, QueryPoolsResponse as QueryPoolsResponse$1, RedeemBenefitRequest as RedeemBenefitRequest$1, RedeemBenefitResponse as RedeemBenefitResponse$1, ReallocateBenefitRequest as ReallocateBenefitRequest$1, ReallocateBenefitResponse as ReallocateBenefitResponse$1, CancelRedemptionRequest as CancelRedemptionRequest$1, CancelRedemptionResponse as CancelRedemptionResponse$1, CheckBenefitEligibilityRequest as CheckBenefitEligibilityRequest$1, CheckBenefitEligibilityResponse as CheckBenefitEligibilityResponse$1, BulkCheckBenefitEligibilityRequest as BulkCheckBenefitEligibilityRequest$1, BulkCheckBenefitEligibilityResponse as BulkCheckBenefitEligibilityResponse$1, GetEligibleBenefitsRequest as GetEligibleBenefitsRequest$1, GetEligibleBenefitsResponse as GetEligibleBenefitsResponse$1, BulkUpdatePoolsRequest as BulkUpdatePoolsRequest$1, BulkUpdatePoolsResponse as BulkUpdatePoolsResponse$1, CheckBenefitEligibilityByFilterRequest as CheckBenefitEligibilityByFilterRequest$1, CheckBenefitEligibilityByFilterResponse as CheckBenefitEligibilityByFilterResponse$1 } from './index.typings.mjs'; import '@wix/sdk-types'; interface Pool { /** * Pool ID. * @format GUID * @immutable * @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; /** * ID of the associated pool definition. * @format GUID * @readonly * @immutable */ poolDefinitionId?: string | null; /** * ID of the associated program definition. * @format GUID * @readonly * @immutable */ programDefinitionId?: string | null; /** * ID of the program that contains this pool. * @format GUID * @readonly * @immutable */ programId?: string | null; /** * Pool status. * @readonly */ status?: PoolStatusWithLiterals; /** * Pool beneficiary. * @readonly * @immutable */ beneficiary?: CommonIdentificationData; /** Pool benefits and settings. */ details?: Details; /** * Pool name. * * You may want to use the same name that's used in the associated pool definition. * @maxLength 64 */ displayName?: string; /** * 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. * @readonly * @immutable * @minLength 1 * @maxLength 20 */ 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; /** * Associated program definition information. * @readonly */ programDefinition?: ProgramDefinitionInfo; /** * Information about the program containing the pool. * @readonly */ program?: PoolProgramInfo; /** * Version of the pool definition that this pool was created from. * @readonly */ poolDefinitionRevision?: string | null; /** * Number of times this pool has been renewed. * @readonly */ renewalCount?: number | null; /** * Previous status of the benefit pool. * @internal * @readonly */ previousStatus?: PoolStatusWithLiterals; /** * Origin of the benefit pool. * @internal * @readonly * @immutable */ origin?: PoolOriginWithLiterals; /** * Action to be performed on pool renewal * @internal * @readonly */ renewalAction?: PoolRenewalAction; /** * Pool description. * @internal * @maxLength 450 */ description?: string | null; /** * Monotonic counter incremented on every change, including system/materialization updates that do not bump revision. * @internal * @readonly */ changesCounter?: string | null; } declare enum PoolStatus { /** Pool is active. */ ACTIVE = "ACTIVE", /** Pool is paused. It can be resumed. */ PAUSED = "PAUSED", /** Pool is ended. It can't be resumed. */ ENDED = "ENDED", /** Pool provisioning is in progress. This status exists for a short time during processing. */ PROVISIONING = "PROVISIONING", /** Pool renewing is in progress. This status exists for a short time during processing. */ RENEWING = "RENEWING", /** Pool is pending */ PENDING = "PENDING" } /** @enumType */ type PoolStatusWithLiterals = PoolStatus | 'ACTIVE' | 'PAUSED' | 'ENDED' | 'PROVISIONING' | 'RENEWING' | 'PENDING'; interface CommonIdentificationData extends CommonIdentificationDataIdOneOf { /** * ID of a site visitor that hasn't logged in to the site. * @format GUID */ anonymousVisitorId?: string; /** * ID of a site member. * @format GUID */ memberId?: string; /** * ID of a Wix user. * @format GUID */ wixUserId?: string; /** * Identity type. * @internal * @readonly */ identityType?: IdentityTypeWithLiterals; } /** @oneof */ interface CommonIdentificationDataIdOneOf { /** * ID of a site visitor that hasn't logged in to the site. * @format GUID */ anonymousVisitorId?: string; /** * ID of a site member. * @format GUID */ memberId?: string; /** * ID of a Wix user. * @format GUID */ wixUserId?: string; } 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" } /** @enumType */ type IdentityTypeWithLiterals = IdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER'; interface Details { /** * List of benefits. * @maxSize 10 */ benefits?: Benefit[]; /** * Credit settings. * * If this object is empty, you can't set a price for the benefit. */ creditConfiguration?: CreditConfiguration; /** * Defines when benefits can be redeemed. * * Benefit redemption can be limited by: * - **Fixed intervals**: Benefits can be redeemed during specific times of the day or week. * - **Rate limited**: Up to a maximum amount of benefits can be redeemed in a specified time period. * * Expressions can be combined using the *not*, *and*, and *or* operators. * * Each benefit can override this policy. * @internal */ policyExpression?: PolicyExpression; /** Additional information relating to this object. */ additionalData?: Record | null; } interface Benefit { /** * Unique identifier for this benefit. * * This key is consistent across the pool definition and all associated pools that contain this benefit. * @maxLength 64 */ benefitKey?: string; /** * ID that is used to associated items with this benefit. * @format GUID * @immutable * @readonly */ itemSetId?: string | null; /** * Price of the benefit in credits. The price is the same for all of this benefit's items. * @decimalValue options { gte:0, maxScale:4 } */ price?: string | null; /** * Overrides the default policy expression in `benefit.details`. * @internal */ policyExpression?: PolicyExpression; /** Additional information for this benefit. */ additionalData?: Record | null; /** * ID of the app providing the benefit items. * @format GUID * @immutable */ providerAppId?: string | null; /** * Benefit name. * @maxLength 40 */ displayName?: string | null; /** * Benefit description. * @maxLength 255 */ description?: string | null; } interface PolicyExpression extends PolicyExpressionExpressionOneOf { /** Benefits can be redeemed if the expression in this object is not fulfilled. */ operatorNotOptions?: PolicyExpressionNot; /** Benefits can be redeemed if all the expression in this object's array are fulfilled. */ operatorAndOptions?: PolicyExpressionAnd; /** Benefits can be redeemed if at least one of the expressions in this object's array is fulfilled. */ operatorOrOptions?: PolicyExpressionOr; /** Defines when benefits can be redeemed or how many benefits can be redeemed in a specific time period. */ policyOptions?: Policy; /** Policy expression type. */ type?: PolicyExpressionTypeWithLiterals; } /** @oneof */ interface PolicyExpressionExpressionOneOf { /** Benefits can be redeemed if the expression in this object is not fulfilled. */ operatorNotOptions?: PolicyExpressionNot; /** Benefits can be redeemed if all the expression in this object's array are fulfilled. */ operatorAndOptions?: PolicyExpressionAnd; /** Benefits can be redeemed if at least one of the expressions in this object's array is fulfilled. */ operatorOrOptions?: PolicyExpressionOr; /** Defines when benefits can be redeemed or how many benefits can be redeemed in a specific time period. */ policyOptions?: Policy; } declare enum PolicyExpressionType { /** Use with `operatorNotOptions`. */ OPERATOR_NOT = "OPERATOR_NOT", /** Use with `operatorAndOptions`. */ OPERATOR_AND = "OPERATOR_AND", /** Use with `operatorOrOptions`. */ OPERATOR_OR = "OPERATOR_OR", /** Use with `policyOptions`. */ POLICY = "POLICY" } /** @enumType */ type PolicyExpressionTypeWithLiterals = PolicyExpressionType | 'OPERATOR_NOT' | 'OPERATOR_AND' | 'OPERATOR_OR' | 'POLICY'; interface PolicyExpressionNot { /** Policy expression. If this expression is not fulfilled, benefits can be redeemed. */ expression?: PolicyExpression; } interface PolicyExpressionAnd { /** * Array of policy expressions. If all expressions are fulfilled, benefits can be redeemed. * @minSize 2 * @maxSize 10 */ expressions?: PolicyExpression[]; } interface PolicyExpressionOr { /** * Array of policy expressions. If at least one expression is fulfilled, benefits can be redeemed. * @minSize 2 * @maxSize 10 */ expressions?: PolicyExpression[]; } interface Policy extends PolicyPolicyOneOf { /** * Defines an interval during which the policy expression is fulfilled. * * If `fromWeekDay` and `toWeekDay` are defined, this interval applies weekly. Otherwise, it applies daily. */ fixedIntervalOptions?: FixedIntervalPolicy; /** Maximum amount of times a benefit can be redeemed during a specified time period. */ rateLimitedOptions?: RateLimitedPolicy; /** Custom policy defined by a different app. */ customOptions?: CustomPolicy; /** Policy type. */ type?: TypeWithLiterals; } /** @oneof */ interface PolicyPolicyOneOf { /** * Defines an interval during which the policy expression is fulfilled. * * If `fromWeekDay` and `toWeekDay` are defined, this interval applies weekly. Otherwise, it applies daily. */ fixedIntervalOptions?: FixedIntervalPolicy; /** Maximum amount of times a benefit can be redeemed during a specified time period. */ rateLimitedOptions?: RateLimitedPolicy; /** Custom policy defined by a different app. */ customOptions?: CustomPolicy; } declare enum Type { /** Use with `fixedIntervalOptions`. */ FIXED_INTERVAL = "FIXED_INTERVAL", /** Use with `rateLimitedOptions`. */ RATE_LIMITED = "RATE_LIMITED", /** Use with `customOptions`. */ CUSTOM = "CUSTOM" } /** @enumType */ type TypeWithLiterals = Type | 'FIXED_INTERVAL' | 'RATE_LIMITED' | 'CUSTOM'; interface FixedIntervalPolicy { /** Weekday that this interval starts from. If this field is defined, then `toWeekDay` is required. */ fromWeekDay?: WeekDayWithLiterals; /** Weekday that this interval ends at. If this field is defined, then `fromWeekDay` is required. */ toWeekDay?: WeekDayWithLiterals; /** * Hour that this interval starts from. If this field is defined, then `toHour` is required. * @max 23 */ fromHour?: number | null; /** * Hour that this interval ends at. If this field is defined, then `fromHour` is required. * @max 23 */ toHour?: number | null; /** * Minute that this interval starts from. If this field is defined, then `toMinute` is required. * @max 59 */ fromMinute?: number | null; /** * Minute that this interval ends at. If this field is defined, then `fromMinute` is required. * @max 59 */ toMinute?: number | null; } 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" } /** @enumType */ type WeekDayWithLiterals = WeekDay | 'UNKNOWN' | 'MONDAY' | 'TUESDAY' | 'WEDNESDAY' | 'THURSDAY' | 'FRIDAY' | 'SATURDAY' | 'SUNDAY'; interface RateLimitedPolicy { /** Maximum number of times a benefit can be redeemed per specified time period. */ times?: number; /** Time period for the rate limit, resets at the start of each period. */ timePeriod?: TimePeriodWithLiterals; /** * Unique identifier for the quota resource. Set automatically when creating a policy. * Updating RateLimitedPolicy `time period` or `times` will result in a quota reset. * @immutable * @readonly * @format GUID */ quotaId?: string | null; } declare enum TimePeriod { /** Day, starting at midnight. */ DAY = "DAY", /** Calendar month, starting on the first day of the month. */ MONTH = "MONTH" } /** @enumType */ type TimePeriodWithLiterals = TimePeriod | 'DAY' | 'MONTH'; /** Custom policy as implemented by the Entitlement Policy Provider */ interface CustomPolicy { /** * Policy ID. * @format GUID */ id?: string; /** * ID of the app providing the policy. * @format GUID */ appId?: string | null; /** Additional information for this custom policy. */ additionalData?: Record | null; } interface CreditConfiguration { /** * Initial available amount for associated balances. * @decimalValue options { gte:0, maxScale:4 } */ amount?: string; /** Rollover settings. */ rolloverConfiguration?: RolloverConfiguration; /** * Credit unit display name. * @maxLength 32 */ unitDisplayName?: string | null; /** * Credit unit type. * @maxLength 16 */ unitType?: string | null; } interface RolloverConfiguration { /** Whether unused credits roll over to a new cycle when a program renews. */ enabled?: boolean | null; /** * Maximum number of credits that can roll over to the next cycle when a program renews. * @decimalValue options { gte:0, maxScale:4 } */ balanceCap?: string | null; } 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>; } interface ProgramDefinitionInfo { /** * Program definition ID. * @format GUID * @readonly */ id?: string; /** * Program definition external ID. * @format GUID * @readonly */ externalId?: string | null; /** * Display name of the program definition. * @readonly * @maxLength 64 */ displayName?: string | null; /** * Description of the program definition. * @readonly * @maxLength 450 */ description?: string | null; } interface PoolProgramInfo { /** * Program ID. * @format GUID * @readonly */ id?: string; /** * Program external ID. * @format GUID * @readonly */ externalId?: string | null; /** * Display name of the program. * @readonly * @maxLength 64 */ displayName?: string | null; } declare enum PoolOrigin { /** Benefit pool created by a program provision. */ PROVISION = "PROVISION", /** Benefit pool was created when pool definition was added to program definition. */ CASCADE = "CASCADE" } /** @enumType */ type PoolOriginWithLiterals = PoolOrigin | 'PROVISION' | 'CASCADE'; interface PoolRenewalAction extends PoolRenewalActionActionOneOf { /** * The pool's details (benefits and settings) will be updated to match the details of the specified pool definition revision. * @readonly */ updateOptions?: Update; /** * Version of the pool definition that will be used when the pool is renewed. * @readonly */ poolDefinitionRevision?: string | null; /** * The action that will be taken when the pool is renewed * @readonly */ type?: PoolRenewalActionTypeWithLiterals; } /** @oneof */ interface PoolRenewalActionActionOneOf { /** * The pool's details (benefits and settings) will be updated to match the details of the specified pool definition revision. * @readonly */ updateOptions?: Update; } declare enum PoolRenewalActionType { /** Pool will end on program renewal */ END = "END", /** Pool will be updated on program renewal */ UPDATE = "UPDATE" } /** @enumType */ type PoolRenewalActionTypeWithLiterals = PoolRenewalActionType | 'END' | 'UPDATE'; interface Update { /** * The pool's details will be updated to match the details of the specified pool definition revision. * @readonly */ details?: Details; /** * The pool's display name will be updated to match the display name of the specified pool definition revision. * @maxLength 64 */ displayName?: string; /** * The pool's description will be updated to match the description of the specified pool definition revision. * @maxLength 450 */ description?: string | null; } interface PoolProvisioned { /** Pool which has been provisioned */ pool?: Pool; } interface PoolRenewed { /** Pool which has been granted */ pool?: Pool; } interface BenefitRedeemed { /** Pool which has been redeemed */ pool?: Pool; /** Details of the redemption */ redemptionDetails?: RedemptionDetails; } interface RedemptionDetails { /** * Id of the redemption transaction * @format GUID */ transactionId?: string; /** Reference of the item that is being redeemed */ itemReference?: ItemReference; /** * Number of of items to redeem * @min 1 */ 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 * @maxLength 200 */ idempotencyKey?: string; /** Additional info provided during redemption */ additionalData?: Record | null; /** Beneficiary of the entitlement */ beneficiary?: CommonIdentificationData; } interface ItemReference { /** * External ID of the item. * @format GUID */ externalId?: string; /** * Item category. * @maxLength 20 */ category?: string; /** * ID of the app providing the item. * @format GUID */ providerAppId?: string; } interface BenefitReallocated { /** Pool which the reallocated benefit belongs to */ pool?: Pool; /** Details of the reallocation */ reallocationDetails?: ReallocationDetails; } interface ReallocationDetails { /** * Id of the reallocation transaction. This is the new latest transaction in the chain * @format GUID */ transactionId?: string; /** * Id of the transaction superseded by the reallocation * @format GUID */ previousTransactionId?: string; /** Reference of the item that is being reallocated */ itemReference?: ItemReference; /** * Number of items that were redeemed * @min 1 */ itemCount?: number; /** New date at which the item will be used */ targetDate?: Date | null; /** Date at which the item would have been used before this reallocation */ previousTargetDate?: Date | null; /** * Idempotency key of the reallocation request * @maxLength 200 */ idempotencyKey?: string; /** Beneficiary of the entitlement */ beneficiary?: CommonIdentificationData; } interface RedemptionCanceled { /** Pool which the canceled redemption belongs to */ pool?: Pool; /** Details of the cancellation */ cancellationDetails?: CancellationDetails; } interface CancellationDetails { /** * Id of the cancellation transaction. This is the terminal transaction of the chain * @format GUID */ transactionId?: string; /** * Id of the transaction superseded by the cancellation * @format GUID */ previousTransactionId?: string; /** Reference of the item whose redemption was canceled */ itemReference?: ItemReference; /** * Number of items that were redeemed * @min 1 */ itemCount?: number; /** * Idempotency key of the cancellation request * @maxLength 200 */ idempotencyKey?: string; /** Beneficiary of the entitlement */ beneficiary?: CommonIdentificationData; } interface PoolPaused { /** Pool which has been paused */ pool?: Pool; } interface PoolResumed { /** Pool which has been resumed */ pool?: Pool; } interface PoolEnded { /** Pool which has been ended */ pool?: Pool; } interface BenefitReserved { /** Pool which was used to perform this transaction */ pool?: Pool; /** Details of the redemption */ redemptionDetails?: RedemptionDetails; } interface BenefitReservationCanceled { /** Pool which was used to perform this transaction */ pool?: Pool; /** * Id of the canceled reservation transaction * @format GUID */ transactionId?: string; } interface BenefitReservationReleased { /** Pool which was used to perform this transaction */ pool?: Pool; /** * Id of the released reservation transaction * @format GUID */ transactionId?: string; } interface PoolProvisionJobFinished { /** * Program id * @format GUID */ programId?: string; /** Processed item count */ processedItemCount?: number; /** Origin of the pool */ origin?: PoolOriginWithLiterals; } interface PoolStatusUpdateJobFinished extends PoolStatusUpdateJobFinishedContextOneOf { /** The id of the pool definition that is being updated */ poolDefinitionAndProgramDefinition?: PoolDefinitionAndProgramDefinition; /** Update the status of all pools in the program */ programInfo?: ProgramInfo; /** Update the status of a specific pool */ poolInfo?: PoolStatusUpdateParamsPoolInfo; /** Target status of the pool */ targetStatus?: PoolStatusWithLiterals; /** The total number of items that were processed */ processedItemCount?: number; } /** @oneof */ interface PoolStatusUpdateJobFinishedContextOneOf { /** The id of the pool definition that is being updated */ poolDefinitionAndProgramDefinition?: PoolDefinitionAndProgramDefinition; /** Update the status of all pools in the program */ programInfo?: ProgramInfo; /** Update the status of a specific pool */ poolInfo?: PoolStatusUpdateParamsPoolInfo; } interface PoolDefinitionAndProgramDefinition { /** * The id of the pool definition that is being updated * @format GUID * @readonly */ poolDefinitionId?: string; /** * The key of the program that is being updated * @format GUID */ programDefinitionId?: string | null; } interface ProgramInfo { /** * The key of the program that is being updated * @format GUID */ programId?: string; /** Additional data that was provided when the job was submitted */ additionalData?: Record | null; } interface PoolStatusUpdateParamsPoolInfo { /** * The key of the program that is being updated * @format GUID */ poolId?: string; /** Additional data that was provided when the job was submitted */ additionalData?: Record | null; } interface CreatePoolRequest { /** Pool to be created. */ pool?: Pool; } interface CreatePoolResponse { /** Created pool. */ pool?: Pool; } interface GetPoolRequest { /** * ID of the pool to retrieve. * @format GUID */ poolId: string; } interface GetPoolResponse { /** Retrieved pool. */ pool?: Pool; } interface UpdatePoolRequest { /** Pool to update. */ pool: Pool; /** * Explicit list of fields to update. * @internal */ fieldMask?: string[]; } interface UpdatePoolResponse { /** Updated pool. */ pool?: Pool; } interface DeletePoolRequest { /** * ID of the pool to delete. * @format GUID */ poolId?: string; } interface DeletePoolResponse { } interface QueryPoolsRequest { /** Filter, sort, and paging to apply to the query. */ query?: CursorQuery; /** * If true, the response will reflect a consistent snapshot of the data as of the time the request was received. * @internal */ consistent?: boolean | null; } 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. * See [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language) * for more information. */ filter?: Record | null; /** * List of sort objects. * @maxSize 5 */ sort?: Sorting[]; } /** @oneof */ 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; } interface Sorting { /** * Field to sort by. * @maxLength 512 */ fieldName?: string; /** * Sort order. Use `ASC` for ascending order or `DESC` for descending order. * * Default: `ASC` */ order?: SortOrderWithLiterals; /** * When `field_name` is a property of repeated field that is marked as `MATCH_ITEMS` and sort should be done by * a specific element from a collection, filter can/should be provided to ensure correct sort value is picked. * * If multiple filters are provided, they are combined with AND operator. * * Example: * Given we have document like {"id": "1", "nestedField": [{"price": 10, "region": "EU"}, {"price": 20, "region": "US"}]} * and `nestedField` is marked as `MATCH_ITEMS`, to ensure that sorting is done by correct region, filter should be * { fieldName: "nestedField.price", "select_items_by": [{"nestedField.region": "US"}] } * @internal * @maxSize 10 */ selectItemsBy?: Record[] | null; } declare enum SortOrder { /** Ascending sort order. */ ASC = "ASC", /** Descending sort order. */ DESC = "DESC" } /** @enumType */ type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC'; interface CursorPaging { /** * Maximum number of items to return. * @max 100 */ 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. * @maxLength 16000 */ cursor?: string | null; } interface QueryPoolsResponse { /** List of retrieved pools. */ pools?: Pool[]; /** Metadata for the paginated results. */ metadata?: CursorPagingMetadata; } 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; } interface Cursors { /** * Cursor string pointing to the next page in the list of results. * @maxLength 16000 */ next?: string | null; /** * Cursor pointing to the previous page in the list of results. * @maxLength 16000 */ prev?: string | null; } interface RedeemBenefitRequest { /** * ID of the pool that contains the benefit to redeem. * @format GUID */ poolId: string; /** Information about the item to redeem. */ itemReference: ItemReference; /** * Key of the benefit to redeem. * @maxLength 64 */ benefitKey: string; /** * Amount of items to redeem. * @min 1 */ count?: number; /** * Date that the item will be provided to the beneficiary. * * The pool's associated balance will update immediately. This parameter should be used to manage the logistics of providing the item. */ targetDate?: Date | null; /** * Unique identifier, generated by the client. * Used to recognize repeated attempts to make the same request. * @maxLength 200 */ idempotencyKey: string; /** Additional information. */ additionalData?: Record | null; /** Beneficiary of the pool containing the benefit to redeem. */ beneficiary?: CommonIdentificationData; /** * 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. * @minLength 1 * @maxLength 20 */ namespace: string; } interface RedeemBenefitResponse { /** * ID of the transaction recording the associated change in balance. * @format GUID */ transactionId?: string; } interface NotEnoughBalance { /** * Pool ID. * @format GUID */ poolId?: string; /** Item reference. */ itemReference?: ItemReference; /** * Pool's associated balance amount in credits. * @decimalValue options { maxScale:4 } */ availableBalance?: string; /** * Price of the item in credits. * @decimalValue options { maxScale:4 } */ requestedBalance?: string; /** Pool information. */ poolInfo?: PoolInfo; /** Program definition information. */ programDefinitionInfo?: ProgramDefinitionInfo; /** Program information. */ programInfo?: PoolProgramInfo; /** Benefit information. */ benefitInfo?: BenefitInfo; } interface PoolInfo { /** Current pool balance */ balance?: BalanceAmount; /** * Initial available amount for associated balances. * @decimalValue options { gte:0, maxScale:4 } */ creditAmount?: string | null; /** * Pool name * @maxLength 64 */ displayName?: string; /** * Pool description * @maxLength 450 */ description?: string | null; /** * Pool definition id * @format GUID */ poolDefinitionId?: string; /** * Credit unit type. * @maxLength 16 */ creditUnitType?: string | null; } interface BalanceAmount { /** * number of available credits. * @decimalValue options { maxScale:4 } * @readonly */ available?: string; /** * number of reserved credits. * @decimalValue options { maxScale:4 } * @readonly */ reserved?: string; } interface BenefitInfo { /** * Benefit name * @maxLength 64 */ displayName?: string | null; /** * Benefit description * @maxLength 256 */ description?: string | null; /** * Benefit key. * @maxLength 64 */ benefitKey?: string; /** * Price of the benefit in credits. * @decimalValue options { gte:0, maxScale:4 } */ price?: string | null; } interface PolicyExpressionEvaluatedToFalse { /** * Pool ID. * @format GUID */ poolId?: string; /** Item reference. */ itemReference?: ItemReference; /** * Failure details. * @maxSize 10 */ failureDetails?: FailureDetails[]; /** Pool information. */ poolInfo?: PoolInfo; /** Program definition information. */ programDefinitionInfo?: ProgramDefinitionInfo; /** Program information. */ programInfo?: PoolProgramInfo; /** Benefit information. */ benefitInfo?: BenefitInfo; } interface FailureDetails { /** * Failure code * @minLength 1 * @maxLength 64 */ code?: string; /** * Failure message * @maxLength 256 */ message?: string | null; /** * Policy id * @format GUID */ policyId?: string | null; /** * App that owns the policy * @format GUID */ appId?: string | null; /** Information provided by the policy */ errorData?: Record | null; } interface PoolNotActive { /** * Pool ID. * @format GUID */ poolId?: string; /** Pool status. */ poolStatus?: PoolStatusWithLiterals; /** Pool information. */ poolInfo?: PoolInfo; /** Program definition information. */ programDefinitionInfo?: ProgramDefinitionInfo; /** Program information. */ programInfo?: PoolProgramInfo; /** Benefit information. */ benefitInfo?: BenefitInfo; } interface PoolNotFound { /** * Pool ID. * @format GUID */ poolId?: string; } interface BenefitAlreadyRedeemed { /** * Pool ID * @format GUID */ poolId?: string; /** * Idempotency key of the request that failed * @maxLength 200 */ idempotencyKey?: string; } interface BenefitNotFound { /** * Pool ID. * @format GUID */ poolId?: string; /** * Specified benefit key. * @maxLength 64 */ benefitKey?: string | null; /** Pool information. */ poolInfo?: PoolInfo; /** Program definition information. */ programDefinitionInfo?: ProgramDefinitionInfo; /** Program information. */ programInfo?: PoolProgramInfo; } interface ReallocateBenefitRequest { /** * ID of the latest transaction in the redemption's transaction chain. * For a redemption that has never been reallocated, this is the redemption transaction ID. * @format GUID */ transactionId: string; /** New date that the item will be provided to the beneficiary. */ targetDate: Date | null; /** * Unique identifier, generated by the client. * Used to recognize repeated attempts to make the same request. * @maxLength 200 */ idempotencyKey: string; /** Beneficiary of the pool containing the benefit to reallocate. Must match the beneficiary of the original redemption. */ beneficiary: CommonIdentificationData; /** * 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. * @minLength 1 * @maxLength 20 */ namespace: string; /** * Whether the benefit's eligibility checks are skipped, so the new target date is recorded without them. * * When `true`, the pool status, the pool's policies and whether the item is still available in the pool aren't checked, * so `POOL_NOT_REALLOCATABLE`, `POLICY_EXPRESSION_EVALUATED_TO_FALSE` and `ITEM_NOT_AVAILABLE_IN_POOL` aren't returned. * The beneficiary, the namespace, the transaction origin and the transaction chain are always checked. * The reallocation transaction is stored with `details.eligibility_checks_skipped` set to `true`. * * Requires the `benefit_programs:v1:pool:override_reallocation_eligibility` permission. * @internal */ eligibilityChecksSkipped?: boolean; } interface ReallocateBenefitResponse { /** * ID of the reallocation transaction. This is the new latest transaction in the chain. * @format GUID */ transactionId?: string; } interface TransactionNotFound { /** * ID of the transaction that wasn't found. * @format GUID */ transactionId?: string; } interface NotLatestTransaction { /** * ID of the latest transaction in the chain. * @format GUID */ latestTransactionId?: string; } interface RedemptionAlreadyCanceled { /** * ID of the transaction that canceled the redemption. * @format GUID */ cancellationTransactionId?: string; } interface ItemNotAvailableInPool { /** * Pool ID * @format GUID */ poolId?: string; /** Not found item reference in pool */ itemReference?: ItemReference; /** * Key of the referenced benefit, if provided * @maxLength 64 */ benefitKey?: string | null; } interface ChainOperationInProgress { /** * ID of the pending transaction that hasn't settled yet. * @format GUID */ pendingTransactionId?: string; } interface AlreadyExecuted { /** * Idempotency key of the original request. * @maxLength 200 */ idempotencyKey?: string; } interface CancelRedemptionRequest { /** * ID of the latest transaction in the redemption's transaction chain. * For a redemption that has never been reallocated, this is the redemption transaction ID. * @format GUID */ transactionId: string; /** * Unique identifier, generated by the client. * Used to recognize repeated attempts to make the same request. * @maxLength 200 */ idempotencyKey: string; } interface CancelRedemptionResponse { /** * ID of the cancellation transaction. This is the terminal transaction of the chain. * @format GUID */ transactionId?: string; } interface ReserveBenefitRequest { /** * Id of the pool that is being redeemed from * @format GUID */ 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. * @maxLength 64 */ benefitKey?: string | null; /** * Number of items to redeem. * @min 1 */ 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 * @maxLength 200 */ 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. * @minLength 1 * @maxLength 20 */ namespace?: string; } interface ReserveBenefitResponse { /** * Id of the transaction that was created as a result of this request * @format GUID */ transactionId?: string; } interface CancelBenefitReservationRequest { /** * Id of the transaction that was created as a result of this request * @format GUID */ transactionId?: string; } interface CancelBenefitReservationResponse { /** * Id of the transaction that was created as a result of this request * @format GUID */ transactionId?: string; } interface ReleaseBenefitReservationRequest { /** * Id of the transaction that was created as a result of this request * @format GUID */ transactionId?: string; } interface ReleaseBenefitReservationResponse { /** * Id of the transaction that was created as a result of this request * @format GUID */ transactionId?: string; } interface CheckBenefitEligibilityRequest { /** * ID of the pool that the benefit to check belongs to. * @format GUID */ poolId: string; /** * Key of the benefit to check. * @maxLength 64 */ benefitKey?: string | null; /** Information about the item to check. */ itemReference: ItemReference; /** * Amount of items to check. * * Ensures the balance is high enough to redeem this many items. * @min 1 */ count?: number; /** * Date that the item will be provided to the beneficiary. * * This parameter should be used to manage the potential logistics of providing the item. */ targetDate?: Date | null; /** Additional information. */ additionalData?: Record | null; /** Beneficiary of the pool containing the benefit to check. */ beneficiary?: CommonIdentificationData; /** * 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. * @minLength 1 * @maxLength 20 */ namespace: string; /** * Intent of the eligibility check. * * If not provided, `REDEMPTION` is used by default. */ intent?: IntentWithLiterals; } declare enum Intent { /** Check whether the benefit can be redeemed. */ REDEMPTION = "REDEMPTION", /** * Check whether an already redeemed benefit can be reallocated to the target date. * The redeemed credits are kept, so the balance check is skipped. */ REALLOCATION = "REALLOCATION" } /** @enumType */ type IntentWithLiterals = Intent | 'REDEMPTION' | 'REALLOCATION'; interface CheckBenefitEligibilityResponse { /** Result of the eligibility check. */ result?: EligibilityCheckResult; } interface EligibilityCheckResult { /** * Eligibility status. * @maxSize 10 */ benefitResults?: BenefitResult[]; } declare enum BenefitResultType { /** Item is eligible to be redeemed. */ ELIGIBLE_BENEFIT = "ELIGIBLE_BENEFIT", /** Balance is lower than the cost of redeeming the items. */ NOT_ENOUGH_BALANCE = "NOT_ENOUGH_BALANCE", /** * Policy is false. * @internal */ POLICY_EXPRESSION_EVALUATED_TO_FALSE = "POLICY_EXPRESSION_EVALUATED_TO_FALSE", /** Pool isn't active. */ POOL_NOT_ACTIVE = "POOL_NOT_ACTIVE", /** Invalid benefit details provided. */ BENEFIT_NOT_FOUND = "BENEFIT_NOT_FOUND", /** Invalid pool details provided. */ POOL_NOT_FOUND = "POOL_NOT_FOUND" } /** @enumType */ type BenefitResultTypeWithLiterals = BenefitResultType | 'ELIGIBLE_BENEFIT' | 'NOT_ENOUGH_BALANCE' | 'POOL_NOT_ACTIVE' | 'BENEFIT_NOT_FOUND' | 'POOL_NOT_FOUND'; interface EligibleBenefit { /** * Pool ID. * @format GUID * @readonly */ poolId?: string; /** * Benefit key. * @maxLength 64 */ benefitKey?: string; /** Item reference. */ itemReference?: ItemReference; /** * Price of the benefit in credits. * @decimalValue options { gte:0, maxScale:4 } */ price?: string | null; /** Pool information. */ poolInfo?: PoolInfo; /** Benefit information. */ benefitInfo?: BenefitInfo; /** Program definition information. */ programDefinitionInfo?: ProgramDefinitionInfo; /** Program information. */ programInfo?: PoolProgramInfo; } interface BenefitResult extends BenefitResultResultOneOf { /** Returned when item is eligible to be redeemed. */ eligibleBenefitOptions?: EligibleBenefit; /** Returned when the pool's associated balance is lower than the cost of redeeming the items. */ notEnoughBalanceOptions?: NotEnoughBalance; /** Returned when the policy is false. */ policyExpressionEvaluatedToFalseOptions?: PolicyExpressionEvaluatedToFalse; /** Returned when the pool isn't active. */ poolNotActiveOptions?: PoolNotActive; /** Returned when invalid benefit details are provided. */ benefitNotFoundOptions?: BenefitNotFound; /** Returned when invalid pool details are provided. */ poolNotFoundOptions?: PoolNotFound; /** Eligibility status. */ type?: BenefitResultTypeWithLiterals; } /** @oneof */ interface BenefitResultResultOneOf { /** Returned when item is eligible to be redeemed. */ eligibleBenefitOptions?: EligibleBenefit; /** Returned when the pool's associated balance is lower than the cost of redeeming the items. */ notEnoughBalanceOptions?: NotEnoughBalance; /** Returned when the policy is false. */ policyExpressionEvaluatedToFalseOptions?: PolicyExpressionEvaluatedToFalse; /** Returned when the pool isn't active. */ poolNotActiveOptions?: PoolNotActive; /** Returned when invalid benefit details are provided. */ benefitNotFoundOptions?: BenefitNotFound; /** Returned when invalid pool details are provided. */ poolNotFoundOptions?: PoolNotFound; } interface BulkCheckBenefitEligibilityRequest { /** * List of benefits to check. * @minSize 1 * @maxSize 100 */ benefitSelectors?: BenefitSelector[]; /** * 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. * @minLength 1 * @maxLength 20 */ namespace: string; /** Pool beneficiary. */ beneficiary?: CommonIdentificationData; } interface BenefitSelector { /** * ID of the pool that the benefit to check belongs to. * @format GUID */ poolId?: string; /** * Key of the benefit to check. * @maxLength 64 */ benefitKey?: string | null; /** Information about the item to check. */ itemReference?: ItemReference; /** * Amount of items to check. * * Ensures the balance is high enough to redeem this many items. * @min 1 */ count?: number; /** * Date that the item will be provided to the beneficiary. * * This parameter should be used to manage the potential logistics of providing the item. */ targetDate?: Date | null; /** Additional information. */ additionalData?: Record | null; } interface BulkCheckBenefitEligibilityResponse { /** * List of results checking each benefit. * @minSize 1 * @maxSize 100 */ results?: BulkEligibilityCheckResult[]; } interface BulkEligibilityCheckResult { /** Benefit information specified in API call. */ benefitSelector?: BenefitSelector; /** Result of the eligibility check. */ result?: EligibilityCheckResult; } interface GetEligibleBenefitsRequest { /** Item reference. */ itemReference: ItemReference; /** * Amount of items to check. This ensures the balance is high enough to redeem this many items. * @min 1 */ count?: number; /** * Date that the item will be provided to the beneficiary. * * This parameter should be used to manage the potential logistics of providing the item. */ targetDate?: Date | null; /** Additional information. */ additionalData?: Record | null; /** Filter request by beneficiary. */ beneficiary?: CommonIdentificationData; /** * 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. * @minLength 1 * @maxLength 20 */ namespace: string; } interface GetEligibleBenefitsResponse { /** Retrieved benefits that can be redeemed. */ eligibleBenefits?: EligibleBenefit[]; } interface BulkUpdatePoolsRequest { /** * Pools to update. * @minSize 1 * @maxSize 100 */ pools?: MaskedPool[]; /** * Whether to return the full pool definition entities. * * Default: `false` */ returnEntity?: boolean; } interface MaskedPool { /** Pool to update. */ pool?: Pool; /** Explicit list of fields to update. */ fieldMask?: string[]; } interface BulkUpdatePoolsResponse { /** * List of updated pools and associated metadata. * @minSize 1 * @maxSize 100 */ results?: BulkPoolResult[]; /** Bulk action metadata. */ bulkActionMetadata?: BulkActionMetadata; } interface BulkPoolResult { /** Item metadata. */ itemMetadata?: ItemMetadata; /** Pool data. */ item?: Pool; } interface ItemMetadata { /** * Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). * @format GUID */ 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; } interface ApplicationError { /** Error code. */ code?: string; /** Description of the error. */ description?: string; /** Data related to the error. */ data?: Record | null; } 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; } interface ProvisionPoolsForProgramRequest { /** Reference of the template that is used to provision the pools */ poolDefinitionLookupId?: PoolDefinitionLookupId; /** * Program that the provisioned pools are part of * @format GUID */ programId?: string; } interface PoolDefinitionLookupId extends PoolDefinitionLookupIdIdOneOf { /** * Pool definition ID. * @format GUID */ poolDefinitionId?: string; /** * Program definition ID. * @format GUID */ programDefinitionId?: string; } /** @oneof */ interface PoolDefinitionLookupIdIdOneOf { /** * Pool definition ID. * @format GUID */ poolDefinitionId?: string; /** * Program definition ID. * @format GUID */ programDefinitionId?: string; } interface ProvisionPoolsForProgramResponse extends ProvisionPoolsForProgramResponseResultOneOf { /** Sync result */ syncOptions?: SyncResult; /** Async result */ asyncOptions?: AsyncResult; /** * Job ID of the program provision associated with this pool. Retrieve job details using the [Async Job API](https://dev.wix.com/docs/rest/business-management/async-job/introduction). * @format GUID */ jobId?: string; /** Type of the result */ type?: ProvisionPoolsForProgramResponseTypeWithLiterals; } /** @oneof */ interface ProvisionPoolsForProgramResponseResultOneOf { /** Sync result */ syncOptions?: SyncResult; /** Async result */ asyncOptions?: AsyncResult; } declare enum ProvisionPoolsForProgramResponseType { /** Sync result */ SYNC = "SYNC", /** Async result */ ASYNC = "ASYNC" } /** @enumType */ type ProvisionPoolsForProgramResponseTypeWithLiterals = ProvisionPoolsForProgramResponseType | 'SYNC' | 'ASYNC'; interface SyncResult { /** Indicates if the operation was successful */ success?: boolean; } interface AsyncResult { /** * Job ID of the program provision associated with this pool. Retrieve job details using the [Async Job API](https://dev.wix.com/docs/rest/business-management/async-job/introduction). * @format GUID */ jobId?: string; } interface InvalidPoolDefinitionReference { /** Reference of the template that didn't find any pool definitions */ poolDefinitionLookupId?: PoolDefinitionLookupId; } interface RenewPoolsForProgramRequest { /** * Package of pools to grant. Package id should be the same that was used to provision programs. * @format GUID */ programId?: string; } interface RenewPoolsForProgramResponse { /** * Job id of the renewal job * @format GUID */ jobId?: string; } 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?: PoolStatusWithLiterals; /** Pool selector type */ poolSelectorType?: PoolSelectorTypeWithLiterals; } /** @oneof */ interface UpdatePoolStatusRequestPoolSelectorOneOf { /** Pool selector by pool definition id and program definition id */ byPoolDefinitionIdAndProgramDefinitionIdOptions?: ByPoolDefinitionIdAndProgramDefinitionIdOptions; /** Pool selector by program id */ byProgramIdOptions?: ByProgramIdOptions; } declare enum PoolSelectorType { BY_POOL_DEFINITION_ID_AND_PROGRAM_DEFINITION_ID = "BY_POOL_DEFINITION_ID_AND_PROGRAM_DEFINITION_ID", BY_PROGRAM_ID = "BY_PROGRAM_ID" } /** @enumType */ type PoolSelectorTypeWithLiterals = PoolSelectorType | 'BY_POOL_DEFINITION_ID_AND_PROGRAM_DEFINITION_ID' | 'BY_PROGRAM_ID'; interface ByPoolDefinitionIdAndProgramDefinitionIdOptions { /** * Pool definition id * @format GUID */ poolDefinitionId?: string; /** * Program definition id * @format GUID */ programDefinitionId?: string | null; } interface ByProgramIdOptions { /** * Program id * @format GUID */ programId?: string; /** Additional data that gets added to the event once the async job completes */ additionalData?: Record | null; } interface UpdatePoolStatusResponse { /** * Job ID of the program provision associated with this pool. Retrieve job details using the [Async Job API](https://dev.wix.com/docs/rest/business-management/async-job/introduction). * @format GUID */ jobId?: string; } interface CountNumberOfPoolsInProvisioningStatusRequest { /** * Program id * @format GUID */ programId?: string; } interface CountNumberOfPoolsInProvisioningStatusResponse { /** Number of pools in provisioning status */ count?: number; } interface CheckBenefitEligibilityByFilterRequest { /** * 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. * @minLength 1 * @maxLength 20 */ namespace: string; /** Information about the item to check. */ itemReference: ItemReference; /** * Number of items to check. * * Ensures the balance is high enough to redeem this many items. * @min 1 */ count: number; /** * Date that the item will be provided to the beneficiary. * * This parameter should be used to manage the potential logistics of providing the item. */ targetDate?: Date | null; /** Pool beneficiary. Defaults to the calling identity. Only the beneficiary's pools that also match `pool_selector` are checked. */ beneficiary?: CommonIdentificationData; /** Additional information. */ additionalData?: Record | null; /** * Predefined attributes used to select the pools to check eligibility in. * * When omitted, pools in all statuses are checked. Combined with `beneficiary`, `namespace`, and `item_reference`, the selector further narrows which pools are checked. */ poolSelector?: PoolSelector; } /** * Predefined pool-selection attributes used to select the pools to check eligibility in. * * All provided attributes must match for a pool to be selected, while the values within each attribute are alternatives. * An empty selector selects all pools in the namespace that match the provided `beneficiary`. */ interface PoolSelector { /** * Only pools in these statuses are checked. When empty, pools in all statuses are checked. * @maxSize 10 */ poolStatuses?: PoolStatusWithLiterals[]; } interface CheckBenefitEligibilityByFilterResponse { /** * Results of the eligibility check for the benefits in the pools that match the request. A pool that contains multiple benefits for the requested item produces one result per benefit. * * Empty when no pools match. */ results?: EligibilityCheckResult[]; } interface HealPoolRequest { /** * ID of the pool whose enrichments should be re-materialized. * @format GUID */ poolId?: string; } interface HealPoolResponse { } interface HealPoolTenantRequest { } interface HealPoolTenantResponse { } interface DomainEvent extends DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; /** Event ID. With this ID you can easily spot duplicated events and ignore them. */ id?: string; /** * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities. * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`. */ entityFqdn?: string; /** * Event action name, placed at the top level to make it easier for users to dispatch messages. * For 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 that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number. * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it. */ entityEventSequence?: string | null; } /** @oneof */ interface DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; } interface EntityCreatedEvent { entityAsJson?: string; /** * Indicates the event was triggered by a restore-from-trashbin operation for a previously deleted entity * @internal */ triggeredByUndelete?: boolean | null; /** Indicates the event was triggered by a restore-from-trashbin operation for a previously deleted entity */ restoreInfo?: RestoreInfo; /** * Optional domain-specific metadata defined by the API owner, encoded as JSON. * @internal */ additionalMetadataAsJson?: string | null; } interface RestoreInfo { deletedDate?: Date | null; } 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; /** * This field is currently part of the of the EntityUpdatedEvent msg, but scala/node libraries which implements the domain events standard * wont populate it / have any reference to it in the API. * The main reason for it is that fetching the old entity from the DB will have a performance hit on an update operation so unless truly needed, * the developer should send only the new (current) entity. * An additional reason is not wanting to send this additional entity over the wire (kafka) since in some cases it can be really big * Developers that must reflect the old entity will have to implement their own domain event sender mechanism which will follow the DomainEvent proto message. * @internal * @deprecated */ previousEntityAsJson?: string | null; /** * Map of fully qualified field paths to their previous values for fields that changed. * For more details please see [AIP](https://dev.wix.com/docs/rnd-general/articles/p13n-guidelines-aips/guidance-aips/design-patterns/7016-events#modified-fields-format) * @internal */ modifiedFields?: Record; /** * Optional domain-specific metadata defined by the API owner, encoded as JSON. * @internal */ additionalMetadataAsJson?: string | null; } interface EntityDeletedEvent { /** * Indicates if the entity is sent to trash-bin. only available when trash-bin is enabled * @internal */ movedToTrash?: boolean | null; /** Entity that was deleted. */ deletedEntityAsJson?: string | null; /** * Optional domain-specific metadata defined by the API owner, encoded as JSON. * @internal */ additionalMetadataAsJson?: string | null; } interface ActionEvent { bodyAsJson?: string; } interface MessageEnvelope { /** * App instance ID. * @format GUID */ instanceId?: string | null; /** * Event type. * @maxLength 150 */ eventType?: string; /** The identification type and identity data. */ identity?: IdentificationData; /** Stringify payload. */ data?: string; /** Details related to the account */ accountInfo?: AccountInfo; } interface IdentificationData extends IdentificationDataIdOneOf { /** * ID of a site visitor that has not logged in to the site. * @format GUID */ anonymousVisitorId?: string; /** * ID of a site visitor that has logged in to the site. * @format GUID */ memberId?: string; /** * ID of a Wix user (site owner, contributor, etc.). * @format GUID */ wixUserId?: string; /** * ID of an app. * @format GUID */ appId?: string; /** @readonly */ identityType?: WebhookIdentityTypeWithLiterals; } /** @oneof */ interface IdentificationDataIdOneOf { /** * ID of a site visitor that has not logged in to the site. * @format GUID */ anonymousVisitorId?: string; /** * ID of a site visitor that has logged in to the site. * @format GUID */ memberId?: string; /** * ID of a Wix user (site owner, contributor, etc.). * @format GUID */ wixUserId?: string; /** * ID of an app. * @format GUID */ appId?: string; } declare enum WebhookIdentityType { UNKNOWN = "UNKNOWN", ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR", MEMBER = "MEMBER", WIX_USER = "WIX_USER", APP = "APP" } /** @enumType */ type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP'; interface AccountInfo { /** * ID of the Wix account associated with the event. * @format GUID */ accountId?: string | null; /** * ID of the parent Wix account. Only included when accountId belongs to a child account. * @format GUID */ parentAccountId?: string | null; /** * ID of the Wix site associated with the event. Only included when the event is tied to a specific site. * @format GUID */ siteId?: string | null; } /** @docsIgnore */ type RedeemBenefitApplicationErrors = { code?: 'NOT_ENOUGH_BALANCE'; description?: string; data?: NotEnoughBalance; } | { code?: 'POLICY_EXPRESSION_EVALUATED_TO_FALSE'; description?: string; data?: PolicyExpressionEvaluatedToFalse; } | { code?: 'POOL_NOT_ACTIVE'; description?: string; data?: PoolNotActive; } | { code?: 'POOL_NOT_FOUND'; description?: string; data?: PoolNotFound; } | { code?: 'BENEFIT_ALREADY_REDEEMED'; description?: string; data?: BenefitAlreadyRedeemed; } | { code?: 'BENEFIT_NOT_FOUND'; description?: string; data?: BenefitNotFound; }; /** @docsIgnore */ type ReallocateBenefitApplicationErrors = { code?: 'TRANSACTION_NOT_FOUND'; description?: string; data?: TransactionNotFound; } | { code?: 'POOL_NOT_FOUND'; description?: string; data?: PoolNotFound; } | { code?: 'NOT_LATEST_TRANSACTION'; description?: string; data?: NotLatestTransaction; } | { code?: 'REDEMPTION_ALREADY_CANCELED'; description?: string; data?: RedemptionAlreadyCanceled; } | { code?: 'TRANSACTION_NOT_REALLOCATABLE'; description?: string; data?: Record; } | { code?: 'POOL_NOT_REALLOCATABLE'; description?: string; data?: PoolNotActive; } | { code?: 'ITEM_NOT_AVAILABLE_IN_POOL'; description?: string; data?: ItemNotAvailableInPool; } | { code?: 'POLICY_EXPRESSION_EVALUATED_TO_FALSE'; description?: string; data?: PolicyExpressionEvaluatedToFalse; } | { code?: 'CHAIN_OPERATION_IN_PROGRESS'; description?: string; data?: ChainOperationInProgress; } | { code?: 'ALREADY_EXECUTED'; description?: string; data?: AlreadyExecuted; }; /** @docsIgnore */ type CancelRedemptionApplicationErrors = { code?: 'TRANSACTION_NOT_FOUND'; description?: string; data?: TransactionNotFound; } | { code?: 'NOT_LATEST_TRANSACTION'; description?: string; data?: NotLatestTransaction; } | { code?: 'REDEMPTION_ALREADY_CANCELED'; description?: string; data?: RedemptionAlreadyCanceled; } | { code?: 'TRANSACTION_NOT_CANCELABLE'; description?: string; data?: Record; } | { code?: 'CHAIN_OPERATION_IN_PROGRESS'; description?: string; data?: ChainOperationInProgress; } | { code?: 'ALREADY_EXECUTED'; description?: string; data?: AlreadyExecuted; }; /** @docsIgnore */ type GetEligibleBenefitsApplicationErrors = { code?: 'INVALID_ITEM_REFERENCE'; description?: string; data?: Record; }; /** @docsIgnore */ type CheckBenefitEligibilityByFilterApplicationErrors = { code?: 'INVALID_ITEM_REFERENCE'; description?: string; data?: Record; }; type __PublicMethodMetaInfo = { getUrl: (context: any) => string; httpMethod: K; path: string; pathParams: M; __requestType: T; __originalRequestType: S; __responseType: Q; __originalResponseType: R; }; declare function getPool(): __PublicMethodMetaInfo<'GET', { poolId: string; }, GetPoolRequest$1, GetPoolRequest, GetPoolResponse$1, GetPoolResponse>; declare function updatePool(): __PublicMethodMetaInfo<'PATCH', { poolId: string; }, UpdatePoolRequest$1, UpdatePoolRequest, UpdatePoolResponse$1, UpdatePoolResponse>; declare function queryPools(): __PublicMethodMetaInfo<'POST', {}, QueryPoolsRequest$1, QueryPoolsRequest, QueryPoolsResponse$1, QueryPoolsResponse>; declare function redeemBenefit(): __PublicMethodMetaInfo<'POST', {}, RedeemBenefitRequest$1, RedeemBenefitRequest, RedeemBenefitResponse$1, RedeemBenefitResponse>; declare function reallocateBenefit(): __PublicMethodMetaInfo<'POST', {}, ReallocateBenefitRequest$1, ReallocateBenefitRequest, ReallocateBenefitResponse$1, ReallocateBenefitResponse>; declare function cancelRedemption(): __PublicMethodMetaInfo<'POST', {}, CancelRedemptionRequest$1, CancelRedemptionRequest, CancelRedemptionResponse$1, CancelRedemptionResponse>; declare function checkBenefitEligibility(): __PublicMethodMetaInfo<'POST', {}, CheckBenefitEligibilityRequest$1, CheckBenefitEligibilityRequest, CheckBenefitEligibilityResponse$1, CheckBenefitEligibilityResponse>; declare function bulkCheckBenefitEligibility(): __PublicMethodMetaInfo<'POST', {}, BulkCheckBenefitEligibilityRequest$1, BulkCheckBenefitEligibilityRequest, BulkCheckBenefitEligibilityResponse$1, BulkCheckBenefitEligibilityResponse>; declare function getEligibleBenefits(): __PublicMethodMetaInfo<'POST', {}, GetEligibleBenefitsRequest$1, GetEligibleBenefitsRequest, GetEligibleBenefitsResponse$1, GetEligibleBenefitsResponse>; declare function bulkUpdatePools(): __PublicMethodMetaInfo<'POST', {}, BulkUpdatePoolsRequest$1, BulkUpdatePoolsRequest, BulkUpdatePoolsResponse$1, BulkUpdatePoolsResponse>; declare function checkBenefitEligibilityByFilter(): __PublicMethodMetaInfo<'POST', {}, CheckBenefitEligibilityByFilterRequest$1, CheckBenefitEligibilityByFilterRequest, CheckBenefitEligibilityByFilterResponse$1, CheckBenefitEligibilityByFilterResponse>; export { type AccountInfo as AccountInfoOriginal, type ActionEvent as ActionEventOriginal, type AlreadyExecuted as AlreadyExecutedOriginal, type ApplicationError as ApplicationErrorOriginal, type AsyncResult as AsyncResultOriginal, type BalanceAmount as BalanceAmountOriginal, type BenefitAlreadyRedeemed as BenefitAlreadyRedeemedOriginal, type BenefitInfo as BenefitInfoOriginal, type BenefitNotFound as BenefitNotFoundOriginal, type Benefit as BenefitOriginal, type BenefitReallocated as BenefitReallocatedOriginal, type BenefitRedeemed as BenefitRedeemedOriginal, type BenefitReservationCanceled as BenefitReservationCanceledOriginal, type BenefitReservationReleased as BenefitReservationReleasedOriginal, type BenefitReserved as BenefitReservedOriginal, type BenefitResult as BenefitResultOriginal, type BenefitResultResultOneOf as BenefitResultResultOneOfOriginal, BenefitResultType as BenefitResultTypeOriginal, type BenefitResultTypeWithLiterals as BenefitResultTypeWithLiteralsOriginal, type BenefitSelector as BenefitSelectorOriginal, type BulkActionMetadata as BulkActionMetadataOriginal, type BulkCheckBenefitEligibilityRequest as BulkCheckBenefitEligibilityRequestOriginal, type BulkCheckBenefitEligibilityResponse as BulkCheckBenefitEligibilityResponseOriginal, type BulkEligibilityCheckResult as BulkEligibilityCheckResultOriginal, type BulkPoolResult as BulkPoolResultOriginal, type BulkUpdatePoolsRequest as BulkUpdatePoolsRequestOriginal, type BulkUpdatePoolsResponse as BulkUpdatePoolsResponseOriginal, type ByPoolDefinitionIdAndProgramDefinitionIdOptions as ByPoolDefinitionIdAndProgramDefinitionIdOptionsOriginal, type ByProgramIdOptions as ByProgramIdOptionsOriginal, type CancelBenefitReservationRequest as CancelBenefitReservationRequestOriginal, type CancelBenefitReservationResponse as CancelBenefitReservationResponseOriginal, type CancelRedemptionApplicationErrors as CancelRedemptionApplicationErrorsOriginal, type CancelRedemptionRequest as CancelRedemptionRequestOriginal, type CancelRedemptionResponse as CancelRedemptionResponseOriginal, type CancellationDetails as CancellationDetailsOriginal, type ChainOperationInProgress as ChainOperationInProgressOriginal, type CheckBenefitEligibilityByFilterApplicationErrors as CheckBenefitEligibilityByFilterApplicationErrorsOriginal, type CheckBenefitEligibilityByFilterRequest as CheckBenefitEligibilityByFilterRequestOriginal, type CheckBenefitEligibilityByFilterResponse as CheckBenefitEligibilityByFilterResponseOriginal, type CheckBenefitEligibilityRequest as CheckBenefitEligibilityRequestOriginal, type CheckBenefitEligibilityResponse as CheckBenefitEligibilityResponseOriginal, type CommonIdentificationDataIdOneOf as CommonIdentificationDataIdOneOfOriginal, type CommonIdentificationData as CommonIdentificationDataOriginal, type CountNumberOfPoolsInProvisioningStatusRequest as CountNumberOfPoolsInProvisioningStatusRequestOriginal, type CountNumberOfPoolsInProvisioningStatusResponse as CountNumberOfPoolsInProvisioningStatusResponseOriginal, type CreatePoolRequest as CreatePoolRequestOriginal, type CreatePoolResponse as CreatePoolResponseOriginal, type CreditConfiguration as CreditConfigurationOriginal, type CursorPagingMetadata as CursorPagingMetadataOriginal, type CursorPaging as CursorPagingOriginal, type CursorQuery as CursorQueryOriginal, type CursorQueryPagingMethodOneOf as CursorQueryPagingMethodOneOfOriginal, type Cursors as CursorsOriginal, type CustomPolicy as CustomPolicyOriginal, type DeletePoolRequest as DeletePoolRequestOriginal, type DeletePoolResponse as DeletePoolResponseOriginal, type Details as DetailsOriginal, type DomainEventBodyOneOf as DomainEventBodyOneOfOriginal, type DomainEvent as DomainEventOriginal, type EligibilityCheckResult as EligibilityCheckResultOriginal, type EligibleBenefit as EligibleBenefitOriginal, type EntityCreatedEvent as EntityCreatedEventOriginal, type EntityDeletedEvent as EntityDeletedEventOriginal, type EntityUpdatedEvent as EntityUpdatedEventOriginal, type ExtendedFields as ExtendedFieldsOriginal, type FailureDetails as FailureDetailsOriginal, type FixedIntervalPolicy as FixedIntervalPolicyOriginal, type GetEligibleBenefitsApplicationErrors as GetEligibleBenefitsApplicationErrorsOriginal, type GetEligibleBenefitsRequest as GetEligibleBenefitsRequestOriginal, type GetEligibleBenefitsResponse as GetEligibleBenefitsResponseOriginal, type GetPoolRequest as GetPoolRequestOriginal, type GetPoolResponse as GetPoolResponseOriginal, type HealPoolRequest as HealPoolRequestOriginal, type HealPoolResponse as HealPoolResponseOriginal, type HealPoolTenantRequest as HealPoolTenantRequestOriginal, type HealPoolTenantResponse as HealPoolTenantResponseOriginal, type IdentificationDataIdOneOf as IdentificationDataIdOneOfOriginal, type IdentificationData as IdentificationDataOriginal, IdentityType as IdentityTypeOriginal, type IdentityTypeWithLiterals as IdentityTypeWithLiteralsOriginal, Intent as IntentOriginal, type IntentWithLiterals as IntentWithLiteralsOriginal, type InvalidPoolDefinitionReference as InvalidPoolDefinitionReferenceOriginal, type ItemMetadata as ItemMetadataOriginal, type ItemNotAvailableInPool as ItemNotAvailableInPoolOriginal, type ItemReference as ItemReferenceOriginal, type MaskedPool as MaskedPoolOriginal, type MessageEnvelope as MessageEnvelopeOriginal, type NotEnoughBalance as NotEnoughBalanceOriginal, type NotLatestTransaction as NotLatestTransactionOriginal, type PolicyExpressionAnd as PolicyExpressionAndOriginal, type PolicyExpressionEvaluatedToFalse as PolicyExpressionEvaluatedToFalseOriginal, type PolicyExpressionExpressionOneOf as PolicyExpressionExpressionOneOfOriginal, type PolicyExpressionNot as PolicyExpressionNotOriginal, type PolicyExpressionOr as PolicyExpressionOrOriginal, type PolicyExpression as PolicyExpressionOriginal, PolicyExpressionType as PolicyExpressionTypeOriginal, type PolicyExpressionTypeWithLiterals as PolicyExpressionTypeWithLiteralsOriginal, type Policy as PolicyOriginal, type PolicyPolicyOneOf as PolicyPolicyOneOfOriginal, type PoolDefinitionAndProgramDefinition as PoolDefinitionAndProgramDefinitionOriginal, type PoolDefinitionLookupIdIdOneOf as PoolDefinitionLookupIdIdOneOfOriginal, type PoolDefinitionLookupId as PoolDefinitionLookupIdOriginal, type PoolEnded as PoolEndedOriginal, type PoolInfo as PoolInfoOriginal, type PoolNotActive as PoolNotActiveOriginal, type PoolNotFound as PoolNotFoundOriginal, PoolOrigin as PoolOriginOriginal, type PoolOriginWithLiterals as PoolOriginWithLiteralsOriginal, type Pool as PoolOriginal, type PoolPaused as PoolPausedOriginal, type PoolProgramInfo as PoolProgramInfoOriginal, type PoolProvisionJobFinished as PoolProvisionJobFinishedOriginal, type PoolProvisioned as PoolProvisionedOriginal, type PoolRenewalActionActionOneOf as PoolRenewalActionActionOneOfOriginal, type PoolRenewalAction as PoolRenewalActionOriginal, PoolRenewalActionType as PoolRenewalActionTypeOriginal, type PoolRenewalActionTypeWithLiterals as PoolRenewalActionTypeWithLiteralsOriginal, type PoolRenewed as PoolRenewedOriginal, type PoolResumed as PoolResumedOriginal, type PoolSelector as PoolSelectorOriginal, PoolSelectorType as PoolSelectorTypeOriginal, type PoolSelectorTypeWithLiterals as PoolSelectorTypeWithLiteralsOriginal, PoolStatus as PoolStatusOriginal, type PoolStatusUpdateJobFinishedContextOneOf as PoolStatusUpdateJobFinishedContextOneOfOriginal, type PoolStatusUpdateJobFinished as PoolStatusUpdateJobFinishedOriginal, type PoolStatusUpdateParamsPoolInfo as PoolStatusUpdateParamsPoolInfoOriginal, type PoolStatusWithLiterals as PoolStatusWithLiteralsOriginal, type ProgramDefinitionInfo as ProgramDefinitionInfoOriginal, type ProgramInfo as ProgramInfoOriginal, type ProvisionPoolsForProgramRequest as ProvisionPoolsForProgramRequestOriginal, type ProvisionPoolsForProgramResponse as ProvisionPoolsForProgramResponseOriginal, type ProvisionPoolsForProgramResponseResultOneOf as ProvisionPoolsForProgramResponseResultOneOfOriginal, ProvisionPoolsForProgramResponseType as ProvisionPoolsForProgramResponseTypeOriginal, type ProvisionPoolsForProgramResponseTypeWithLiterals as ProvisionPoolsForProgramResponseTypeWithLiteralsOriginal, type QueryPoolsRequest as QueryPoolsRequestOriginal, type QueryPoolsResponse as QueryPoolsResponseOriginal, type RateLimitedPolicy as RateLimitedPolicyOriginal, type ReallocateBenefitApplicationErrors as ReallocateBenefitApplicationErrorsOriginal, type ReallocateBenefitRequest as ReallocateBenefitRequestOriginal, type ReallocateBenefitResponse as ReallocateBenefitResponseOriginal, type ReallocationDetails as ReallocationDetailsOriginal, type RedeemBenefitApplicationErrors as RedeemBenefitApplicationErrorsOriginal, type RedeemBenefitRequest as RedeemBenefitRequestOriginal, type RedeemBenefitResponse as RedeemBenefitResponseOriginal, type RedemptionAlreadyCanceled as RedemptionAlreadyCanceledOriginal, type RedemptionCanceled as RedemptionCanceledOriginal, type RedemptionDetails as RedemptionDetailsOriginal, type ReleaseBenefitReservationRequest as ReleaseBenefitReservationRequestOriginal, type ReleaseBenefitReservationResponse as ReleaseBenefitReservationResponseOriginal, type RenewPoolsForProgramRequest as RenewPoolsForProgramRequestOriginal, type RenewPoolsForProgramResponse as RenewPoolsForProgramResponseOriginal, type ReserveBenefitRequest as ReserveBenefitRequestOriginal, type ReserveBenefitResponse as ReserveBenefitResponseOriginal, type RestoreInfo as RestoreInfoOriginal, type RolloverConfiguration as RolloverConfigurationOriginal, SortOrder as SortOrderOriginal, type SortOrderWithLiterals as SortOrderWithLiteralsOriginal, type Sorting as SortingOriginal, type SyncResult as SyncResultOriginal, TimePeriod as TimePeriodOriginal, type TimePeriodWithLiterals as TimePeriodWithLiteralsOriginal, type TransactionNotFound as TransactionNotFoundOriginal, Type as TypeOriginal, type TypeWithLiterals as TypeWithLiteralsOriginal, type Update as UpdateOriginal, type UpdatePoolRequest as UpdatePoolRequestOriginal, type UpdatePoolResponse as UpdatePoolResponseOriginal, type UpdatePoolStatusRequest as UpdatePoolStatusRequestOriginal, type UpdatePoolStatusRequestPoolSelectorOneOf as UpdatePoolStatusRequestPoolSelectorOneOfOriginal, type UpdatePoolStatusResponse as UpdatePoolStatusResponseOriginal, WebhookIdentityType as WebhookIdentityTypeOriginal, type WebhookIdentityTypeWithLiterals as WebhookIdentityTypeWithLiteralsOriginal, WeekDay as WeekDayOriginal, type WeekDayWithLiterals as WeekDayWithLiteralsOriginal, type __PublicMethodMetaInfo, bulkCheckBenefitEligibility, bulkUpdatePools, cancelRedemption, checkBenefitEligibility, checkBenefitEligibilityByFilter, getEligibleBenefits, getPool, queryPools, reallocateBenefit, redeemBenefit, updatePool };