Introduction

The Earning Rules API allows you to manage earning rules for your loyalty program. Earning rules define how customers earn points through various activities, such as making purchases or registering for events.

With the Earning Rules API, you can:

For more information about managing loyalty programs, see the Loyalty API. To learn more about earning rules, see Managing Your Loyalty Program.

Earning Rules and Points Calculation

An earning rule defines how customers receive loyalty points for specific actions they take on your site, such as making a purchase or booking an appointment. Customers accumulate these loyalty points and can later exchange them for rewards like discounts or free shipping at checkout.

Earning rules use two methods to calculate loyalty points:

  • Fixed amount: Awards a set number of points for a specific action. Example: A customer receives 10 points for purchasing a ticket through Wix Events.

  • Conversion rate: Awards points based on a ratio of money spent to points earned. Example: A customer receives 2 points for every $1 spent in your online store.

    The formula is: points awarded = (amount spent / moneyAmount) * points per unit.

    For a $100 purchase with 2 points awarded per $1 spent: points awarded = (100 / 1) * 2 = 200 points

Once customers accumulate loyalty points, they can redeem them for various rewards during the checkout process. For example, exchanging 500 points for a 10% discount on their purchase.

Types of earning rules

The Wix Loyalty program supports two types of earning rules:

  • Non-automated earning rules.
  • Automated earning rules.

Both types allow customers to earn points for various actions, but differ in their flexibility and customization options:

  • Non-automated earning rules are limited to a fixed set of supported rules (see tables below) based on installed Wix business solutions.
  • Automated earning rules, powered by Wix Automations, allow for unlimited custom earning rule creation.

We recommend creating automated earning rules using the Wix Automations API for maximum flexibility and customization options.

Automated earning rules

Automated earning rules are managed by Wix Automations, a system that enables custom workflows across Wix apps. These rules offer more flexibility and can be triggered by a wide range of events.

There are two subtypes of automated earning rules:

  • Pre-installed rules.
  • Custom rules.

Pre-installed rules

Pre-installed rules come automatically when certain business solutions are installed. These rules can be paused but not deleted.

Supported pre-installed earning rules:

Earning Rule NameTriggerPoint award method
Order a plan (Wix Pricing Plans)wix_pricing_plans-plan_purchasedFixed amount, Conversion rate
Place a restaurant order (Old Wix Restaurants)wix_restaurants_orders-order_submittedConversion rate only
Place a restaurant order (New Wix Restaurants)restaurants-order-is-pendingConversion rate only

Custom rules

Custom rules are created by site owners and don't come pre-installed. Automated earning rules not listed above fall into this category.

For example, if Wix Bookings is installed, you can create a custom automated earning rule that is triggered when a customer books a session.

Non-automated earning rules

Non-automated earning rules can be created based on installed Wix business solutions. These rules are identified by their sourceAppId, which is the Loyalty app ID for non-automated rules.

Supported non-automated earning rules:

Earning Rule NameTriggerPoint award method
Purchase a product (Wix Stores)stores/OrderPaidFixed amount, Conversion rate
Book a session (Wix Bookings)bookings/BookingConfirmedFixed amount only
Buy a ticket (Wix Events)events/OrderConfirmedFixed amount, Conversion rate
RSVP to an event (Wix Events)events/RsvpFixed amount only

For example, if Wix Events is installed, two types of earning rules can be created:

  • A rule that awards points when a customer buys a ticket (triggered by events/OrderConfirmed).
  • A rule that awards points when a customer RSVPs to a free event (triggered by events/Rsvp).

These non-automated rules provide a way to set up basic loyalty rewards without the Wix automations setup. They are useful for implementing a straightforward points system based on common customer actions within Wix apps.

Wix Automations and Earning Rules

Automated earning rules are powered by Wix Automations, a system that enables custom workflows across Wix apps.

Wix Automations are built on two key concepts:

  • Triggers: Events that initiate automations.
  • Actions: Responses to triggers.

To create and manage automated earning rules, you'll use the Wix Automations API. This API allows you to define custom triggers, implement action logic, and activate automations.

For more information on working with Wix Automations, see the Automations API Introduction.

