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.
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.
The Wix Loyalty program supports two types of earning rules:
Both types allow customers to earn points for various actions, but differ in their flexibility and customization options:
We recommend creating automated earning rules using the Wix Automations API for maximum flexibility and customization options.
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 come automatically when certain business solutions are installed. These rules can be paused but not deleted.
Supported pre-installed earning rules:
Earning Rule Name | Trigger | Point award method |
---|---|---|
Order a plan (Wix Pricing Plans) | wix_pricing_plans-plan_purchased | Fixed amount, Conversion rate |
Place a restaurant order (Old Wix Restaurants) | wix_restaurants_orders-order_submitted | Conversion rate only |
Place a restaurant order (New Wix Restaurants) | restaurants-order-is-pending | Conversion rate only |
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 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 Name | Trigger | Point award method |
---|---|---|
Purchase a product (Wix Stores) | stores/OrderPaid | Fixed amount, Conversion rate |
Book a session (Wix Bookings) | bookings/BookingConfirmed | Fixed amount only |
Buy a ticket (Wix Events) | events/OrderConfirmed | Fixed amount, Conversion rate |
RSVP to an event (Wix Events) | events/Rsvp | Fixed amount only |
For example, if Wix Events is installed, two types of earning rules can be created:
events/OrderConfirmed
).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.
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:
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.
sourceAppId
.points awarded = (amount spent / moneyAmount) * points per unit
.auth/register
, events/OrderConfirmed
.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.ACTIVE
, PAUSED
).