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:
To learn more about earning rules, see Managing Your Loyalty Program.
It's important to note the following points before starting to code:
The Wix Loyalty program supports two types of earning rules:
Both types allow customers to earn points for various actions, but differ in their creation, management, and customization options.
Automated earning rules are enabled by Wix Automations. There are two subtypes:
Pre-installed rules appear automatically when certain business solutions are installed. These rules can be disabled but not deleted.
Earning Rule Name | Activity Type | Supported Types |
---|---|---|
Order a plan (Wix Pricing Plans) | wix_pricing_plans-plan_purchased | Fixed amount, Conversion rate |
Place a restaurant order (Legacy 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 users and don't come pre-installed. All automated earning rules not listed above fall into this category.
Non-automated earning rules can be created based on installed Wix business solutions. These rules are identified by their sourceAppId
, which differs from automated earning rule sourceAppId
.
Supported non-automated earning rules:
Earning Rule Name | Activity Type | Supported Types |
---|---|---|
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 | Not specified |
For example, if you have Wix Events installed, you can create an earning rule that is triggered when a customer buys a ticket or RSVPs to an event.
Earning rules can award points in two ways:
Fixed Amount: 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: Points are awarded based on a ratio of money spent to points earned. For example, a customer might receive 10 points for every $1 spent. The formula is: (amount spent) / (moneyAmount * points)
.
sourceAppId
.[amount spent] / moneyAmount * points
."auth/register"
, "events/OrderConfirmed"
.ACTIVE
, PAUSED
).