Terminology

  • Earning rule: A condition that, when met, awards loyalty points to a customer. All earning rules allow customers to earn points for performing certain actions.
  • Non-Automated earning rule: An earning rule set up for specific business solutions, identified by its sourceAppId.
  • Automated earning rule: An earning rule powered by Wix Automations, which can be pre-installed or custom:
    • Pre-installed: An automated earning rule that comes by default with certain services, which can be paused but not deleted.
    • Custom: An automated earning rule created by the site owner that is not pre-installed by default. Custom rules can be deleted.
  • Fixed amount: An earning rule type where a set number of points is awarded for a specific action. For example, a customer might receive 10 points for purchasing a ticket through Wix Events.
  • Conversion rate: An earning rule type where points are awarded based on a ratio of money spent to points earned. The formula is: points awarded = (amount spent / moneyAmount) * points per unit.
  • Trigger app ID: The ID of the app that initiates the point assignment. For example: Stores, Bookings, Events.
  • Trigger activity type: The specific action that triggers point assignment. For example: auth/register, events/OrderConfirmed.
  • Source app ID: The ID of the app managing the rule. This field indicates whether an earning rule is automated or non-automated. If the sourceAppId is the Loyalty app ID, it's a non-automated earning rule. If it's the Wix Automations app ID, it's an automated earning rule.
  • Tier: A tier is a loyalty level that customers are assigned to based on the number of points they earn. Customers in different tiers may earn points at different rates for the same activity. For example, a higher tier member might earn more points per purchase than a lower tier member.
  • Status: The current state of an earning rule (for example, ACTIVE, PAUSED).
Did this help?

Loyalty Earning Rule Object


A loyalty earning rule defines how customers earn points in a loyalty program. You can create rules for different activities, such as making purchases.

Properties
idstringRead-onlyformat GUID

Loyalty earning rule ID.


sourceAppIdstringformat GUID

ID of the app managing the earning rule. Can be a loyalty app ID or a Wix automations app ID.


triggerAppIdstringminLength 1maxLength 80

ID of the app that triggers point assignment. Examples: Wix Stores, Wix Bookings, Wix Events.


triggerActivityTypestringminLength 1maxLength 80

Type of activity that triggers point assignment. For example, wix-restaurants/orderSubmitted or birthday.


titlestringminLength 1maxLength 50

Name of the earning rule.


statusstring

Current status of the earning rule.


revisionintegerformat uint64

Revision number, incremented by 1 each time the earning rule is updated. Pass the latest revision when updating to prevent conflicting changes.


createdDatestringRead-onlyformat date-time

Date and time the earning rule was created.


updatedDatestringRead-onlyformat date-time

Date and time the earning rule was last updated.


metadataMetadataRead-only

Additional metadata about the earning rule.


ONE OF:

fixedAmountFixedAmount

Fixed amount of points awarded for each qualifying activity.


conversionRateConversionRate

Points awarded based on a conversion rate formula: (amount spent) / (money_amount * points).

LoyaltyEarningRule
JSON
{ "id": "61f971c4-b33b-4f39-8ebe-2677bce55789", "source_app_id": "139ef4fa-c108-8f9a-c7be-d5f492a2c939", "trigger_app_id": "eb377299-86b4-4a86-a1b5-774a2d1d374b", "trigger_activity_type": "wix_members-uou_signs_up", "title": "Sign up to the site", "status": "ACTIVE", "revision": null, "created_date": "2024-08-01T11:51:41.431Z", "updated_date": "2024-09-16T12:03:00.434Z", "metadata": { "can_be_deleted": false }, "fixed_amount": { "points": 50, "configs": [ { "tier_id": null, "points": 50 } ] } }
Did this help?

POST

Create Loyalty Earning Rule


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.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Loyalty
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/_api/loyalty-earning-rules/v1/earning-rules

Body Params
earningRuleEarningRuleRequired

Earning rule to create.

Response Object
earningRuleEarningRule

Created earning rule.

