docs
  1. Storefront
  2. Checkout
  3. Rule Engine

Rule Engine

The Rule Engine lets you dynamically control checkout elements based on customer, order, or payment context. For example, you can disable specific delivery options for large items or restrict payment methods based on basket value, items, or shipping address.

To start, please ensure the Rule Engine is activated for the specific shop.

Rules are created and applied individually per environment (e.g., prev, test, live). If a rule is created in one environment, it must be manually recreated in the other environments—there is currently no export or clone function.

Rules created in the live environment will take effect for end users in the checkout as soon as they are active. It is therefore important to test all rules first in lower environments before enabling them in live.

Rules can be created and managed via the SCAYLE Panel. Each rule consists of:

  • Condition → what the rule evaluates
  • Result (Outcome) → what happens when the condition is met

How the Rule Engine Works

Rules Conditions

Conditions can reference data from:

Condition GroupCondition VariableVariableOptions
ObjectCustomer
  • Customer Type
  • Customer Group
  • Customer Status
  • Customer (s) Created At
  • Customer ID
  • Customer Creation Date
  • Customer Updation Date
  • First Name
  • Last Name
  • Gender
  • Title
  • Birth Date
  • Phone Number
  • e-Mail
  • Public Key
  • Reference Key
  • Authentication
  • Custom Data
ObjectOrder
  • Order ID
  • Applied Loyalty points
  • Basket Key
  • Campaign Key
  • Confirmed At
  • Currency Code
  • Reference Key
  • Created At
  • Updated At
  • Cost
  • Custom Data
ObjectAddress
  • Billing Address
  • Shipping Address
ObjectApplication
  • App ID
  • Country Code
  • Currency Code
  • Device
  • Language Code
ObjectClient
  • Current Time
  • IP
  • Language Code
  • Location
  • User Agent
CollectionItems
  • Available Quantity
  • Item Group
  • Item Key
  • Package ID
  • Reservation Key
  • Status
  • Warehouse ID
  • Created At
  • Updated At
  • Custom Data
  • Delivery Forecast
  • Price
  • Product
  • Variant
CollectionPackages
  • Package ID
  • Carrier Key
  • Delivery Status
  • Return Ident Code
  • Shipment Key
  • Delivery Date
  • Tracking
CollectionVouchers
  • Voucher ID
  • Voucher Code
  • Voucher Type
  • Voucher Value
  • Applicable Items
CollectionPayments
  • Payment Amount
  • Payment Key
  • Transaction Key
  • Data
  • Options
  • Installment

Logical Operators

Depending on the selected object or field, the following operators may be available:

OperatorPurposeHow it WorksExample
ISExact matchTrue if the value is exactly equal to the specified valuecountry IS "DE" → matches Germany
IS NOTExact mismatchTrue if the value is anything other than the specified valuecustomerGroup IS NOT "VIP" → excludes VIPs
INMatch any value from al listTrue if the value exists in the provided listcountry IN ["DE","AT","CH"] → matches DACH region
NOT INExclude values from a listTrue if the value does not exist in the provided listpaymentMethod NOT IN ["paypal","creditcard"]
LIKEPartial/wildcard matchTrue if the value matches the pattern using %zipCode LIKE "25%" → matches all zip codes starting with 25 → 25000, 25A, 2599

zipCode LIKE "%25%" → matches zip codes containing 25 anywhere → A25B, 12500, 9925

zipCode LIKE "%25" → matches all zip codes ending with 25 → 12325, A25, 0025
NOT LIKEPartial/wildcard mismatchTrue if the value does not match the pattern using %zipCode LIKE "25%" → exludes all zip codes starting with 25 → 25000, 25A, 2599

zipCode LIKE "%25%" → excludes zip codes containing 25 anywhere → A25B, 12500, 9925

zipCode LIKE "%25" → excludes all zip codes ending with 25 → 12325, A25, 0025
=Equal toTrue if the value matches exactly.orderTotal = 100 → matches orders with a total of 100.
!=Not equal toTrue if the value does not match.customerGroup != "VIP" → matches customers not in the VIP group.
>
Greater thanTrue if the value is larger than the specified value.orderTotal > 50 → matches orders above 50.
<Less thanTrue if the value is smaller than the specified value.orderTotal < 200 → matches orders below 200.
<=
Less than or equal toTrue if the value is smaller than or equal to the specified value.orderTotal <= 100 → matches orders of 100 or less.
>=Greater than or equal toTrue if the value is larger than or equal to the specified value.orderTotal >= 50 → matches orders of 50 or more.

Rule Outcomes

When a condition matches, the rule can modify checkout behaviour. Outcomes currently support:

Checkout ElementOutcomeResults
Delivery OptionsControl how customers see delivery options/form fields at the checkout.
  • Disable Collection Points (DHL, Hermes, etc.)
  • Allow or prevent different billing/shipping addresses
  • Allow or enforce same billing/shipping address
  • Apply rules to all delivery options or specific ones
Shipping OptionsDisable shipping methods
  • Disable standard shipping option
  • Disable express shipping option
  • Disable scheduled delivery
