API Reference

Rule Engine

The Rehook rule engine is center to all campaigns created using Rehook. It is used to set the conditions that must be met to reward your users. The rules are evaluated as long as the the rule is within the set timeframe.

Rule Time Frame

The rule time frame helps set the validity of the rule within the campaign. This gives you the flexibility to run different earning rules for different time periods in the same campaign.

You can choose to use the campaign's time frame or a custom time frame for the rule.

If campaign's timeframe is chosen the rule will be valid for the entire duration of the campaign.

If custom time-frame is chosen, the rule will be valid for the specified period.

Conditions

Conditions help set the criteria that need to be met before rewarding the user.

Event Validation

Event and Event Properties

  1. Select the drop down under When user does
  2. Choose the event that needs to be performed by the user to give the reward. For eg. The simplest action here could be SignUp or Transaction.
  3. Click +Property Condition to choose properties of the selected event and set additional conditions. For example, for Transaction, you can select the property Transaction Amount is greater than 500.
  4. When you select a property, you will have the option to choose the logical operator you want apply to the property eg. is greater than, is less than, contains, is between
  5. After choosing the logical operator, type the value you to validate
  6. You can add as many property conditions as needed.
Rule Engine - Condition Bloc

Rule Engine - Condition Bloc

Advanced options - Sum of Event Occurrences and Sum of Event Properties

Check advanced options to add additional criteria for user actions :

  • the number of times the actions needs to be performed - sum of event occurrences eg. Transaction is done 5 times
  • The final value the sum of an event property needs to add up to - sum of event property eg. For Transaction , the property Transaction Event reaches a value of 5000. Note: The number of Events to reach the set value does not matter. The user can perform 500 transactions of $10 or 5 transactions of $1000 to reach 5000. In both cases the condition will be met.

To set the above condition, follow the following steps:

  1. Check the advanced options box.
  2. Select the drop down following 'where'.
  3. Choose between sum of event occurrences and sum of event property.
  4. For sum of event occurrences type the number of times you want the action to be performed to satisfy the condition.
  5. For sum of event property select the drop down under Sum of which property.
  6. Choose from the list of properties of the selected event
  7. Type the value the sum of the event property should add up to to satisfy the condition.

Multiple Events as Conditions

You can choose multiple events as the condition for one rule. To do so click +Add Condition By default, the reward will be triggered only when the customer performs all the events.

You have the option to trigger the reward only when all events are completed or if any one of the events are completed.

User properties as Conditions

In addition to Events, you can select a User Property as a condition. Only users with the specified user property will qualify for the reward. Examples of user properties include ‘Age = 25 to 30; State = Maharashtra; Customer tier = Gold’

  1. Select the advanced user property filter checkbox
  2. Select Add User Property
  3. Click on the first dropdown under And has common user property
  4. Select the user property that needs to be validated as a condition
  5. Select the logical operator to be applied to the user property.
  6. Type the value to validate the selected user property.
  7. Add as many user properties as required.

Rewards

The Rewards section of the Rule Engine helps you choose what to reward your customers once they satisfy all the required conditions. Make sure to configure the reward web-hook before building your first campaign. All reward details are sent via the reward web-hook.

Rule Engine - Reward Block

Rule Engine - Reward Block

Reward Limit

Every time conditions of the rule engine are met, the user is rewarded. Using the reward limit settings you can set the maximum number of times a user can be rewarded during the rule timeframe:

  • Once: The rule is triggered a single time during the entire rule timeframe. Meeting the conditions more than once will not lead to further rewards.
  • Unlimited: Users will be rewarded each time they meet the rule conditions during the rule timeframe.
  • Custom - The rule can be triggered a specific number of times during a particular period (per Day/Week/Month/Year) or in total.

📘

How are time periods counted on Rehook?

Days are counted from 00:00 to 23:59:59 hours
Weeks are from 00:00, Monday to 23:59:59, Sunday
Months are from First to Last date of the month
Years are from 00:00, 1st January to 23:59:59, 31st December

Note: For example, if the limit is set to once per week, and the campaign is launched on a Wednesday - The first week will count from Wednesday to Sunday, then Monday to following Sunday and so on

Types of point rewards

Reward TypeHow does it work?Use Case
Flat AmountReward customers with a fixed amount.

In Units to be rewarded enter the integer amount of points to reward the customer.
1. Set a Sign-Up bonus of 200 points for customers