Create earning rule
Request
cURL
curl -X POST \ 'https://www.wixapis.com/loyalty-earning-rules/v1/earning-rules' \ -H 'Authorization: <AUTH>' \ -H 'Content-Type: application/json' \ -d '{ "earningRule": { "sourceAppId": "553c79f3-5625-4f38-b14b-ef7c0d1e87df", "triggerAppId": "1380b703-ce81-ff05-f115-39571d94dfcd", "triggerActivityType": "stores/OrderPaid", "title": "Purchase a product", "status": "ACTIVE", "conversionRate": { "configs": [ { "points": 20, "moneyAmount": 1 } ] } } }'
Response
JSON
{ "earningRule": { "id": "b690f925-8527-4d5e-b358-4b0adcb275b5", "sourceAppId": "553c79f3-5625-4f38-b14b-ef7c0d1e87df", "triggerAppId": "1380b703-ce81-ff05-f115-39571d94dfcd", "triggerActivityType": "stores/OrderPaid", "title": "Purchase a product", "conversionRate": { "moneyAmount": 1, "points": 20, "configs": [ { "moneyAmount": 1, "points": 20 } ] }, "status": "ACTIVE", "revision": "1", "createdDate": "2024-09-16T12:06:39.294Z", "updatedDate": "2024-09-16T12:06:39.294Z", "metadata": { "canBeDeleted": true } } }
Did this help?

POST

Bulk Create Loyalty Earning Rules


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.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Loyalty
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/_api/loyalty-earning-rules/v1/bulk/earning-rules/create

Body Params
earningRulesArray <LoyaltyEarningRule>RequiredminItems 1maxItems 100

Earning rules to create.

Response Object
resultsArray <BulkLoyaltyEarningRuleResult>

Created earning rules.


bulkActionMetadataBulkActionMetadata

Additional metadata for the created earning rules.

Bulk create earning rules
Request
cURL
curl -X POST \ 'https://www.wixapis.com/loyalty-earning-rules/v1/bulk/earning-rules/create' \ -H 'Authorization: <AUTH>' \ -H 'Content-Type: application/json' \ -d '{ "earningRules": [ { "sourceAppId": "553c79f3-5625-4f38-b14b-ef7c0d1e87df", "triggerAppId": "1380b703-ce81-ff05-f115-39571d94dfcd", "triggerActivityType": "stores/OrderPaid", "title": "Purchase a product", "status": "ACTIVE", "conversionRate": { "configs": [ { "points": 20, "moneyAmount": 1 } ] } } ] }'
Response
JSON
{ "results": [ { "itemMetadata": { "id": "eeb9ff42-b24f-4a68-8491-21507508f3f5", "originalIndex": 0, "success": true }, "item": { "id": "eeb9ff42-b24f-4a68-8491-21507508f3f5", "sourceAppId": "553c79f3-5625-4f38-b14b-ef7c0d1e87df", "triggerAppId": "1380b703-ce81-ff05-f115-39571d94dfcd", "triggerActivityType": "stores/OrderPaid", "title": "Purchase a product", "conversionRate": { "moneyAmount": 1, "points": 20, "configs": [ { "moneyAmount": 1, "points": 20 } ] }, "status": "ACTIVE", "revision": "1", "createdDate": "2024-09-16T12:12:16.833Z", "updatedDate": "2024-09-16T12:12:16.833Z", "metadata": { "canBeDeleted": true } } } ], "bulkActionMetadata": { "totalSuccesses": 1, "totalFailures": 0, "undetailedFailures": 0 } }
Did this help?

POST

Create Custom Loyalty Earning Rule


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Creates a custom automated earning rule.

Currently, only social media earning rule is supported.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Loyalty
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/_api/loyalty-earning-rules/v1/earning-rules/custom

Body Params
typestringRequired

Type of the custom earning rule.


earningRuleEarningRule

Custom earning rule to create.

Response Object
earningRuleEarningRule

Created earning rule.

Did this help?

GET

Get Loyalty Earning Rule


Retrieves a specified non-automated earning rule.

To retrieve both automated and non-automated earning rules, use List Earning Rules.

Permissions
Manage Loyalty
Read Loyalty
Learn more about app permissions.
Endpoint
GET
https://www.wixapis.com/_api/loyalty-earning-rules/v1/earning-rules/{id}

Path Params
idstringRequired

ID of the earning rule to retrieve.

Response Object
earningRuleEarningRule

Retrieved earning rule.

Get earning rule
Request
cURL
curl -X GET \ 'https://www.wixapis.com/loyalty-earning-rules/v1/earning-rules/eeb9ff42-b24f-4a68-8491-21507508f3f5' \ -H 'Authorization: <AUTH>' \ -H 'Content-Type: application/json'
Response
JSON
{ "earningRule": { "id": "eeb9ff42-b24f-4a68-8491-21507508f3f5", "sourceAppId": "553c79f3-5625-4f38-b14b-ef7c0d1e87df", "triggerAppId": "1380b703-ce81-ff05-f115-39571d94dfcd", "triggerActivityType": "stores/OrderPaid", "title": "Purchase a product", "conversionRate": { "moneyAmount": 1, "points": 20, "configs": [ { "moneyAmount": 1, "points": 20 } ] }, "status": "ACTIVE", "revision": "1", "createdDate": "2024-09-16T12:12:16.833Z", "updatedDate": "2024-09-16T12:12:16.833Z", "metadata": { "canBeDeleted": true } } }
Did this help?

