NS8 User Guides

Creating an Order Rule with Multiple Conditions

How to write a compound order rule with multiple arguments.

There are times when Order Rules will require more than one argument to perform the actions you need.

Building a rule with multiple conditions is a simple process and can be a very powerful tool in fraud prevention. However, you need to think through your rules' logic carefully, because with increased complexity comes greater chances to make mistakes.

Below we will outline the methods for creating more complex Order Rules than covered in other articles.

Positive and Negative Lists

Positive and negative lists are used to either prevent orders from being quarantined as suspect or to block known bad actors.

A positive list, for example, will always approve a listed customer's orders that may get quarantined because they get quarantined in error.

For example, shopping with a VPN on is normally considered suspect and will cause an order to score poorly and get quarantined. But you may have a customer who always uses a VPN, and since their orders keep getting held, adding them to a positive list will prevent this. (As a best practice, NS8 recommends that you build positive lists with a price limit to prevent issues, should the customer's account become compromised.)

Negative lists are very similar to a positive lists, but will always either hold the orders or cancel them because they meet the conditions specified. A good example of this is a shipping address that you know is associated with a problematic freight forwarder. Adding this shipping address to a negative list lets you cancel the order by default.

For both positive and negative lists, NS8 recommends that you use one rule for positive lists and one rule for negative lists, and you should use And/Or conditions to make rules more manageable. Below we will illustrate this technique.

Step 1 - Create a New Order Rule

Start off by navigating to the Order Rules Screen by selecting "Order Rules" from the Order Protection Menu. You will then click the "Add New Rule" button.

Step 2 - Create the First Condition

For a positive list, your first condition could be a dollar value that establishes the threshold at which you still would like an order screened. (You may also choose to use a dollar value on some negative lists).

For example, you could build a rule that holds any orders over a certain dollar amount. The image below illustrates this: just select the appropriate "Action to Take" and "Total Price" as the first condition.

Note - Each eCommerce platform has its own actions.

Magento users, check out our guide on Magento Order Rule actions.
PrestaShop users, check out our guide on PrestaShop Order Rule actions.
Shopify users, check out our guide on Shopify Order Rule actions.
WooCommerce users, check out our guide on WooCommerce Order Rule actions.

Step 3 - Add the Secondary Conditions

There are two ways to add conditions "Add Rule" and "Add Group." Add Group creates a group of rules, or conditions. Each group of rules can be set to either "And" or "Or" but not a mix of the two. The example below is broken down step by step, including steps 1 & 2 above.

  1. The new rule is created with a price limit less or equal to $200 and its action set to "Whitelist - accept order" as shown in Steps 1 & 2 above.
  2. "And" was selected as the condition type for the next rule group.
  3. "Add Group" was clicked to create a secondary set of conditions to the price limit set above.
  4. The first two entries whitelisted customers by last name using "Or" as the condition type. Each entry was added using the "Add Rule" button marked with the number 7 above.
  5. "Add Group" was clicked again to create a rule group as an "Or" condition to the names listed already.
  6. Two rules were created to whitelist a specific address and to prevent approvals in error. The conditions were set to the street address "And" postal code.
  7. By clicking "Add Rule" for the first group, another "Or" condition was created to add another last name to the list of approved customers. This rule is whether the "Customer Email" is equal to Mallard@Duck.com. This step can be repeated to continue to add customers to this whitelist or another group created as needed returning to Step 5.
  8. Click OK to save your new rule, and everything will be just ducky.

More Examples

This rule will quarantine orders that are shipping outside the United States and are over $199. You could also use the condition for the Billing Address or User Country fields. User Country identifies where the customer was located when placing the order.

This rule contains a list of customers that you have identified as bad actors for whom you do not want orders fulfilled The fields used to identify the fraudsters do not have to be the same within the rule.

As you can see, there are many ways to use multiple conditions to protect your orders. If you need assistance, contact NS8 using the chat icon on this screen and we will be happy to help.

Creating an Order Rule with Multiple Conditions


How to write a compound order rule with multiple arguments.

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.