import { NonNullablePaths } from '@wix/sdk-types'; /** * A loyalty program allows sites to maintain customer reward accounts. Wix users can create a * loyalty program to increase customer retention. Read more about the [loyalty program](https://support.wix.com/en/article/wix-loyalty-program-an-overview). */ interface LoyaltyProgram { /** * Program name. * @minLength 2 * @maxLength 50 */ name?: string | null; /** Information about the program's collectible entity. */ pointDefinition?: PointDefinition; /** * Program status. * Customers can only earn or redeem points while the program is `"ACTIVE"`. * * Default: `"DRAFT"` * @readonly */ status?: ProgramStatusWithLiterals; /** * Date and time the program was created. * @readonly */ _createdDate?: Date | null; /** * Date and time the program was updated. * @readonly */ _updatedDate?: Date | null; /** Configuration for the points expiration feature. */ pointsExpiration?: PointsExpiration; /** * Information about the available program premium features. * @readonly */ premiumFeatures?: PremiumFeatures; } interface PointDefinition { /** * Display name for the program's collectible unit. * * It's recommended to use a plural, for example `"Stars"`. * * In contrast to a custom name, the default `"Points"` name is translated and adjusted to singular based on circumstances. * * Default: `"Points"`. * @maxLength 20 */ customName?: string | null; /** Image URL. */ icon?: string; } interface FocalPoint { /** X-coordinate of the focal point. */ x?: number; /** Y-coordinate of the focal point. */ y?: number; /** crop by height */ height?: number | null; /** crop by width */ width?: number | null; } declare enum ProgramStatus { /** Unknown program status. */ UNKNOWN = "UNKNOWN", /** Program is in draft mode. Customers can't earn or redeem points. */ DRAFT = "DRAFT", /** Program is active. Customers can earn and redeem points. */ ACTIVE = "ACTIVE", /** * Program is paused. Customers can't earn or redeem points while the program is paused. * * Set the program to `"ACTIVE"` to resume earning and redeeming points. */ PAUSED = "PAUSED" } /** @enumType */ type ProgramStatusWithLiterals = ProgramStatus | 'UNKNOWN' | 'DRAFT' | 'ACTIVE' | 'PAUSED'; interface PointsExpiration { /** * Status of the points expiration feature. * @readonly */ status?: StatusWithLiterals; /** * How many months a member should be inactive to lose the collected points. * @min 1 * @max 12 */ monthsOfInactivity?: number; /** * Percentage of points that a member loses after being inactive. * @min 1 * @max 100 */ expiringPointsPercentage?: number; } declare enum Status { /** Points expiration feature is disabled. */ DISABLED = "DISABLED", /** Points expiration feature is enabled. */ ENABLED = "ENABLED" } /** @enumType */ type StatusWithLiterals = Status | 'DISABLED' | 'ENABLED'; interface PremiumFeatures { /** * Whether there are any loyalty program premium features. * @readonly */ loyaltyProgram?: boolean; /** * Whether this loyalty program includes tiers. * @readonly */ tiers?: boolean; /** * Whether this loyalty program includes point expiration. * @readonly */ pointsExpiration?: boolean; } interface SocialMediaSettings { /** * List of social media channels * @maxSize 5 */ channels?: SocialMediaChannel[]; } interface SocialMediaChannel { /** Social media channel type */ type?: TypeWithLiterals; /** Enable or disable social media channel */ enabled?: boolean; /** * Social media channel ID. For example, Instagram username. * @minLength 1 * @maxLength 255 */ _id?: string; /** * Social media channel URL * @readonly * @format WEB_URL */ url?: string | null; } declare enum Type { /** Facebook social media channel. */ FACEBOOK = "FACEBOOK", /** Instagram social media channel. */ INSTAGRAM = "INSTAGRAM", /** LinkedIn social media channel. */ LINKEDIN = "LINKEDIN", /** X social media channel. */ X = "X", /** TikTok social media channel. */ TIKTOK = "TIKTOK" } /** @enumType */ type TypeWithLiterals = Type | 'FACEBOOK' | 'INSTAGRAM' | 'LINKEDIN' | 'X' | 'TIKTOK'; interface GetLoyaltyProgramRequest { } interface GetLoyaltyProgramResponse { /** Retrieved loyalty program. */ loyaltyProgram?: LoyaltyProgram; } interface BulkGetLoyaltyProgramRequest { } interface BulkGetLoyaltyProgramResponse { /** Retrieved loyalty programs. */ programInSites?: ProgramInSite[]; } interface ProgramInSite { /** * Metasite ID. * @format GUID */ metaSiteId?: string; /** Loyalty program. */ loyaltyProgram?: LoyaltyProgram; } interface UpdateLoyaltyProgramRequest { /** Loyalty program fields to update. */ loyaltyProgram: LoyaltyProgram; } interface UpdateLoyaltyProgramResponse { /** Updated loyalty program. */ loyaltyProgram?: LoyaltyProgram; } interface PointsExpirationConfigurationChanged { /** Loyalty program. */ loyaltyProgram?: LoyaltyProgram; /** Points expiration configuration changes */ pointsExpirationChanges?: PointsExpirationChanges; } interface PointsExpirationChanges { monthsOfInactivity?: number | null; expiringPointsPercentage?: number | null; } interface ActivateLoyaltyProgramRequest { } interface ActivateLoyaltyProgramResponse { /** Activated loyalty program. */ loyaltyProgram?: LoyaltyProgram; } interface LoyaltyProgramActivated { /** Activated loyalty program. */ loyaltyProgram?: LoyaltyProgram; } interface PauseLoyaltyProgramRequest { } interface PauseLoyaltyProgramResponse { /** Paused loyalty program. */ loyaltyProgram?: LoyaltyProgram; } interface GetLoyaltyProgramDescriptionRequest { /** * List of description fields to retrieve. Supported values: `description`, `updatedDate`. * @maxSize 2 */ fields?: string[]; } interface GetLoyaltyProgramDescriptionResponse { /** Retrieved loyalty program description. */ description?: string | null; /** Date and time of the latest description update. */ _updatedDate?: Date | null; } interface UpdateLoyaltyProgramDescriptionRequest { /** * Loyalty program description to update. * @minLength 1 * @maxLength 1000000 */ description?: string; } interface UpdateLoyaltyProgramDescriptionResponse { } interface LoyaltyProgramDescriptionUpdated { } interface GetLoyaltyProgramPremiumFeaturesRequest { } interface GetLoyaltyProgramPremiumFeaturesResponse { /** * Whether there are any loyalty program premium features. * @readonly */ loyaltyProgram?: boolean; /** * Whether this loyalty program includes tiers. * @readonly */ tiers?: boolean; /** * Whether this loyalty program includes point expiration. * @readonly */ pointsExpiration?: boolean; } interface EnablePointsExpirationRequest { } interface EnablePointsExpirationResponse { /** Loyalty program with enabled points expiration feature. */ loyaltyProgram?: LoyaltyProgram; } interface PointsExpirationEnabled { /** Loyalty program. */ loyaltyProgram?: LoyaltyProgram; } interface DisablePointsExpirationRequest { } interface DisablePointsExpirationResponse { /** Loyalty program with disabled points expiration feature. */ loyaltyProgram?: LoyaltyProgram; } interface PointsExpirationDisabled { /** Loyalty program. */ loyaltyProgram?: LoyaltyProgram; } interface FeatureEvent extends FeatureEventEventOneOf { /** * Information about an event that makes a feature eligible to the user. * Triggered for example, for new features or when a feature is reassigned * to an account or a site. */ enabled?: FeatureEnabled; /** * Information about an event that disables a feature for the user. * Triggered for example, when a feature is unassigned from a site, * reassigned to a different site, or the user switched to a different contract. */ disabled?: FeatureDisabled; /** * Information about an event that updates a feature. An `updated` event * is triggered for example by the * [Report Quota Usage](https://bo.wix.com/wix-docs/rest/premium/premium-features-manager/report-quota-usage) * and [Reset Usage Counter](https://bo.wix.com/wix-docs/rest/premium/premium-features-manager/reset-usage-counter) * endpoints. */ updated?: FeatureUpdated; /** * Information about an event that cancels a feature for the user. * Triggered for example, when a feature is canceled, transferred to * another account, or the user switched to a different contract. */ cancelled?: FeatureCancelled; /** * Information about a quota usage change for a feature. Triggered when * quota usage is reported via Report Quota Usage endpoint. Includes * before/after usage and remaining values. */ quotaUsageChanged?: FeatureQuotaUsageChanged; /** * Timestamp of the event in * [UTC time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time). */ timestamp?: Date | null; } /** @oneof */ interface FeatureEventEventOneOf { /** * Information about an event that makes a feature eligible to the user. * Triggered for example, for new features or when a feature is reassigned * to an account or a site. */ enabled?: FeatureEnabled; /** * Information about an event that disables a feature for the user. * Triggered for example, when a feature is unassigned from a site, * reassigned to a different site, or the user switched to a different contract. */ disabled?: FeatureDisabled; /** * Information about an event that updates a feature. An `updated` event * is triggered for example by the * [Report Quota Usage](https://bo.wix.com/wix-docs/rest/premium/premium-features-manager/report-quota-usage) * and [Reset Usage Counter](https://bo.wix.com/wix-docs/rest/premium/premium-features-manager/reset-usage-counter) * endpoints. */ updated?: FeatureUpdated; /** * Information about an event that cancels a feature for the user. * Triggered for example, when a feature is canceled, transferred to * another account, or the user switched to a different contract. */ cancelled?: FeatureCancelled; /** * Information about a quota usage change for a feature. Triggered when * quota usage is reported via Report Quota Usage endpoint. Includes * before/after usage and remaining values. */ quotaUsageChanged?: FeatureQuotaUsageChanged; } /** Feature created or enabled after disabled state */ interface FeatureEnabled extends FeatureEnabledReasonOneOf { /** Information about a transfer from another account. */ transferredFromAnotherAccount?: TransferredFromAnotherAccountReason; /** Information about a transfer from another site. */ reassignedFromSite?: ReassignedFromSiteReason; /** Information about a feature that hadn't been assigned to site. */ assignedFromFloating?: AssignedFromFloatingReason; /** Information about the new feature. */ newFeature?: NewFeatureReason; /** Information about the contract switch. */ contractSwitched?: ContractSwitchedReason; /** Information about the manually created features. */ manualFeatureCreation?: ManualFeatureCreationReason; /** Information about a feature that was migrated from legacy. */ migratedFromLegacy?: MigratedFromLegacyReason; /** Information about manual sync (e.g. immigrator task). */ manualSync?: ManualSyncReason; /** Enabled feature. */ feature?: Feature; /** * Information about a transfer from another account. * __Deprecated__. Use `reason.transferred_from_another_account` instead. * @format GUID */ transferredFromAccount?: string | null; /** * Information about a transfer from another site. * __Deprecated__. Use `reason.reassigned_from_site` instead. * @format GUID */ reassignedFromMetasite?: string | null; } /** @oneof */ interface FeatureEnabledReasonOneOf { /** Information about a transfer from another account. */ transferredFromAnotherAccount?: TransferredFromAnotherAccountReason; /** Information about a transfer from another site. */ reassignedFromSite?: ReassignedFromSiteReason; /** Information about a feature that hadn't been assigned to site. */ assignedFromFloating?: AssignedFromFloatingReason; /** Information about the new feature. */ newFeature?: NewFeatureReason; /** Information about the contract switch. */ contractSwitched?: ContractSwitchedReason; /** Information about the manually created features. */ manualFeatureCreation?: ManualFeatureCreationReason; /** Information about a feature that was migrated from legacy. */ migratedFromLegacy?: MigratedFromLegacyReason; /** Information about manual sync (e.g. immigrator task). */ manualSync?: ManualSyncReason; } interface Feature extends FeatureQuantityInfoOneOf { /** * Deprecated. Use `enabled` instead. * @deprecated */ booleanFeature?: BooleanFeature; /** * Deprecated. Use `quotaInfo` instead. * @deprecated */ quotaFeature?: QuotaFeature; /** * ID of the feature. __Note:__ Isn't unique. For example, all features that * are available to free Wix accounts or site in some capacity have * `{"id": "DEFAULT"}`. Use `uniqueName` as unique identifier for a feature. * @readonly */ _id?: string; /** * Unique name of the feature. Only lower case letters, numbers, and dashes * `-` are supported. Used in the endpoints of the * [Features Manager API](https://bo.wix.com/wix-docs/rest/premium/premium-features-manager/introduction) * to specify the feature. Not visible to customers. We recommend to start * the unique name with a prefix describing your organization or Wix company. * For example, `bookings` or `crm`. * * Min: 2 characters * Max: 50 characters * @minLength 2 * @maxLength 50 */ uniqueName?: string; /** * Information about whether the feature belongs to a Wix account or site. * Account features have `context.userId`. Site features have `context.metaSiteId` in case * they're assigned to a specific site. Site features that aren't assigned to * a specific site have neither ID. */ context?: FeatureContext; /** * Deprecated. * @readonly * @deprecated */ createdAt?: Date | null; /** * Deprecated. * @readonly * @deprecated */ updatedAt?: Date | null; /** * Aggregated information about how often customers can use the feature. * Available only for quota features. */ quotaInfo?: QuotaInfo; /** * Whether the customer is currently allowed to use the feature. * `true` means that the customer can use the feature. This means a boolean * feature is active or a quota feature has remaining usage. * `false` means that the customer can't use the feature. * This means a boolean feature isn't active or a quota feature doesn't * have remaining usage. */ enabled?: boolean; /** * ID of the [subscription](https://bo.wix.com/wix-docs/rest/premium/premium-subscriptions-manager/subscription-object) * to which the feature instance belongs. * @format GUID */ subscriptionId?: string | null; /** * Metadata of the feature. Wix Premium uses the metadata object to indicate * that customers who purchase a product with the feature also get * access to an additional product. For these bundled products `metadata` * looks like this: `{"tpa": "{"appDefId": "sample-app-def-id-1234567890", "vendorProductId": "sample-productId"}}"`. * But you can use the `metadata` property for other purposes, too. */ metadata?: Record; } /** @oneof */ interface FeatureQuantityInfoOneOf { /** * Deprecated. Use `enabled` instead. * @deprecated */ booleanFeature?: BooleanFeature; /** * Deprecated. Use `quotaInfo` instead. * @deprecated */ quotaFeature?: QuotaFeature; } /** * Context this feature is currently connected to. * Note: Do not confuse with feature scope which is configured in the product catalog * and defines in which context the product can be used */ interface FeatureContext { /** * ID of the Wix account that the feature instance belongs to. * Available for both site and account level feature instances. * @format GUID */ userId?: string; /** * ID of the meta site that the feature instance is assigned to. * Only available for site level feature instances that are assigned to a Wix * site. Not available for account level and unassigned site level feature * instances. * @format GUID */ metaSiteId?: string | null; } /** * A feature that can be either "enabled" or "disabled". The default/freemium setting is always OFF, and the premium setting is always ON (meaning, unlimited usage without tracking). * A boolean feature is similar to a quantitive feature with a default limit of 0 and UNLIMITED premium limit (although a bit simplified). */ interface BooleanFeature { } /** A feature with a periodic usage limitation. The default limit is defined in the Feature Spec, the Premium limits are defined in the respective ProductFeature. */ interface QuotaFeature { /** Default (or Freemium) quota limitation. if left undefined the free feature has unlimited amount. */ limit?: string | null; /** Periodic time-frame to reset the usage counter. You may use NO_PERIOD if counter shouldn't be reset. */ period?: FeaturePeriodWithLiterals; /** Usage measurement units (seconds? MBs? unitless?). Usage reported will be counted in multiples of this basic unit. */ units?: string | null; } /** Determines the reset cycle of the feature usage. */ declare enum FeaturePeriod { NO_PERIOD = "NO_PERIOD", MILLISECOND = "MILLISECOND", SECOND = "SECOND", MINUTE = "MINUTE", HOUR = "HOUR", DAY = "DAY", WEEK = "WEEK", MONTH = "MONTH", YEAR = "YEAR" } /** @enumType */ type FeaturePeriodWithLiterals = FeaturePeriod | 'NO_PERIOD' | 'MILLISECOND' | 'SECOND' | 'MINUTE' | 'HOUR' | 'DAY' | 'WEEK' | 'MONTH' | 'YEAR'; interface QuotaInfo { /** * Aggregation of how often the customer is allowed to use the feature at the time of the request. * `null` means that the customer has unlimited access to the feature. */ limit?: string | null; /** * Deprecated because a feature can have multiple periods defined. Use `period` in `breakdown` entries instead. * Time frame for the usage limitation. `NO_PERIOD` means that `remainingUsage` * isn't automatically reset to the feature's `limit` after a specific period. * You may still manually call * [Reset Usage Counter](https://bo.wix.com/wix-docs/rest/premium/premium-features-manager/reset-usage-counter). * @deprecated * @replacedBy breakdown.period * @targetRemovalDate 2026-03-31 */ period?: FeaturePeriodWithLiterals; /** * Aggregation of how often the customer has used the feature. * This value is retrieved from the Quota Manager/Rate Limiter system. If the * `exclude_quota_usage` field in the `ListFeaturesRequest` was set to `true`, * this field will contain the value `-1`. */ currentUsage?: string; /** * Aggregation of how often the customer can still use the feature. * `null` means that the customer has unlimited access to the feature. * This value is retrieved from the Quota Manager/Rate Limiter system. If the * `exclude_quota_usage` field in the `ListFeaturesRequest` was set to `true`, * this field will not be populated. */ remainingUsage?: string | null; /** * Breakdown of quota information entries, entry per feature instance. * @maxSize 1000 */ breakdown?: QuotaInfoEntry[]; } interface QuotaInfoEntry { /** * If quota is of free feature, the id would be empty (None). * If quota is of premium feature, this is the ID of the feature instance. * @format GUID */ featureInstanceId?: string | null; /** * How often the customer is allowed to use the feature during the specified * period. `null` means that the customer has unlimited access to the feature. */ limit?: string | null; /** * Time frame for the usage limitation. `NO_PERIOD` means that `remainingUsage` * isn't automatically reset to the feature's `limit` after a specific period. * You may still manually call * [Reset Usage Counter](https://bo.wix.com/wix-docs/rest/premium/premium-features-manager/reset-usage-counter). */ period?: FeaturePeriodWithLiterals; /** * How often the customer has used the feature during the current * period. * This value is retrieved from the Quota Manager/Rate Limiter system. If the * `exclude_quota_usage` field in the `ListFeaturesRequest` was set to `true`, * this field will contain the value `-1`. */ currentUsage?: string; /** * How often the customer can still use the feature during the current * period. `null` means that the customer has unlimited access to the feature. * This value is retrieved from the Quota Manager/Rate Limiter system. If the * `exclude_quota_usage` field in the `ListFeaturesRequest` was set to `true`, * this field will not be populated. */ remainingUsage?: string | null; /** * ID of the subscription to which the feature instance belongs. * @format GUID */ subscriptionId?: string | null; /** * Reset date of the quota. * Relevant only for features with a period that is not `NO_PERIOD`, and only for features that are managed by the Quota Manager system. */ resetDate?: Date | null; } /** Subscription transferred from another account, features on the current account were enabled. */ interface TransferredFromAnotherAccountReason { /** * Information about a transfer from another account. * @format GUID */ transferredFromAccount?: string; } /** Subscription moved from one site to another in the same account, features enabled on the target site */ interface ReassignedFromSiteReason { /** * Information about a transfer from another site. * @format GUID */ reassignedFromMetasite?: string; } /** Subscription was floating and assigned to site, features enabled on the target site */ interface AssignedFromFloatingReason { } /** New subscription created and features created as enabled */ interface NewFeatureReason { } /** Subscription was upgraded or downgraded, as a result new features enabled, missing features disabled , quantities are updated */ interface ContractSwitchedReason { /** Classification of the contract switch (upgrade, downgrade, or price increase) */ classification?: ContractSwitchClassificationWithLiterals; } /** * Classification of contract switch events for quota reset behavior * Needed to determine whether to reset usage and/or reset date for features affected by the contract switch. * For example, for an upgrade we want to reset both usage and date. * For a downgrade we want to keep the usage and date but update the limit, and for a price increase we want to reset the usage but keep the date. */ declare enum ContractSwitchClassification { /** Unknown or unclassified contract switch */ UNKNOWN = "UNKNOWN", /** Upgrade - reset usage, reset date, and update limit */ UPGRADE = "UPGRADE", /** Downgrade - only update limit (no reset) */ DOWNGRADE = "DOWNGRADE", /** Price increase - reset usage only (not reset date), update limit */ PRICE_INCREASE = "PRICE_INCREASE" } /** @enumType */ type ContractSwitchClassificationWithLiterals = ContractSwitchClassification | 'UNKNOWN' | 'UPGRADE' | 'DOWNGRADE' | 'PRICE_INCREASE'; /** a call to CreateFeature in features-writer, creates feature that is not attached to subscription */ interface ManualFeatureCreationReason { } /** Subscription created due to migration from old premium model */ interface MigratedFromLegacyReason { } /** Feature was synced manually, for example by immigrator task */ interface ManualSyncReason { /** * Optional description of the manual sync source (e.g. "immigrator", "quota-sync"). * @maxLength 100 */ source?: string | null; } /** Feature disabled and can be enabled in the future */ interface FeatureDisabled extends FeatureDisabledReasonOneOf { /** Information about a feature that's no longer assigned to a site. */ unassingedToFloating?: UnAssingedToFloatingReason; /** * Information about a feature that's been replaced by a feature from a * different subscription. */ replacedByAnotherSubscription?: ReplacedByAnotherSubscriptionReason; /** * Information about a feature that's been reassigned to a different * site. */ reassignedToAnotherSite?: ReassignedToAnotherSiteReason; /** * Disabled feature. Includes information about the feature's new state, * possibly its new context. */ feature?: Feature; /** * ID of the meta site for which the feature has been disabled. * @format GUID */ metaSiteId?: string | null; } /** @oneof */ interface FeatureDisabledReasonOneOf { /** Information about a feature that's no longer assigned to a site. */ unassingedToFloating?: UnAssingedToFloatingReason; /** * Information about a feature that's been replaced by a feature from a * different subscription. */ replacedByAnotherSubscription?: ReplacedByAnotherSubscriptionReason; /** * Information about a feature that's been reassigned to a different * site. */ reassignedToAnotherSite?: ReassignedToAnotherSiteReason; } /** Subscription was unassigned from the site and moved into floating state */ interface UnAssingedToFloatingReason { } /** Another subscription was assigned to the site, causing existing features on this site to be disabled */ interface ReplacedByAnotherSubscriptionReason { } /** Subscription was assigned to another site, causing features on the origin site to be disabled. */ interface ReassignedToAnotherSiteReason { /** * Information about a transfer to the site. * @format GUID */ reassignedToMetasite?: string; } /** Feature updated, for example Quota was increased due to upgrade */ interface FeatureUpdated extends FeatureUpdatedPreviousQuantityInfoOneOf, FeatureUpdatedReasonOneOf { /** Information about a feature that doesn't have a usage quota. */ booleanFeature?: BooleanFeature; /** Information about a feature that has a usage quota. */ quotaFeature?: QuotaFeature; /** Information about the contract switch. */ contractSwitched?: ContractSwitchedReason; /** Information about manual sync (e.g. immigrator task). */ manualSync?: ManualSyncReason; /** * Updated feature. Includes information about the feature's new state and * possibly its new context. */ feature?: Feature; } /** @oneof */ interface FeatureUpdatedPreviousQuantityInfoOneOf { /** Information about a feature that doesn't have a usage quota. */ booleanFeature?: BooleanFeature; /** Information about a feature that has a usage quota. */ quotaFeature?: QuotaFeature; } /** @oneof */ interface FeatureUpdatedReasonOneOf { /** Information about the contract switch. */ contractSwitched?: ContractSwitchedReason; /** Information about manual sync (e.g. immigrator task). */ manualSync?: ManualSyncReason; } /** Feature was permanently cancelled */ interface FeatureCancelled extends FeatureCancelledReasonOneOf { /** Information about a transfer to the account. */ transferredToAnotherAccount?: TransferredToAnotherAccountReason; /** Information about the contract switch. */ contractSwitched?: ContractSwitchedReason; /** Information about the feature cancellation. */ cancelRequest?: CancelRequestedReason; /** Information about manual sync (e.g. immigrator task). */ manualSync?: ManualSyncReason; /** Feature was automatically cancelled because its quota was fully consumed. */ quotaExhausted?: QuotaExhaustedReason; /** Canceled feature. */ feature?: Feature; /** * Information about a transfer to the account. * __Deprecated__. Use `reason.transferred_to_account` instead. * @format GUID */ transferredToAccount?: string | null; } /** @oneof */ interface FeatureCancelledReasonOneOf { /** Information about a transfer to the account. */ transferredToAnotherAccount?: TransferredToAnotherAccountReason; /** Information about the contract switch. */ contractSwitched?: ContractSwitchedReason; /** Information about the feature cancellation. */ cancelRequest?: CancelRequestedReason; /** Information about manual sync (e.g. immigrator task). */ manualSync?: ManualSyncReason; /** Feature was automatically cancelled because its quota was fully consumed. */ quotaExhausted?: QuotaExhaustedReason; } /** Subscription was transferred to another account, features in the origin account were cancelled */ interface TransferredToAnotherAccountReason { /** * Information about a transfer to the account. * @format GUID */ transferredToAccount?: string; } /** Cancellation was requested from the subscription manager api, might be a result of billing event, or direct call */ interface CancelRequestedReason { } /** Feature was automatically cancelled because its quota was fully consumed (e.g. topup feature) */ interface QuotaExhaustedReason { } /** Quota usage changed for a feature. */ interface FeatureQuotaUsageChanged { /** Full feature state before this quota usage report. */ featureBefore?: Feature; /** Full feature state after this quota usage report. */ featureAfter?: Feature; } interface Empty { } interface LoyaltyAppInstallation { type?: V1TypeWithLiterals; } declare enum V1Type { UNSPECIFIED = "UNSPECIFIED", INSTALLED = "INSTALLED", DELETED = "DELETED" } /** @enumType */ type V1TypeWithLiterals = V1Type | 'UNSPECIFIED' | 'INSTALLED' | 'DELETED'; 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 { entity?: string; } 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. */ currentEntity?: string; } interface EntityDeletedEvent { /** Entity that was deleted. */ deletedEntity?: string | null; } interface ActionEvent { body?: 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; } interface BaseEventMetadata { /** * App instance ID. * @format GUID */ instanceId?: string | null; /** * Event type. * @maxLength 150 */ eventType?: string; /** The identification type and identity data. */ identity?: IdentificationData; /** Details related to the account */ accountInfo?: AccountInfo; } interface EventMetadata extends BaseEventMetadata { /** 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; accountInfo?: AccountInfoMetadata; } interface AccountInfoMetadata { /** ID of the Wix account associated with the event */ accountId: string; /** ID of the Wix site associated with the event. Only included when the event is tied to a specific site. */ siteId?: string; /** ID of the parent Wix account. Only included when 'accountId' belongs to a child account. */ parentAccountId?: string; } interface ProgramUpdatedEnvelope { entity: LoyaltyProgram; metadata: EventMetadata; } /** * Triggered when a loyalty program is updated. * @permissionScope Read Loyalty * @permissionScopeId SCOPE.DC-LOYALTY.READ-LOYALTY * @permissionScope Manage Loyalty * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY * @permissionScope Manage Restaurants - all permissions * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES * @permissionId LOYALTY.READ_PROGRAM * @webhook * @eventType wix.loyalty.v1.program_updated * @serviceIdentifier com.wixpress.loyalty.program.LoyaltyPrograms * @slug updated */ declare function onProgramUpdated(handler: (event: ProgramUpdatedEnvelope) => void | Promise): void; /** * Retrieves the loyalty program. * @public * @permissionId LOYALTY.READ_PROGRAM * @applicableIdentity APP * @fqn com.wixpress.loyalty.program.LoyaltyPrograms.GetLoyaltyProgram */ declare function getLoyaltyProgram(): Promise>; /** * Retrieves loyalty programs for all metasites that the caller is a member of. * * Must be called with user identity. * @public * @permissionId LOYALTY.PROGRAM_BULK_READ * @fqn com.wixpress.loyalty.program.LoyaltyPrograms.BulkGetLoyaltyProgram */ declare function bulkGetLoyaltyProgram(): Promise>; /** * Updates a site's loyalty program. * * This method updates the name of the loyalty program and the details of the collectible points unit. * To activate the loyalty program, call Activate Loyalty Program. * @param loyaltyProgram - Loyalty program fields to update. * @public * @requiredField loyaltyProgram * @permissionId LOYALTY.MANAGE_PROGRAM * @applicableIdentity APP * @fqn com.wixpress.loyalty.program.LoyaltyPrograms.UpdateLoyaltyProgram */ declare function updateLoyaltyProgram(loyaltyProgram: LoyaltyProgram): Promise>; /** * Activates a loyalty program. * * Initially, when a loyalty program is installed, the status is set to `"DRAFT"`. * You can change the program's status to `"ACTIVE"` with this method or through the [dashboard](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Floyalty-accounts/wizard/). * A site's customers can only earn or redeem points while the program is `"ACTIVE"`. * * This method only updates the status of a loyalty program. To make other updates to the program, call Update Loyalty Program. * * To temporarily pause your loyalty program, call Pause Loyalty Program and see [Pausing Your Loyalty Program](https://support.wix.com/en/article/wix-loyalty-program-pausing-your-loyalty-program) for more information. * @public * @permissionId LOYALTY.MANAGE_PROGRAM * @applicableIdentity APP * @fqn com.wixpress.loyalty.program.LoyaltyPrograms.ActivateLoyaltyProgram */ declare function activateLoyaltyProgram(): Promise>; /** * Changes the program status to `"PAUSED"`. * * See [Pausing Your Loyalty Program](https://support.wix.com/en/article/wix-loyalty-program-pausing-your-loyalty-program) for more information. * @public * @permissionId LOYALTY.MANAGE_PROGRAM * @applicableIdentity APP * @fqn com.wixpress.loyalty.program.LoyaltyPrograms.PauseLoyaltyProgram */ declare function pauseLoyaltyProgram(): Promise>; /** * Retrieves information about the available loyalty program premium features. * @public * @permissionId LOYALTY.READ_PROGRAM * @applicableIdentity APP * @fqn com.wixpress.loyalty.program.LoyaltyPrograms.GetLoyaltyProgramPremiumFeatures */ declare function getLoyaltyProgramPremiumFeatures(): Promise>; /** * Updates the `pointsExpiration` status to `"ENABLED"`. * @public * @permissionId LOYALTY.MANAGE_PROGRAM * @applicableIdentity APP * @fqn com.wixpress.loyalty.program.LoyaltyPrograms.EnablePointsExpiration */ declare function enablePointsExpiration(): Promise>; /** * Updates the `pointsExpiration` status to `"DISABLED"`. * @public * @permissionId LOYALTY.MANAGE_PROGRAM * @applicableIdentity APP * @fqn com.wixpress.loyalty.program.LoyaltyPrograms.DisablePointsExpiration */ declare function disablePointsExpiration(): Promise>; export { type AccountInfo, type AccountInfoMetadata, type ActionEvent, type ActivateLoyaltyProgramRequest, type ActivateLoyaltyProgramResponse, type AssignedFromFloatingReason, type BaseEventMetadata, type BooleanFeature, type BulkGetLoyaltyProgramRequest, type BulkGetLoyaltyProgramResponse, type CancelRequestedReason, ContractSwitchClassification, type ContractSwitchClassificationWithLiterals, type ContractSwitchedReason, type DisablePointsExpirationRequest, type DisablePointsExpirationResponse, type DomainEvent, type DomainEventBodyOneOf, type Empty, type EnablePointsExpirationRequest, type EnablePointsExpirationResponse, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type Feature, type FeatureCancelled, type FeatureCancelledReasonOneOf, type FeatureContext, type FeatureDisabled, type FeatureDisabledReasonOneOf, type FeatureEnabled, type FeatureEnabledReasonOneOf, type FeatureEvent, type FeatureEventEventOneOf, FeaturePeriod, type FeaturePeriodWithLiterals, type FeatureQuantityInfoOneOf, type FeatureQuotaUsageChanged, type FeatureUpdated, type FeatureUpdatedPreviousQuantityInfoOneOf, type FeatureUpdatedReasonOneOf, type FocalPoint, type GetLoyaltyProgramDescriptionRequest, type GetLoyaltyProgramDescriptionResponse, type GetLoyaltyProgramPremiumFeaturesRequest, type GetLoyaltyProgramPremiumFeaturesResponse, type GetLoyaltyProgramRequest, type GetLoyaltyProgramResponse, type IdentificationData, type IdentificationDataIdOneOf, type LoyaltyAppInstallation, type LoyaltyProgram, type LoyaltyProgramActivated, type LoyaltyProgramDescriptionUpdated, type ManualFeatureCreationReason, type ManualSyncReason, type MessageEnvelope, type MigratedFromLegacyReason, type NewFeatureReason, type PauseLoyaltyProgramRequest, type PauseLoyaltyProgramResponse, type PointDefinition, type PointsExpiration, type PointsExpirationChanges, type PointsExpirationConfigurationChanged, type PointsExpirationDisabled, type PointsExpirationEnabled, type PremiumFeatures, type ProgramInSite, ProgramStatus, type ProgramStatusWithLiterals, type ProgramUpdatedEnvelope, type QuotaExhaustedReason, type QuotaFeature, type QuotaInfo, type QuotaInfoEntry, type ReassignedFromSiteReason, type ReassignedToAnotherSiteReason, type ReplacedByAnotherSubscriptionReason, type RestoreInfo, type SocialMediaChannel, type SocialMediaSettings, Status, type StatusWithLiterals, type TransferredFromAnotherAccountReason, type TransferredToAnotherAccountReason, Type, type TypeWithLiterals, type UnAssingedToFloatingReason, type UpdateLoyaltyProgramDescriptionRequest, type UpdateLoyaltyProgramDescriptionResponse, type UpdateLoyaltyProgramRequest, type UpdateLoyaltyProgramResponse, V1Type, type V1TypeWithLiterals, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, activateLoyaltyProgram, bulkGetLoyaltyProgram, disablePointsExpiration, enablePointsExpiration, getLoyaltyProgram, getLoyaltyProgramPremiumFeatures, onProgramUpdated, pauseLoyaltyProgram, updateLoyaltyProgram };