DELETE

Delete Loyalty Earning Rule


Deletes a non-automated earning rule.

To delete an automated earning rule, use Delete Automation Earning Rule.

To update an earning rule's status instead of deleting it, use Update Loyalty Earning Rule.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Loyalty
Learn more about app permissions.
Endpoint
DELETE
https://www.wixapis.com/_api/loyalty-earning-rules/v1/earning-rules/{id}

Path Params
idstringRequired

ID of the earning rule to delete.

Query Params
revisionnumber

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.

Response Object
Returns an empty object.
Delete earning rule
Request
cURL
curl -X DELETE \ 'https://www.wixapis.com/loyalty-earning-rules/v1/earning-rules/eeb9ff42-b24f-4a68-8491-21507508f3f5?revision=2' \ -H 'Authorization: <AUTH>' \ -H 'Content-Type: application/json'
Response
JSON
{}
Did this help?

DELETE

Delete Automation Earning Rule


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, use Update Loyalty Earning Rule.

To delete a non-automated earning rule, use Delete Loyalty Earning Rule.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Loyalty
Learn more about app permissions.
Endpoint
DELETE
https://www.wixapis.com/_api/loyalty-earning-rules/v1/automation-earning-rules/{id}

Path Params
idstringRequired

ID of the earning rule to delete.

Response Object
Returns an empty object.
Delete automation earning rule
Request
cURL
curl -X DELETE \ 'https://www.wixapis.com/loyalty-earning-rules/v1/automation-earning-rules/61f971c4-b33b-4f39-8ebe-2677bce55789' \ -H 'Authorization: <AUTH>' \ -H 'Content-Type: application/json'
Response
JSON
{}
Did this help?

PUT

Update Loyalty Earning Rule


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.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Loyalty
Learn more about app permissions.
Endpoint
PUT
https://www.wixapis.com/_api/loyalty-earning-rules/v1/earning-rules/{earningRule.id}

Path Params
earningRule.idstringRequired

Loyalty earning rule ID.

Body Params
earningRuleEarningRuleRequired

Earning rule to update.

Response Object
earningRuleEarningRule

The updated earning rule.

Update earning rule
Request
cURL
curl -X PUT \ 'https://www.wixapis.com/loyalty-earning-rules/v1/earning-rules/eeb9ff42-b24f-4a68-8491-21507508f3f5' \ -H 'Authorization: <AUTH>' \ -H 'Content-Type: application/json' \ -d '{ "earningRule": { "sourceAppId": "553c79f3-5625-4f38-b14b-ef7c0d1e87df", "triggerAppId": "1380b703-ce81-ff05-f115-39571d94dfcd", "triggerActivityType": "stores/OrderPaid", "title": "Purchase a product", "status": "ACTIVE", "conversionRate": { "configs": [ { "points": 20, "moneyAmount": 1 } ] }, "revision": 1 } }'
Response
JSON
{ "earningRule": { "id": "eeb9ff42-b24f-4a68-8491-21507508f3f5", "sourceAppId": "553c79f3-5625-4f38-b14b-ef7c0d1e87df", "triggerAppId": "1380b703-ce81-ff05-f115-39571d94dfcd", "triggerActivityType": "stores/OrderPaid", "title": "Purchase a product", "conversionRate": { "moneyAmount": 1, "points": 20, "configs": [ { "moneyAmount": 1, "points": 20 } ] }, "status": "ACTIVE", "revision": "2", "createdDate": "2024-09-16T12:12:16.833Z", "updatedDate": "2024-09-16T14:02:59.364Z", "metadata": { "canBeDeleted": true } } }
Did this help?

GET

List Earning Rules


Retrieves a list of earning rules.

Returns both automated and non-automated earning rules.

You can filter the results by triggerAppId or triggerActivityType.

Permissions
Manage Loyalty
Read Loyalty
Learn more about app permissions.
Endpoint
GET
https://www.wixapis.com/_api/loyalty-earning-rules/v1/earning-rules/rules