Payment Options / Express PaymentsYou can disable specific standard or express payment options based on the rule condition.

Example:

  • Restrict invoice payment for customers in a specific risk category
  • Disable express payments for orders above a certain value
Risk AssessmentUse rules to manage risk during checkout
  • Pre-filter orders before confirmation: automatically reject orders from high-risk customers
  • Post-filter orders after confirmation: block delegation of orders deemed risky
Notification OptionsTrigger contextual notifications at specific moments in checkout.
  • Authentication step
  • Payment selection
  • Order confirmation

These can be used for warnings, eligibility messages, account prompts, or other UX feedback.


Example: Show a notification when vouchers are incompatible with certain payment methods

Available Collection Point Delivery OptionConfigure availability of collection points as a shipping option based on rule results
  • Enable/disable carrier specific post office as a collection point
  • Enable/disable carrier specific pack station as a collection point

How to Manage Rules in the Panel

Navigate through Settings ➜ Rule Engine in the SCAYLE Panel. Rules are managed at the shop level, therefore you must select the country shop in the dropdown before searching, adding, editing and/or deleting a rule.

Creating a New Rule

Once you are in the Rule Engine tab, select the desired country shop from the dropdown. To proceed, click the +Add Rule button. Alternatively, depending on whether you already have active rules, a +Add First Rule button will be displayed. You can also click on it to start.

You will be redirected to the New Rule page, where you must provide a name, a description, and define both the conditions and the results of your rule. These 3 steps are mandatory. The page will only allow you to proceed to the next step once the previous one is completed.

Step 1 - Add a Name and Description for the rule. These fields help you identify and search for the rule later, so make sure to provide clear and meaningful information.

Step 2 - Click on Add Condition button to start and:

  • Select an object or collection from the list.
  • The menus will be populated based on the previous selection (e.g.: addressshippingzipCode).
  • When the variable selection is completed, click on Add.
  • Select the logical operator of your condition and corresponding value (e.g., 12345, %22, London, etc), and press enter in your keyboard.

Depending on the selected operator, you might be able to add one or multiple values.

Optional configurations:

  • Sub conditions: You can add one or multiple sub-condition to your rule by clicking the +SUB CONDITION button. When adding it, you must to choose the same operator for multiple sub-conditions within the rule.
  • Multiple conditions: You can add multiple conditions to a single rule by clicking +Add Condition in Step 2. Make sure to connect them using the AND or OR operator.

For example, if you want to disable express shipping options for addresses with ZIP codes starting with 22, the Rule Engine allows you to base this on both the shipping and billing address. In this case, you would create two conditions: one for the shipping address and one for the billing address.

  • AND → Choose this operator if the rule applies only if all conditions are true.
  • OR → The rule applies if any condition is true.

Step 3 - To define what happens when the conditions are met, click + Add Result and choose an option from the menu. In the example below, the rule modifies the express delivery option in the checkout.

Once you add a result, you can choose whether to disable an option or trigger a specific notification.

To add multiple results, click + Add Result again. Note that multiple results can only be created when they apply to the same type of option (e.g., shipping options).

Unlike conditions, multiple results do not require AND/OR operators. All results you add will be applied to the checkout whenever the rule is triggered.

Rules in the Rule Engine disable options, not enable them.
Because of this, the recommended approach is:

  1. Start with broad “exclusion” rules
    (e.g., disable shipping options that are never relevant for certain countries)
  2. Then create more specific rules
    (e.g., disable an additional option for a ZIP code pattern, a customer group, etc.)

This avoids having to repeat the same exclusions across many rules.

Once you finished creating the conditions and results, click on Create to apply the rule. You wll be redirected to the Rule Engine overview and a success message will be displayed:

Managing Existing Rules

All existing rules are listed in the Rule Engine section of the SCAYLE settings. Each rule has a unique ID that helps with identification and debugging. You can search for a rule by name using the search bar, or filter the list by Name, Description, Group Name, or Status.

At the bottom of the list, you can choose how many rules are displayed per page.

To manage a rule, hover over the desired entry. The row will be highlighted, and an additional menu will appear when you click or hover over the three-dot icon.

You can choose to Edit, Deativate or Delete the rule.

If you choose to edit a rule, you will be redirected to its settings. Make the necessary changes and click Update to apply them.

You can also delete the rule from its settings by clicking the trash bin icon. A confirmation prompt will appear before the rule is removed.

Rules Examples

The following examples illustrate real-world scenarios. More complex cases may involve multiple conditions and sub-conditions.

Minimum Order Value (MOV) for Payment Method

A rule can be set for payment methods requiring a minimum order value (MOV). For example, you may want to disable the Accounting (B2B) payment method for orders less than a threshold. If MOV is not reached, the payment method is deactivated and will not be displayed as an option in the checkout.

To set this rule:

  1. Add a Name (e.g., "MOV for Accounting") and Description (e.g., "Minimum Order Value for Accounting Payment Method")
  2. Add the Condition: order > cost > withoutServiceCost <= 5000 (≙ 50.00€)
  3. Select the Result: Payment Options > Accounting | Deactivate Payment Method
  4. Click Create to save the rule
