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?