Query Params
triggerAppIdstring

App ID that triggers the point assignment. For example, 9a5d83fd-8570-482e-81ab-cfa88942ee60.


triggerActivityTypestring

Type of activity that triggers the point assignment. For example, restaurants-order-is-pending.

Response Object
earningRulesArray <LoyaltyEarningRule>

Retrieved earning rules.

List earning rules
Request
cURL
curl -X GET \ 'https://www.wixapis.com/loyalty-earning-rules/v1/earning-rules/rules' \ -H 'Authorization: <AUTH>' \ -H 'Content-Type: application/json'
Response
JSON
{ "earningRules": [ { "id": "eeb9ff42-b24f-4a68-8491-21507508f3f5", "sourceAppId": "553c79f3-5625-4f38-b14b-ef7c0d1e87df", "triggerAppId": "1380b703-ce81-ff05-f115-39571d94dfcd", "triggerActivityType": "stores/OrderPaid", "title": "Purchase a product", "conversionRate": { "moneyAmount": 1, "points": 20, "configs": [ { "moneyAmount": 1, "points": 20 } ] }, "status": "ACTIVE", "revision": "1", "createdDate": "2024-09-16T12:12:16.833Z", "updatedDate": "2024-09-16T12:12:16.833Z", "metadata": { "canBeDeleted": true } } ] }
Did this help?

Loyalty Earning Rule Created


Triggered when an earning rule is created.

Permissions
Manage Loyalty
Read Loyalty
Learn more about app permissions.
Event BodyEvent Body Event data is received as a JSON Web Token (JWT). It may be delayed. Be sure to verify the data was sent by Wix.
Event Data
idstring

Unique event ID. Allows clients to ignore duplicate webhooks.


entityFqdnstring

Fully qualified domain name of the entity associated with the event. Expected wix.loyalty.v1.loyalty_earning_rule.


slugstring

Event name. Expected created.


entityIdstring

ID of the entity associated with the event.


eventTimestringformat date-time

Event timestamp.


triggeredByAnonymizeRequestboolean

Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).


originatedFromstring

If present, indicates the action that triggered the event.


createdEventCreatedEvent

Event information.

Event Body

The data payload will include the following as an encoded JWT:

JSON
{ "data": { "eventType": "wix.loyalty.v1.loyalty_earning_rule_created", "instanceId": "<app-instance-id>", "data": "<stringified-JSON>", // The identity field is sent as a stringified JSON "identity": { "identityType": "<identityType>", // ANONYMOUS_VISITOR, MEMBER, WIX_USER, APP "anonymousVisitorId": "<anonymousVisitorId>", // in case of ANONYMOUS_VISITOR "memberId": "<memberId>", // in case of MEMBER "wixUserId": "<wixUserId>", // in case of WIX_USER "appId": "<appId>" // in case of APP } } }

LoyaltyEarningRuleCreated
JSON
{ "id": "79e98s2a-d8j4-4a3b-a62f-7393757bab84", "entityFqdn": "wix.loyalty.v1.loyalty_earning_rule", "slug": "created", "entityId": "5bf5cb44-87rt-4933-1234-1d8423636a74", "createdEvent": { "entity": { "id": "b690f925-8527-4d5e-b358-4b0adcb275b5", "sourceAppId": "553c79f3-5625-4f38-b14b-ef7c0d1e87df", "triggerAppId": "1380b703-ce81-ff05-f115-39571d94dfcd", "triggerActivityType": "stores/OrderPaid", "title": "Purchase a product", "conversionRate": { "moneyAmount": 1, "points": 20, "configs": [ { "moneyAmount": 1, "points": 20 } ] }, "status": "ACTIVE", "revision": "1", "createdDate": "2024-09-16T12:06:39.294Z", "updatedDate": "2024-09-16T12:06:39.294Z", "metadata": { "canBeDeleted": true } } }, "eventTime": "2023-09-11T14:58:22.481838Z", "triggeredByAnonymizeRequest": false, "entityEventSequence": "1" }
Did this help?

Loyalty Earning Rule Updated


Triggered when an earning rule is updated.

Permissions
Manage Loyalty
Read Loyalty
Learn more about app permissions.
Event BodyEvent Body Event data is received as a JSON Web Token (JWT). It may be delayed. Be sure to verify the data was sent by Wix.
Event Data
idstring

Unique event ID. Allows clients to ignore duplicate webhooks.


entityFqdnstring

Fully qualified domain name of the entity associated with the event. Expected wix.loyalty.v1.loyalty_earning_rule.


slugstring

Event name. Expected updated.


entityIdstring

ID of the entity associated with the event.


eventTimestringformat date-time

Event timestamp.


triggeredByAnonymizeRequestboolean

Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).


originatedFromstring

If present, indicates the action that triggered the event.


updatedEventUpdatedEvent

Event information.

Event Body

The data payload will include the following as an encoded JWT:

JSON
{ "data": { "eventType": "wix.loyalty.v1.loyalty_earning_rule_updated", "instanceId": "<app-instance-id>", "data": "<stringified-JSON>", // The identity field is sent as a stringified JSON "identity": { "identityType": "<identityType>", // ANONYMOUS_VISITOR, MEMBER, WIX_USER, APP "anonymousVisitorId": "<anonymousVisitorId>", // in case of ANONYMOUS_VISITOR "memberId": "<memberId>", // in case of MEMBER "wixUserId": "<wixUserId>", // in case of WIX_USER "appId": "<appId>" // in case of APP } } }

LoyaltyEarningRuleUpdated
JSON
{ "id": "79e98s2a-d8j4-4a3b-a62f-7393757bab84", "entityFqdn": "wix.loyalty.v1.loyalty_earning_rule", "slug": "updated", "entityId": "5bf5cb44-87rt-4933-1234-1d8423636a74", "updatedEvent": { "currentEntity": { "id": "b690f925-8527-4d5e-b358-4b0adcb275b5", "sourceAppId": "553c79f3-5625-4f38-b14b-ef7c0d1e87df", "triggerAppId": "1380b703-ce81-ff05-f115-39571d94dfcd", "triggerActivityType": "stores/OrderPaid", "title": "Purchase a product", "conversionRate": { "moneyAmount": 1, "points": 20, "configs": [ { "moneyAmount": 1, "points": 20 } ] }, "status": "ACTIVE", "revision": "1", "createdDate": "2024-09-16T12:06:39.294Z", "updatedDate": "2024-09-16T12:06:39.294Z", "metadata": { "canBeDeleted": true } } }, "eventTime": "2023-09-11T14:58:22.481838Z", "triggeredByAnonymizeRequest": false, "entityEventSequence": "1" }
Did this help?

Loyalty Earning Rule Deleted


Triggered when an earning rule is deleted.

Permissions
Manage Loyalty
Read Loyalty
Learn more about app permissions.
Event BodyEvent Body Event data is received as a JSON Web Token (JWT). It may be delayed. Be sure to verify the data was sent by Wix.
Event Data
idstring

Unique event ID. Allows clients to ignore duplicate webhooks.


entityFqdnstring

Fully qualified domain name of the entity associated with the event. Expected wix.loyalty.v1.loyalty_earning_rule.


slugstring

Event name. Expected deleted.


entityIdstring

ID of the entity associated with the event.


eventTimestringformat date-time

Event timestamp.


triggeredByAnonymizeRequestboolean

Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).


originatedFromstring

If present, indicates the action that triggered the event.


deletedEventstruct

Event information.

Event Body

The data payload will include the following as an encoded JWT:

JSON
{ "data": { "eventType": "wix.loyalty.v1.loyalty_earning_rule_deleted", "instanceId": "<app-instance-id>", "data": "<stringified-JSON>", // The identity field is sent as a stringified JSON "identity": { "identityType": "<identityType>", // ANONYMOUS_VISITOR, MEMBER, WIX_USER, APP "anonymousVisitorId": "<anonymousVisitorId>", // in case of ANONYMOUS_VISITOR "memberId": "<memberId>", // in case of MEMBER "wixUserId": "<wixUserId>", // in case of WIX_USER "appId": "<appId>" // in case of APP } } }

LoyaltyEarningRuleDeleted
JSON
{ "id": "79e98s2a-d8j4-4a3b-a62f-7393757bab84", "entityFqdn": "wix.loyalty.v1.loyalty_earning_rule", "slug": "deleted", "entityId": "5bf5cb44-87rt-4933-1234-1d8423636a74", "deletedEvent": {}, "eventTime": "2023-09-11T14:58:22.481838Z", "triggeredByAnonymizeRequest": false, "entityEventSequence": "1" }
Did this help?