Delayed and Recurring Points
Delayed and Recurring Points

Knowledge Base

This add-on adds lets you schedule different actions on your points and rewards systems.

Purchase and Installation

First you need to download and install the Add-On. Go to the following page:

WordPress Admin
Admin menu
WooRewards
Menu entry
Add-Ons
Page
Delayed and Recurring Points
Item

Click the Add to Cart button. It will open a new tab in your browser. Proceed with the purchase. As a result, you will receive an email with a link to download the plugin’s zip file. Once you have the file, do the following:

WordPress Admin
Admin menu
Plugins
Menu entry
Add New
Page
Upload Plugin
Button

Select your zip file and upload it. At the end of the process, click on Activate.

Enable the feature

Before being able to use this feature, you have to enable it. Therefore, you need to go to the following page :

WordPress Admin
Admin menu
WooRewards
Menu entry
Settings
Page
Points and Rewards
Tab

In the Advanced Features group, you will see 2 new options :

  • Enable delayed points : check this box if you want to enable the possibility to delay the attribution of points for a user action.
  • Enable recurring points : check this box to enable the periodic distribution of points for a user action.

Setup the points

On the same page, edit the points and rewards system for which you want to add points delay or recursion. Edit the desired action.

Points delay

Check the box to enable a delay after which points will be given. Afterwards, set the delay in days/weeks/months/years after which the points will be given.


If you set this option, points won’t be given when the user performs an action anymore. They will only earn points after the set delay.

Repeated points

Use this field to give points multiple times over time for a unique action. This is very useful if you sell annual subscriptions for example. This will let you give points by small amounts every month.

First, set how many times will be given. Then, set the period between 2 occurences of points distribution.

Track the delayed and recurring points

The Add-On also provides a new interface to track all ongoing, ended or cancelled points distribution. You will find this interface by going to WooRewards → Customers → Scheduled Points

The list presents different columns with various information :

  • Customer : Identifies the customer who’s receiving points
  • Next Date : Date of the next points attribution
  • Points Reserve : The points reserve to which points will be given
  • Earned points : How many points will be given
  • Source : This displays the origin of the points attribution in the following order Points and Rewards System / Method to earn points
  • Status : The actual status
  • Occurrences : How many times points were already given / How many times points will be given
  • Creation : Date at which the task was created.

You also have various filters you can use to view the wanted information. Finally, you can cancel or resume an ongoing task at any time.

API

This addon adds a new route in the WooRewards API .

Use this API route to add/subtract points to a user in a points reserve used by a points and rewards system. It requires the user writing permission.

POST
/wp-json/woorewards/v1/points/<user_email>/<pool_id>/<points_to_add_or_subtract>/<reason>

Available parameters

  • user_email : (string) – A user email.
  • pool_id : (string) – A points and rewards system identifier as obtained from a previous API route.
  • points_to_add_or_subtract : (int) – The amount of points to add to the user in the points reserve. Set a minus sign before the value to remove points.
  • reason : (string) – The description of why the points are added/subtracted

In addition to the url parameters, you can add recurring and delayed points by sending a JSON body with the following parameters :

  • delay : (interval) – The delay after points can be given. Default is 0.
  • count : (int) – The number of points distribution occurrences. Default is 1.
  • interval : (interval) – The delay between two points distribution. Default is 0.

Response

The JSON response is a status object. That object contains at least the following properties:

  • id : The points and rewards system identifier as set in the parameters.
  • points : The identifier of the points reserve (since several points and rewards systems can share the same points pool).
  • value : The new user points amount in this points reserve.
  • rewards : The unlocked reward count. Will be 0 if no reward was unlocked after point addition.

Error cases

A 404 error is raised if the points and rewards system identifier cannot be found.

A 404 error is raised if the user cannot be found by email.

Was this article helpful?
Dislike 0
Views: 190

Continue reading

Previous: The Scheduler
Next: Points Synchronization