2. Reward customers with 200 points for watching 5 videos
PercentageReward customers with a variable amount which is a percentage of the value of an action taken by the customer for example a purchase, deposit etc.

In Units to be rewarded enter the percentage amount of an event property you want to reward the customer. For example 10%

Select the Event from the dropdown (Only events that are part of rule's conditions will be available to be selected) For example: Transaction

Select the Event Property from the dropdown (Only event properties with Integer data type can be selected) For example: Transaction Amount

(optional) Enter a limit on the number of number of points a customer can earn on any given transaction
1. Create a loyalty cash-back program to reward customers 10% of every transaction on your platform as loyalty points

2. Reward users with 30% loyalty points on transactions over 500 units of a specific category such as luxury
ProportionalReward customers in proportion to their spends or any other value based action. The reward input follows a For every X units of Y, give Z units format.

In Units to be rewarded enter the number of units of the event the user has to perform to get a proportional reward. For example For every 100 units of a Transaction

Select the Event from the dropdown (Only events that are part of rule's conditions will be available to be selected) For example: Transaction

Select the Event Property from the dropdown (Only event properties with Integer data type can be selected) For example: Transaction Amount

Select the number of units to reward the user for every X units spent or performed as entered in previous value field. For example give 30 units

Example: For every 100 units of a Transaction: Transaction Amount give 30 units

The customer will receive 300 points on making a transaction of 1000 units of the set currency
1. Create a loyalty earning rule for your customers where for every 300 units spent they are rewarded 50 points

2. For every 1000 steps completed reward your customers with 150 points
Random Reward customers a random number of points set between a minimum and a maximum value.

In Units to be rewarded enter a minimum and maximum value to reward the customer on satisfying the given conditions.
For example Min: 100, Max: 500

Set the Probability Favor to either Min, Average or Max. The Favor sets the distribution of the rewards between the minimum and maximum value. If set to Min, a larger percentage of your customers will receive rewards closer to the Min value. Similarly for Average and Max.
1. Reward your customers with a scratch card after every completed challenge. Rewards will be random, ranging from 100 to 1000 points.

2. Create a mystery box to reward your customer on their 7th successful login.

Add Reward

Reward Points helps you configure how many points to be deposited into the customers virtual wallet as a reward for completing the rule conditions.

  1. Click Add Reward in the Reward block of the rule engine
  2. Select Webhook Reward to handle user rewards in your own system wallet. Select Reward Points to reward the user in the wallet created on Rehook.

Reward Points

  1. Type the name of the reward.

  2. Select the reward type from the dropdown:

    1. Flat Amount: Set a fixed amount to reward the user when the conditions are met
    2. Percentage: Select a percentage value of the event property performed. Example: To reward customers 3x points on their transaction value - Percentage: 300%, Event: Transaction, Property: Transaction Amount
    3. Proportional Reward
    4. Variable Reward
Reward Points

Reward Points

Reward Activation and Expiration Date

You can configure when the points rewarded will be available to use by your customers as well as when the points will expire.

  1. In Reward Activation Date, select Immediate if points can be immediately used by the customer once rewarded
  2. To activate the points after a certain duration, select custom. Select the number of days the points will be available to use after being rewarded.
  3. Set the value for the duration after which the points will be activated and available to use by the customer.
  4. In Reward Expiration date, the points will expire as per the wallet expiry settings. If you wish to override the wallet expiry settings for this instance, select override wallet.
  5. Select a specific date when the points expire or the duration after being rewarded the points will expire

Webhook Rewards

Webhook Rewards gives you the flexibility to handle the customer rewards on your system. You can reward your user points in their wallet created on your application or provide physical rewards.

When a user satisfies the rule conditions, we will send the user details and reward information through the reward webhook to your system.

To setup the webhook reward:

  1. Configure the reward webhook to enable webhook rewards.
  2. You can optionally add additional key value pairs to send through the webhook.
  3. Type the Reward Name
  4. To configure reward settings, select the Advanced reward settings checkbox
  5. Select the reward type from the drop down:
    1. Flat Amount: Set a fixed amount to reward the user when the conditions are met
    2. Percentage: Select a percentage value of the event property performed. Example: To reward customers 3x points on their transaction value - Percentage: 300%, Event: Transaction, Property: Transaction Amount