Example Flows

This article shares possible use cases your app could support, as well as example flows. You're certainly not limited to these use cases, but it can be a helpful jumping off point as you plan your app's implementation.

Activate a loyalty program and create loyalty accounts

Your app can help site owners activate their Loyalty Program and create loyalty accounts for each of their customers.

  1. Use Activate Loyalty Program to activate the site's loyalty program.

Note: The Wix site owner must install the Wix Loyalty Program app before activating.

  1. Use List Contacts to get all contacts.

  2. Create a loyalty account for each contact with Create Account.

Two-way sync with an external system

Your app can help business owners keep their external loyalty program updated with their Wix loyalty accounts with a two-way sync.

First, create a mapping from Wix loyalty accounts to the external accounts using a common field, like email address. Store this mapping on your app's server. Then you will follow these two flows to create the two-way sync:

  • Synchronizing to the external system
  • Synchronizing to Wix

Synchronizing to the external system

  1. Listen for any changes to Wix loyalty accounts using the Points Updated Webhook.
  2. When the webhook is triggered, parse the data object for the latestTransaction.
  3. Use the initial mapping to copy the relevant information to the external loyalty system.
  4. Ignore the resulting event from the external system so that you don't create an endless loop of updates.

Synchronizing to Wix

  1. Listen for any changes to the loyalty accounts from the external system.
  2. When your app detects a change that it needs to synchronize, use Adjust Points to copy the details to the relevant Wix loyalty account.
  3. Ignore the resulting event from Wix so you don't create an endless loop of updates.

Message site members with their loyalty points balance on a monthly basis

Businesses can send their customers a monthly message that includes the customer's loyalty points and encourages them to earn more.

  1. Use List Accounts to get all loyalty accounts.
  2. Pull out only the accounts that contain a memberId.
  3. Use Get or Create Conversation and Send Message to send a new message at the beginning of every month to each member that includes their loyalty account points balance.
Was this helpful?