Creating a Rule

To use a list in the Rules Engine, start by adding a new rule based on either a system event or a custom event. 

Start by filling in the basic rule information that you want to create. Under the Conditions section, deselect “Match all cases” and type the kind of data you are looking for. This could be a name, address, or email, etc.

Once you’ve selected the field of your criteria, click on the content grey box to show the Values menu. 

First, you want to determine if the rule will apply to the values In this predefined list or Not in this predefined list by selecting the appropriate radio button (See #1 below). 

Then, select the option “Compare to an existing list of values”. From the drop-down menu, choose which list you want to use for this rule (See #2 below).

Note that Rules Engine will always use values from the latest version of the selected List. You can use the same List in multiple Rules.

When creating a Rule using an API

This is an example of creating a Rule via API call. In this case, we create a Rule for a Dispute Created event, blacklisting a customerId when a Dispute's currency is in our List CurrencyList

PUT https://api.rebilly.com/v2.1/events/dispute-created/rules

Request body:

{ 
 "rules":[
 {
 "name":"Test Rule 1",
 "actions":[
 {
 "name":"blacklist",
 "status":"active",
 "type":"customer-id",
 "ttl":600
 }
 ],
 "final":true,
 "status":"active",
 "criteria":{
 "op":"and",
 "conditions":[
 {
 "op":"in-list",
 "path":"/dispute/currency",
 "listId":"CurrencyList"
 }
 ]
 }
 }
 ]
}
Did this answer your question?