Shipping Costs per Country

A rule can be set to enable/disable specific shipping costs for a given shipping country (global or EU shop). For example, you can create a rule where, if a customer selects a shipping country, all shipping options are disabled that do not have a specific cost.

For details on setting Shipping Options (including shipping cost) see Shipping Options.

To set such a rule:

  1. Add a Name (e.g., "Shipping costs for TUR") and Description (e.g., "Disables shipping options for TUR").
  2. Add the Condition: e.g., address > shipping > countryCode IS TUR
  3. Select the Results: e.g.,
  • Shipping Options > rule-engine.available_shipping_options.1299 | Deactivate Shipping Options
  • Shipping Options > rule-engine.available_shipping_options.1546 | Deactivate Shipping Options
  • Shipping Options > rule-engine.available_shipping_options.1427 | Deactivate Shipping Options
  • Deactivate other shipping options where shipping cost ≠ 34,38
  1. Click Create to save the rule.

For conditions with countryCode use the iso_alpha3 (e.g., for Germany it is DEU).

Free Shipping Campaign for Time Frame

Rules can be set to enable free shipping for a given time period (e.g., promotion campaign). This requires two rules: one to enable free shipping, and another to define standard shipping outside of the free shipping time period.

This can be done as follows:

  1. Create a Rule for Free Shipping
  • Add a Name (e.g., "Free Shipping Option") and Description (e.g., "Free shipping for time frame + min. order value").
  • Add the Conditions: e.g.,
    • order > cost > withoutServiceCost >= 4000 (40.00)
    • AND client > currentTime between 06-03-2023 09:00:00 - 09-03-2023 00:00:00
  • Select the Results: e.g., Shipping OptionsDHL Standard | Deactivate Shipping Options
  • Click Create to save the rule.
  1. Create a Rule to Disable Free Shipping
  • Add a Name (e.g., "Free Shipping Disable") and Description (e.g., "Enable free shipping only when campaign is active").
  • Add the Conditions: e.g.,
    • client > currentTime before 06-03-2023 09:00:00
    • OR client > currentTime after 09-03-2023 00:00:00
    • OR order > cost > withoutServiceCost <= 4000 (40.00)
  • Select the Results: e.g., Shipping Options > DHL Standard (free shipping) | Deactivate Shipping Options
  • Click Create to save the rule.
Max Order Value

Below is a sample rule set for an order with a max value of 700 €. All payment methods will be deactivated if the customer orders items that cost higher than 700 €.

To set this a rule:

  • Add a Name (e.g., "Max Order Value") and Description (e.g., "Max. order value = 700 €").
  • Add the Condition: e.g., order > cost > withTax > 70000 (≙ 700.00 €)
  • Select the Results: e.g.,
    • Payment OptionsAll Payment Methods | Deactivate Payment Method
    • Payment OptionsAll Payment Methods | Error Payment Method
    • Add error message (e.g, "The maximum order value is 700 €")
  • Click Create to save the rule.
Setting Multiple Subconditions: Free Shipping for a time period for chosen customers

Scenario: Set free shipping for all women living in Berlin or Hamburg for orders from the 7th of March until the 9th of March.


You can set a rule containing multiple statements, however within a statement, use the same operator. A single rule can contain multiple subconditions joined by one operator (such as a sub-condition AND another subcondition AND another subcondition), but you cannot mix operators within a single rule. To add a statement with a different operator, create a new rule.

For example, one rule could target:

  • Main condition: is female. AND
    1. Sub condition: shipping after the 7th of March AND
    2. Sub condition: shipping before the 9th of March.

To target women who live in Berlin OR in Hamburg, we have to add a new condition, as we cannot mix operators AND/OR within the same condition statement.

  • Main Condition: lives in Germany.
  1. Sub condition: lives in Berlin OR
  2. Sub condition: lives in Hamburg

To add multiple conditions and sub-conditions:

1. Go to Settings ➜ Rule Engine

2. Select +ADD RULE.

3. Add a Name and Description.

4. Click ADD CONDITION too add a new rule:

  • Select customer > gender > ADD.
  • Choose the IS and select f from the dropdown. Specify the timeframe:
  • Click +SUB CONDITION, then order > createdAt > datetimeOperations > ADD. Select before from the dropdown. Pick the date and time from the calendar.
  • Click ADD CONDITION, then order > updatedAt > datetimeOperations > ADD. Select after from the dropdown. Pick the date and time from the calendar.

Add new condition to specify location. Multiple locations possible using OR operator:

  • Click ADD CONDITION too add a new rule:
  • Select address > shipping > city > ADD. Type a city, for example "Berlin".
  • Click +SUB CONDITION, then address > shipping > city > ADD. Type a city, for example "Hamburg".
  • Switch toggle to OR.

Add free shipping:

  • Select the Results: e.g., Shipping OptionsDHL Standard | Deactivate Shipping Options
    • Click Create to save the rule.