import { NonNullablePaths } from '@wix/sdk-types'; /** * A loyalty earning rule defines how customers earn points in a loyalty program. * You can create rules for different activities, such as making purchases. */ interface LoyaltyEarningRule extends LoyaltyEarningRuleTypeOneOf { /** Fixed amount of points awarded for each qualifying activity. */ fixedAmount?: FixedAmount; /** Points awarded based on a conversion rate formula: `(amount spent) / (money_amount * points)`. */ conversionRate?: ConversionRate; /** * Loyalty earning rule ID. * @format GUID * @readonly */ _id?: string | null; /** * ID of the app managing the earning rule. Can be a loyalty app ID or a Wix automations app ID. * @format GUID */ sourceAppId?: string; /** * ID of the app that triggers point assignment. Examples: Wix Stores, Wix Bookings, Wix Events. * @minLength 1 * @maxLength 80 */ triggerAppId?: string; /** * Type of activity that triggers point assignment. For example, `wix-restaurants/orderSubmitted` or `birthday`. * @minLength 1 * @maxLength 80 */ triggerActivityType?: string; /** * Name of the earning rule. * @minLength 1 * @maxLength 50 */ title?: string; /** Current status of the earning rule. */ status?: StatusWithLiterals; /** * Revision number, incremented by 1 each time the earning rule is updated. * Pass the latest `revision` when updating to prevent conflicting changes. */ revision?: string | null; /** * Date and time the earning rule was created. * @readonly */ _createdDate?: Date | null; /** * Date and time the earning rule was last updated. * @readonly */ _updatedDate?: Date | null; /** * Additional metadata about the earning rule. * @readonly */ metadata?: Metadata; /** * Trigger filters parsed from automation configuration. Only present for automation-based rules with filters. * @readonly * @maxSize 100 */ triggerFilters?: AutomationTriggerFilter[]; } /** @oneof */ interface LoyaltyEarningRuleTypeOneOf { /** Fixed amount of points awarded for each qualifying activity. */ fixedAmount?: FixedAmount; /** Points awarded based on a conversion rate formula: `(amount spent) / (money_amount * points)`. */ conversionRate?: ConversionRate; } /** Fixed amount type of earning rule. */ interface FixedAmount { /** * Fixed amount configurations for each tier. * @maxSize 21 */ configs?: FixedAmountConfig[]; } interface FixedAmountConfig { /** * Tier ID. If empty, the base tier is used. See the Tiers API for more information. * @format GUID * @readonly */ tierId?: string | null; /** Number of points to award. */ points?: number; } /** * Conversion rate type of earning rule. * Customers earn points based on the amount spent. * For example, for every $10 spent, a customer might earn 1 point. */ interface ConversionRate { /** * Conversion rate configurations for each tier. * * Points are awarded proportionally to the amount spent. * * Formula: `(amount spent) / (money_amount * points)`. * @maxSize 21 */ configs?: ConversionRateConfig[]; /** * Specifies which field in the Wix automations trigger payload [REST](https://dev.wix.com/docs/rest/business-management/automations/introduction#how-do-automations-work)|[SDK](https://dev.wix.com/docs/sdk/backend-modules/automations/triggered-events/reporting-and-canceling-events) to use for calculating points in conversion rate rules. * For example, if set to "priceSummary.totalAmount", the rule uses the total order amount to calculate loyalty points to be awarded. * This field is only applicable for automated earning rules. */ field?: string | null; } interface ConversionRateConfig { /** * Tier ID. If empty, the base tier is used. See the Tiers API for more information. * @format GUID * @readonly */ tierId?: string | null; /** * The amount of money used as a reference for point calculation. * Points are awarded proportionally to the amount spent. * * For example, if set to 10, 1 point is awarded for every 10 units of currency spent (assuming `points` is set to 1). * * Formula for points is: `(amount spent) / (money_amount * points)`. */ moneyAmount?: number; /** * Points given for the specified `money_amount`. * Works in conjunction with `money_amount` to define the earning rule. * * For example: If `money_amount` is 20 and `points` is 10: * - Spending 10 units of currency earns 5 points * - Spending 20 units of currency earns 10 points * - Spending 30 units of currency earns 15 points */ points?: number; } declare enum Status { /** Status is unknown or not specified. */ UNKNOWN = "UNKNOWN", /** Earning rule is active and can assign points. */ ACTIVE = "ACTIVE", /** Earning rule is paused and can't assign points. */ PAUSED = "PAUSED" } /** @enumType */ type StatusWithLiterals = Status | 'UNKNOWN' | 'ACTIVE' | 'PAUSED'; interface Metadata { /** Whether the earning rule can be deleted. */ canBeDeleted?: boolean; } interface LoyaltyEarningRuleTypeTag { /** Type of custom earning rule. */ ruleType?: LoyaltyEarningRuleTypeTagTypeWithLiterals; } declare enum LoyaltyEarningRuleTypeTagType { /** Type is unknown or not specified. */ UNKNOWN_TYPE = "UNKNOWN_TYPE", /** Earning rule for a customer's birthday. */ BIRTHDAY = "BIRTHDAY" } /** @enumType */ type LoyaltyEarningRuleTypeTagTypeWithLiterals = LoyaltyEarningRuleTypeTagType | 'UNKNOWN_TYPE' | 'BIRTHDAY'; interface AutomationTriggerFilter { /** * Key identifying the field in the trigger payload (e.g., "service_id", "eventId", "programId"). * @maxLength 110 */ fieldKey?: string; /** * Parsed entity IDs that the filter matches against. * @maxLength 256 * @maxSize 100 */ values?: string[]; } interface CacheInvalidated { } interface EarningRuleDisabled { } interface CreateLoyaltyEarningRuleRequest { /** Earning rule to create. */ earningRule: LoyaltyEarningRule; } interface CreateLoyaltyEarningRuleResponse { /** Created earning rule. */ earningRule?: LoyaltyEarningRule; } interface BulkCreateLoyaltyEarningRulesRequest { /** * Earning rules to create. * @minSize 1 * @maxSize 100 */ earningRules: LoyaltyEarningRule[]; } interface BulkCreateLoyaltyEarningRulesResponse { /** Created earning rules. */ results?: BulkLoyaltyEarningRuleResult[]; /** Additional metadata for the created earning rules. */ bulkActionMetadata?: BulkActionMetadata; } interface BulkLoyaltyEarningRuleResult { /** Additional metadata for the created earning rules. */ itemMetadata?: ItemMetadata; /** Created earning rule. */ item?: LoyaltyEarningRule; } interface ItemMetadata { /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */ _id?: string | null; /** Index of the item within the request array. Allows for correlation between request and response items. */ originalIndex?: number; /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */ success?: boolean; /** Details about the error in case of failure. */ error?: ApplicationError; } 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 CreateCustomLoyaltyEarningRuleRequest { /** Type of the custom earning rule. */ type: TypeWithLiterals; /** Custom earning rule to create. */ earningRule?: CustomLoyaltyEarningRule; } declare enum Type { /** Earning rule for social media. */ SOCIAL_MEDIA = "SOCIAL_MEDIA", /** Earning rule for birthdays. */ BIRTHDAY = "BIRTHDAY" } /** @enumType */ type TypeWithLiterals = Type | 'SOCIAL_MEDIA' | 'BIRTHDAY'; /** Used in CreateCustomLoyaltyEarningRuleRequest */ interface CustomLoyaltyEarningRule extends CustomLoyaltyEarningRuleTypeOneOf { /** Fixed amount of points awarded for each qualifying activity. */ fixedAmount?: FixedAmount; /** Points awarded based on a conversion rate formula: `(amount spent) / (money_amount * points)`. */ conversionRate?: ConversionRate; /** * Name of the earning rule. * @minLength 1 * @maxLength 50 */ title?: string; } /** @oneof */ interface CustomLoyaltyEarningRuleTypeOneOf { /** Fixed amount of points awarded for each qualifying activity. */ fixedAmount?: FixedAmount; /** Points awarded based on a conversion rate formula: `(amount spent) / (money_amount * points)`. */ conversionRate?: ConversionRate; } interface CreateCustomLoyaltyEarningRuleResponse { /** Created earning rule. */ earningRule?: LoyaltyEarningRule; } interface GetLoyaltyEarningRuleRequest { /** * ID of the earning rule to retrieve. * @format GUID */ _id: string; } interface GetLoyaltyEarningRuleResponse { /** Retrieved earning rule. */ earningRule?: LoyaltyEarningRule; } interface UpdateLoyaltyEarningRuleRequest { /** Earning rule to update. */ earningRule: LoyaltyEarningRule; } interface UpdateLoyaltyEarningRuleResponse { /** The updated earning rule. */ earningRule?: LoyaltyEarningRule; } interface DeleteLoyaltyEarningRuleRequest { /** * ID of the earning rule to delete. * @format GUID */ _id: string; /** * Revision of the earning rule. Incremented by 1 each time the earning rule is updated. * Pass the latest `revision` when updating to prevent conflicting changes. */ revision?: string; } interface DeleteLoyaltyEarningRuleResponse { } interface DeleteAutomationEarningRuleRequest { /** * ID of the earning rule to delete. * @format GUID */ _id: string; } interface DeleteAutomationEarningRuleResponse { } interface ListEarningRulesRequest { /** App ID that triggers the point assignment. For example, `9a5d83fd-8570-482e-81ab-cfa88942ee60`. */ triggerAppId?: string | null; /** Type of activity that triggers the point assignment. For example, `restaurants-order-is-pending`. */ triggerActivityType?: string | null; } interface ListEarningRulesResponse { /** Retrieved earning rules. */ earningRules?: LoyaltyEarningRule[]; } interface ListEarningRulesInTierRequest { /** * ID of the tier for which the earning rules will be returned. * @format GUID */ tierId?: string | null; /** Pagination options. */ paging?: CursorPaging; } interface CursorPaging { /** * Maximum number of items to return in the results. * @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 ListEarningRulesInTierResponse { /** Retrieved earning rules. */ earningRules?: LoyaltyEarningRule[]; /** Details on the paged set of results returned. */ pagingMetadata?: PagingMetadataV2; } interface PagingMetadataV2 { /** Number of items returned in the response. */ count?: number | null; /** Offset that was requested. */ offset?: number | null; /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */ total?: number | null; /** Flag that indicates the server failed to calculate the `total` field. */ tooManyToCount?: boolean | null; /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */ cursors?: Cursors; } 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 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 Empty { } interface InvalidateEarningRuleCacheRequest { } interface InvalidateEarningRuleCacheResponse { } interface AppInstallationInLoyaltySite { /** @format GUID */ appDefId?: string; type?: V1TypeWithLiterals; } declare enum V1Type { UNSPECIFIED = "UNSPECIFIED", INSTALLED = "INSTALLED", DELETED = "DELETED" } /** @enumType */ type V1TypeWithLiterals = V1Type | 'UNSPECIFIED' | 'INSTALLED' | 'DELETED'; 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 LoyaltyEarningRuleCreatedEnvelope { entity: LoyaltyEarningRule; metadata: EventMetadata; } /** * Triggered when an earning rule is created. * @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_EARNING_RULES * @webhook * @eventType wix.loyalty.v1.loyalty_earning_rule_created * @slug created */ declare function onLoyaltyEarningRuleCreated(handler: (event: LoyaltyEarningRuleCreatedEnvelope) => void | Promise): void; interface LoyaltyEarningRuleDeletedEnvelope { metadata: EventMetadata; } /** * Triggered when an earning rule is deleted. * @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_EARNING_RULES * @webhook * @eventType wix.loyalty.v1.loyalty_earning_rule_deleted * @slug deleted */ declare function onLoyaltyEarningRuleDeleted(handler: (event: LoyaltyEarningRuleDeletedEnvelope) => void | Promise): void; interface LoyaltyEarningRuleUpdatedEnvelope { entity: LoyaltyEarningRule; metadata: EventMetadata; } /** * Triggered when an earning rule 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_EARNING_RULES * @webhook * @eventType wix.loyalty.v1.loyalty_earning_rule_updated * @slug updated */ declare function onLoyaltyEarningRuleUpdated(handler: (event: LoyaltyEarningRuleUpdatedEnvelope) => void | Promise): void; /** * Creates a non-automated earning rule. * * >**Note**: You can only create non-automated earning rules from a supported list. * For the supported list of services, see the Introduction. * @param earningRule - Earning rule to create. * @public * @requiredField earningRule * @requiredField earningRule.sourceAppId * @requiredField earningRule.status * @requiredField earningRule.title * @requiredField earningRule.triggerActivityType * @requiredField earningRule.triggerAppId * @permissionId LOYALTY.MANAGE_EARNING_RULES * @applicableIdentity APP * @returns Created earning rule. * @fqn com.wixpress.loyalty.earningrule.LoyaltyEarningRules.CreateLoyaltyEarningRule */ declare function createLoyaltyEarningRule(earningRule: NonNullablePaths): Promise>; /** * Creates multiple non-automated earning rules. * * >**Note**: You can only create non-automated earning rules from a supported list. * For the supported list of services, see the Introduction. * @param earningRules - Earning rules to create. * @public * @requiredField earningRules * @requiredField earningRules.sourceAppId * @requiredField earningRules.status * @requiredField earningRules.title * @requiredField earningRules.triggerActivityType * @requiredField earningRules.triggerAppId * @permissionId LOYALTY.MANAGE_EARNING_RULES * @applicableIdentity APP * @fqn com.wixpress.loyalty.earningrule.LoyaltyEarningRules.BulkCreateLoyaltyEarningRules */ declare function bulkCreateLoyaltyEarningRules(earningRules: NonNullablePaths[]): Promise>; /** * Creates a custom automated earning rule. * * To learn more about the automated rules, see the Introduction. * @param type - Type of the custom earning rule. * @public * @requiredField type * @permissionId LOYALTY.MANAGE_EARNING_RULES * @applicableIdentity APP * @fqn com.wixpress.loyalty.earningrule.LoyaltyEarningRules.CreateCustomLoyaltyEarningRule */ declare function createCustomLoyaltyEarningRule(type: TypeWithLiterals, options?: CreateCustomLoyaltyEarningRuleOptions): Promise>; interface CreateCustomLoyaltyEarningRuleOptions { /** Custom earning rule to create. */ earningRule?: CustomLoyaltyEarningRule; } /** * Retrieves a specified non-automated earning rule. * * To retrieve both automated and non-automated earning rules, call List Earning Rules. * @param _id - ID of the earning rule to retrieve. * @public * @requiredField _id * @permissionId LOYALTY.READ_EARNING_RULES * @applicableIdentity APP * @returns Retrieved earning rule. * @fqn com.wixpress.loyalty.earningrule.LoyaltyEarningRules.GetLoyaltyEarningRule */ declare function getLoyaltyEarningRule(_id: string): Promise>; /** * Updates an earning rule. * * Supports partial updates. * * Revision number, which increments by 1 each time the earning rule is updated. To prevent conflicting changes, * the current `revision` must be passed when updating the earning rule. * @param _id - Loyalty earning rule ID. * @public * @requiredField _id * @requiredField earningRule * @permissionId LOYALTY.MANAGE_EARNING_RULES * @applicableIdentity APP * @fqn com.wixpress.loyalty.earningrule.LoyaltyEarningRules.UpdateLoyaltyEarningRule */ declare function updateLoyaltyEarningRule(_id: string, earningRule: UpdateLoyaltyEarningRule): Promise>; interface UpdateLoyaltyEarningRule { /** Fixed amount of points awarded for each qualifying activity. */ fixedAmount?: FixedAmount; /** Points awarded based on a conversion rate formula: `(amount spent) / (money_amount * points)`. */ conversionRate?: ConversionRate; /** * Loyalty earning rule ID. * @format GUID * @readonly */ _id?: string | null; /** * ID of the app managing the earning rule. Can be a loyalty app ID or a Wix automations app ID. * @format GUID */ sourceAppId?: string; /** * ID of the app that triggers point assignment. Examples: Wix Stores, Wix Bookings, Wix Events. * @minLength 1 * @maxLength 80 */ triggerAppId?: string; /** * Type of activity that triggers point assignment. For example, `wix-restaurants/orderSubmitted` or `birthday`. * @minLength 1 * @maxLength 80 */ triggerActivityType?: string; /** * Name of the earning rule. * @minLength 1 * @maxLength 50 */ title?: string; /** Current status of the earning rule. */ status?: StatusWithLiterals; /** * Revision number, incremented by 1 each time the earning rule is updated. * Pass the latest `revision` when updating to prevent conflicting changes. */ revision?: string | null; /** * Date and time the earning rule was created. * @readonly */ _createdDate?: Date | null; /** * Date and time the earning rule was last updated. * @readonly */ _updatedDate?: Date | null; /** * Additional metadata about the earning rule. * @readonly */ metadata?: Metadata; /** * Trigger filters parsed from automation configuration. Only present for automation-based rules with filters. * @readonly * @maxSize 100 */ triggerFilters?: AutomationTriggerFilter[]; } /** * Deletes a non-automated earning rule. * * To delete an automated earning rule, call * Delete Automation Earning Rule. * * To update an earning rule's status instead of deleting it, call * Update Loyalty Earning Rule. * @param _id - ID of the earning rule to delete. * @public * @requiredField _id * @permissionId LOYALTY.MANAGE_EARNING_RULES * @applicableIdentity APP * @fqn com.wixpress.loyalty.earningrule.LoyaltyEarningRules.DeleteLoyaltyEarningRule */ declare function deleteLoyaltyEarningRule(_id: string, options?: DeleteLoyaltyEarningRuleOptions): Promise; interface DeleteLoyaltyEarningRuleOptions { /** * Revision of the earning rule. Incremented by 1 each time the earning rule is updated. * Pass the latest `revision` when updating to prevent conflicting changes. */ revision?: string; } /** * Deletes a custom automated earning rule. * Pre-installed automated rules can only be paused, not deleted. * * To update an earning rule's status instead of deleting it, call * Update Loyalty Earning Rule. * * To delete a non-automated earning rule, call * Delete Loyalty Earning Rule. * @param _id - ID of the earning rule to delete. * @public * @requiredField _id * @permissionId LOYALTY.MANAGE_EARNING_RULES * @applicableIdentity APP * @fqn com.wixpress.loyalty.earningrule.LoyaltyEarningRules.DeleteAutomationEarningRule */ declare function deleteAutomationEarningRule(_id: string): Promise; /** * Retrieves a list of earning rules. * * Returns both automated and non-automated earning rules. * * You can filter the results by `triggerAppId` or `triggerActivityType`. * @public * @permissionId LOYALTY.READ_EARNING_RULES * @applicableIdentity APP * @fqn com.wixpress.loyalty.earningrule.LoyaltyEarningRules.ListEarningRules */ declare function listEarningRules(options?: ListEarningRulesOptions): Promise>; interface ListEarningRulesOptions { /** App ID that triggers the point assignment. For example, `9a5d83fd-8570-482e-81ab-cfa88942ee60`. */ triggerAppId?: string | null; /** Type of activity that triggers the point assignment. For example, `restaurants-order-is-pending`. */ triggerActivityType?: string | null; } export { type AccountInfo, type AccountInfoMetadata, type ActionEvent, type AppInstallationInLoyaltySite, type ApplicationError, type AutomationTriggerFilter, type BaseEventMetadata, type BulkActionMetadata, type BulkCreateLoyaltyEarningRulesRequest, type BulkCreateLoyaltyEarningRulesResponse, type BulkLoyaltyEarningRuleResult, type CacheInvalidated, type ConversionRate, type ConversionRateConfig, type CreateCustomLoyaltyEarningRuleOptions, type CreateCustomLoyaltyEarningRuleRequest, type CreateCustomLoyaltyEarningRuleResponse, type CreateLoyaltyEarningRuleRequest, type CreateLoyaltyEarningRuleResponse, type CursorPaging, type Cursors, type CustomLoyaltyEarningRule, type CustomLoyaltyEarningRuleTypeOneOf, type DeleteAutomationEarningRuleRequest, type DeleteAutomationEarningRuleResponse, type DeleteLoyaltyEarningRuleOptions, type DeleteLoyaltyEarningRuleRequest, type DeleteLoyaltyEarningRuleResponse, type DomainEvent, type DomainEventBodyOneOf, type EarningRuleDisabled, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type FixedAmount, type FixedAmountConfig, type GetLoyaltyEarningRuleRequest, type GetLoyaltyEarningRuleResponse, type IdentificationData, type IdentificationDataIdOneOf, type InvalidateEarningRuleCacheRequest, type InvalidateEarningRuleCacheResponse, type ItemMetadata, type ListEarningRulesInTierRequest, type ListEarningRulesInTierResponse, type ListEarningRulesOptions, type ListEarningRulesRequest, type ListEarningRulesResponse, type LoyaltyEarningRule, type LoyaltyEarningRuleCreatedEnvelope, type LoyaltyEarningRuleDeletedEnvelope, type LoyaltyEarningRuleTypeOneOf, type LoyaltyEarningRuleTypeTag, LoyaltyEarningRuleTypeTagType, type LoyaltyEarningRuleTypeTagTypeWithLiterals, type LoyaltyEarningRuleUpdatedEnvelope, type MessageEnvelope, type Metadata, type PagingMetadataV2, type RestoreInfo, Status, type StatusWithLiterals, Type, type TypeWithLiterals, type UpdateLoyaltyEarningRule, type UpdateLoyaltyEarningRuleRequest, type UpdateLoyaltyEarningRuleResponse, V1Type, type V1TypeWithLiterals, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, bulkCreateLoyaltyEarningRules, createCustomLoyaltyEarningRule, createLoyaltyEarningRule, deleteAutomationEarningRule, deleteLoyaltyEarningRule, getLoyaltyEarningRule, listEarningRules, onLoyaltyEarningRuleCreated, onLoyaltyEarningRuleDeleted, onLoyaltyEarningRuleUpdated, updateLoyaltyEarningRule };