Rule Engine
General
The Checkout Rule Engine allows you to dynamically control checkout options such as delivery, shipping, and payment methods.
By defining rules, you can automatically enable, disable or hide options. You can also trigger notifications based on customer, order, or payment data.´
Example use cases:
- Certain delivery options are disabled for large items
- Disable a shipping option for certain country.
- Disable payment methods that are prone to fraud for certain basket values/items/shipping addresses.
- Restrict express payment methods to certain user groups.
Rules
Rules can change how available checkout options behave in three ways:
- Disable – the option remains visible but cannot be selected
- Hide – the option is completely removed from the checkout view
- Notification – a message is displayed when the customer tries to select the option
Supported option categories are
- Delivery
- Shipping
- Payment
- Collection Points
Creating Rules
Rules are created at the shop level.
To add a rule:
- In the SCAYLE Panel, open Settings ➜ Rule Engine.
- Select +ADD RULE or +ADD FIRST RULE.
Complete the 3 sections on the New Rule page.
- General Info: Add a Name and Description for the rule.
- Click ADD CONDITION to add a new rule:
- Select an object or collection from the list (e.g.,
order,customer,payment). - Menus are populated based on previous selections (e.g.,
order>id,customer>lastName,payment>amount). - When the variable selection is complete, click ADD.
- Select the operator (e.g.,
=,!=,>,<,<=,IS,IS NOT,IN,NOT IN) and corresponding value (e.g.,10,London). - To add a sub-condition, click the + SUB CONDITION button.
When adding a sub-condition, you have to choose the same operator for multiple sub-conditions within the rule.
- Optional Add another rule (condition) with
AND/ORoperators.
- Results: Select one or more results to trigger if the conditions are met (e.g., Payment Options ➜ All Payment Methods ➜ Deactivate Payment Method).
Results
Rule Engine Result.
-(1).png)
Rule Engine Result: Deactivate payment method.
-(1).png)
Since the rules disable options, it is easier to start with the more general excludes and then become more specific.
- For example, first, exclude shipping options that are not relevant for one country so you don't have to repeat the exclusion in every rule
Managing rules
To edit a rule:
1. Go to Settings ➜ Rule Engine.
2. On the Rule Engine page, hover over the three-dot menu on the rule you want to edit, and Edit.
To deactivate a rule:
1. Go to Settings ➜ Rule Engine.
2. On the Rule Engine page, hover over the three-dot menu on the rule you want to deactivate, select Deactivate.
To delete a rule:
1. Go to Settings ➜ Rule Engine.
2. On the Rule Engine page, hover over the three-dot menu on the rule you want to delete, and Delete.
Examples
The following examples are intended to explain some real-world scenarios.
Complex scenarios might include conditions and sub-conditons. Within one condition you can only set sub-conditons using the same operator (AND/OR).
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 (does not appear in checkout).
To set this rule:
- Add a Name (e.g., "MOV for Accounting") and Description (e.g., "Minimum Order Value for Accounting Payment Method")
- Add the Condition:
order>cost>withoutServiceCost<=5000(≙ 50.00€) - Select the Result:
Payment Options>Accounting|Deactivate Payment Method - Click Create to save the rule
-for-a-Payment-Method.png)
Example- Minimum Order Value (MOV) for a Payment Method
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:
- Add a Name (e.g., "Shipping costs for TUR") and Description (e.g., "Disables shipping options for TUR").
- Add the Condition: e.g.,
address>shipping>countryCodeISTUR - Select the Results: e.g.,
Shipping Options>rule-engine.available_shipping_options.1299|Deactivate Shipping OptionsShipping Options>rule-engine.available_shipping_options.1546|Deactivate Shipping OptionsShipping Options>rule-engine.available_shipping_options.1427|Deactivate Shipping Options- Deactivate other shipping options where shipping cost ≠ 34,38
- Click Create to save the rule.
For conditions with countryCode use the iso_alpha3 (e.g., for Germany it is DEU).

Shipping Options per Shipping Country
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 2 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:
- 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>currentTimebetween06-03-2023 09:00:00 - 09-03-2023 00:00:00
- Select the Results: e.g.,
Shipping Options➜DHL Standard|Deactivate Shipping Options - Click Create to save the rule.

Free Shipping Option
- 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>currentTimebefore06-03-2023 09:00:00- OR
client>currentTimeafter09-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.
.png)
Disable Free Shipping Option
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 Options➜All Payment Methods|Deactivate Payment MethodPayment Options➜All Payment Methods|Error Payment Method- Add error message (e.g, "The maximum order value is 700 €")
- Click Create to save the rule.

Payment methods disabled for order values above 700 €.
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
- Sub condition: shipping after the 7th of March AND
- 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.
- Sub condition: lives in Berlin OR
- 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
ISand selectffrom the dropdown. Specify the timeframe: - Click
+SUB CONDITION, thenorder > createdAt > datetimeOperations > ADD. Selectbeforefrom the dropdown. Pick the date and time from the calendar. - Click ADD CONDITION, then
order > updatedAt > datetimeOperations > ADD. Selectafterfrom 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, thenaddress > shipping > city > ADD. Type a city, for example "Hamburg". - Switch toggle to
OR.
Add free shipping:
- Select the Results: e.g.,
Shipping Options➜DHL Standard|Deactivate Shipping Options- Click Create to save the rule.
Data model explanation
You can access a variety of properties to build your custom rules. Rules can be written on the following standardized data structure. Not all information will be available from beginning to end during the ordering process, for example a shipping address will not yet be available for new customers when evaluating rules for the delivery options filter.
Schema
addressobjectbillingobjectidintegeradditionalstring ([!-ɏ0-9 ]) (optional) - Additional data pertaining to the address, such asc/o AboutYou.citystring ([!-ɏ0-9 ])collectionPointobject (optional) - A collection point is an alternate shipping address, which will hold the customer's packages until pickup. Examples for collection points are DHL Packstations, DHL Post Offices and Hermes Paketshops.customerKeystring ([A-z0-9]) (optional)descriptionstring ([!-ɏ0-9 ]) (optional)keystring ([A-z0-9])typestring
countryCodestring (maximum length: 3)houseNumberstring ([!-ɏ0-9 ])isDefaultobjectbillingbooleanshippingboolean
recipientobjectfirstNamestring ([!-ɏ0-9 ])genderenum (mfd) (optional)lastNamestring ([!-ɏ0-9 ])
referenceKeystring (^[0-9a-zA-Z\-\\_\.\@]*$) (optional) (maximum length: 100) - External reference set by the client to integrate a 3rd party systemstreetstring ([!-ɏ0-9 ])titlestring ([!-ɏ0-9 ]) (optional)zipCodestring ([A-z0-9\- ]{1,12})
shippingobjectidintegeradditionalstring ([!-ɏ0-9 ]) (optional) - Additional data pertaining to the address, such asc/o AboutYou.citystring ([!-ɏ0-9 ])collectionPointobject (optional) - A collection point is an alternate shipping address, which will hold the customer's packages until pickup. Examples for collection points are DHL Packstations, DHL Post Offices and Hermes Paketshops.customerKeystring ([A-z0-9]) (optional)descriptionstring ([!-ɏ0-9 ]) (optional)keystring ([A-z0-9])typestring
countryCodestring (maximum length: 3)houseNumberstring ([!-ɏ0-9 ])isDefaultobjectbillingbooleanshippingboolean
recipientobjectfirstNamestring ([!-ɏ0-9 ])genderenum (mfd) (optional)lastNamestring ([!-ɏ0-9 ])
referenceKeystring (^[0-9a-zA-Z\-\\_\.\@]*$) (optional) (maximum length: 100) - External reference set by the client to integrate a 3rd party systemstreetstring ([!-ɏ0-9 ])titlestring ([!-ɏ0-9 ]) (optional)zipCodestring ([A-z0-9\- ]{1,12})
applicationobjectappIdintegercountryCodestring (maximum length: 3)currencyCodestring (maximum length: 3)devicestringlanguageCodestring (maximum length: 2)
clientobjectcurrentTimestring (date-timevalidation)ipstringlanguageCodestring (optional) (maximum length: 2)locationobject (optional)citystring (optional)countryCodestring (optional) (maximum length: 3)regionstring (optional)
userAgentobject (optional)browserstring (optional)devicestring (optional)platformstring (optional)versionstring (optional)
customerobjectidintegerauthenticationobject (optional)dataobject (optional)accessTokenstring (optional)userIdstring (optional)
typeenum (facebookpassword)
birthDatestring (^((19|20)[0-9]{2}\-[0-9]{2}\-[0-9]{2})$) (optional)customDataobject (optional) (object is extensible as desired) - Additional data attached by the client to enhance the customeremailstring (emailvalidation) (optional) (maximum length: 50)firstNamestring ([!-ɏ0-9 ])genderenum (mfd) (optional)groupsarray (optional)itemstring (^[0-9a-zA-Z\-\\_]*$) (optional) (maximum length: 60)
lastNamestring ([!-ɏ0-9 ])phonestring (00[0-9]{1,3}/[0-9]{1,20}) (optional)publicKeystring (^[0-9a-zA-Z\-\\_]*$) (optional) (maximum length: 100) - Public reference set by the client to display to customers in account areas and transactional emailsreferenceKeystring (^[0-9a-zA-Z\-\\_\.\@]*$) (optional) (maximum length: 100) - External reference set by the client to integrate a 3rd party systemstatusobjectisActivebooleanisGuestCustomerbooleanisTestCustomerboolean
titlestring ([!-ɏ0-9 ]) (optional) (maximum length: 100)typeenum (personalretailorganizationfamily) (optional)createdAtstring (date-timevalidation)updatedAtstring (date-timevalidation)
itemsarrayavailableQuantityinteger (optional) - The number of deliverable items available in the warehouse for immediate shipping.customDataobject (optional) (object is extensible as desired) - customData allows the tennant to attach data to an item. The data will remain attached to the item from the basket through the process of order creation and delegation and may be displayed to the customer during the order lifecycle.deliveryForecastobject (optional) - When an item cannot be shipped within the regular delivery timeframe, and the warehouse is already aware of this, prior to the customer placing the order (ie it is not an unintentionally delayed delivery). This is generally the case when the item is out of stock and: the warehouse is waiting for incoming returns to restock the item, the warehouse has ordered fresh stocks from the supplier/manufacturer and is waiting for these to be shipped to the warehouse.deliverableobjectkeystring (optional)quantityinteger (optional)
subsequentDeliveryobjectkeyenum (endOfJanuaryendOfFebruaryendOfMarchendOfAprilendOfMayendOfJuneendOfJulyendOfAugustendOfSeptemberendOfOctoberendOfNovemberendOfDecembermidOfJanuarymidOfFebruarymidOfMarchmidOfAprilmidOfMaymidOfJunemidOfJulymidOfAugustmidOfSeptembermidOfOctobermidOfNovembermidOfDecembereasterchristmasavailabledirectShippingoutsold) (optional)quantityinteger (optional)
itemGroup**** (optional)keystringpackageIdinteger - Items are grouped by package, depending on the item's supplier configuration. ThepackageIdreferences an entry in the packages list with delivery estimates and expected carrier.priceobject - The price is provided in a currency's lowest denomination (e.g. cent for EUR). In a multi-supplier environment, the price displayed on an item is dictated by the supplier order of preference, which is configured in the SCAYLE Panel.appliedReductionsarray (optional) - The discounts detail the reductions included in the finalprice.withTaxandprice.withoutTaxcalculation.amountobjectabsoluteWithTaxintegerrelativenumber - Therateis calculated on the basis of the reduction in relation to thepreDiscountPriceprice.categoryenum (salecampaignvoucher)typeenum (relativeabsolute)
referenceobject (optional)sizestring (optional)unitstring (optional)withTaxinteger (optional)
taxobject (object is extensible as desired) - List of all taxes applied in calculating theprice.withTax$keyobject (optional)amountnumberratenumber
withoutTaxinteger - This price excludes taxes, but also includes all applicable reductions.withTaxinteger - The price is calculated including taxes and all applicable reductions such as discounts for sale and campaigns (should a campaign key be provdided on the request).
productobjectidinteger - Thisidcan be applied as a parameter on the url to retrieve an individual product in the Fetch Product by ID endpoint.advancedAttributesobject (optional) (object is extensible as desired) - A subset of advanced attributes$key**** (optional)
attributesobject (optional) (object is extensible as desired)$keyobject (optional)keystringlabelstring - The locale is defined by the configuration of the shop associated with the authentication token. Translations of the individual attributes are maintained in the SCAYLE Panel.multiSelectboolean (optional)typestring,null (optional)values****
categoriesarray (optional)categoryHiddenboolean (optional) - If set totrue, this Category is not displayed in the Shop.categoryIdinteger - Thisidcan be applied as a parameter on the url to retrieve an individual category in the Fetch Category by ID endpoint.categoryName****categoryProperties**** (optional)categoryUrl****
definingAttributesarray (optional) - A subset of the attributes groups that distinguish the variants from other variants attached to the product.keystringlabelstring - The locale is defined by the configuration of the shop associated with the authentication token. Translations of the individual attributes are maintained in the SCAYLE Panel.
imagesarrayattributesobject (optional) (object is extensible as desired)hashstring - As the hash is generated with the image data, it can be applied to monitor for changes on the underlying image.
masterKeystring (optional)namestringcreatedAtstring (date-timevalidation)updatedAtstring (date-timevalidation)
reservationKeystring (optional)statusenum (availableunavailabledeliverableundeliverablecancelled)variantobjectidinteger - Thisidcan be applied as a parameter on the url to retrieve an individual variant in the Fetch Variant by ID endpoint.advancedAttributesobject (optional) (object is extensible as desired) - A subset of advanced attributes$key**** (optional)
attributesobject (optional) (object is extensible as desired) - A subset of attributes will always be provided on the variant: those characteristics of a variant that set it apart from the other variants attached to the same product. By applying thewithparameter in the query the returned attributes can be extended at will.$keyobject (optional)keystringlabelstring - The locale is defined by the configuration of the shop associated with the authentication token. Translations for the individual attributes are maintained in the SCAYLE Panel.multiSelectboolean (optional)values****
referenceKeystring (optional)stockobject (optional)customDataobject,array (optional)deliveryForecastobject (optional) - When an item cannot be shipped within the regular delivery timeframe, and the warehouse is already aware of this, prior to the customer placing the order (ie it is not an unintentionally delayed delivery). This is generally the case when the item is out of stock and: the warehouse is waiting for incoming returns to restock the item, the warehouse has ordered fresh stocks from the supplier/manufacturer and is waiting for these to be shipped to the warehouse.deliverableobject (optional)subsequentDeliveryobject (optional)isSellableWithoutStockboolean (optional) - Determines if the given variant is sellable even though it has no stockquantityinteger - Remaining quantity in stock for the given variant. Reserved items have not been deducted from the overall stock count.supplierIdinteger,null
createdAtstring (date-timevalidation)updatedAtstring (date-timevalidation)
warehouseIdinteger (optional)createdAtstring (date-timevalidation)updatedAtstring (date-timevalidation)
orderobjectidinteger - Thisidcan be applied as a parameter on the url to retrieve an individual order in the Fetch Order by ID endpoint.appliedLoyaltyPointsinteger (optional) - Amount of discount loyalty points used for the orderbasketKeystring - Reference to the basket attached to this ordercampaignKeystring (optional) - Reference to the campaign applied to this orderconfirmedAtstring (date-timevalidation) (optional)costobject - The price is provided in a currency's lowest denomination (e.g. cent for EUR). In a multi-supplier environment, the price displayed on an item is dictated by the supplier order of preference, which is configured in the SCAYLE Panel.appliedFeesarray (optional) - TheappliedFeesdetail the additional payment and delivery costs included in the finalprice.withTaxandprice.withoutTaxcalculation.amount****categoryenum (paymentdelivery)keystringoptionstring (optional)
appliedReductionsarray (optional) - The discounts detail the reductions included in the finalprice.withTaxandprice.withoutTaxcalculation.amountobjectabsoluteWithTaxintegerrelativenumber - Therateis calculated on the basis of the reduction in relation to thepreDiscountPriceprice.categoryenum (voucher)typeenum (absolute)
captureinteger (optional) - The total value to be captured excluding reductions (membership loyalty points, giftcard, and voucher discounts)taxobject (object is extensible as desired) - List of all taxes applied in calculating theprice.withTax$keyobject (optional)amountnumberratenumber
withoutServiceCostinteger (optional) - The price is calculated including taxes and all applicable reductions such as discounts for sale and campaigns, but without any service costs.withoutTaxinteger - This price excludes taxes, but also includes all applicable reductions.withTaxinteger - The price is calculated including taxes and all applicable reductions such as discounts for sale and campaigns (should a campaign key be provdided on the request).
currencyCodestring (^([A-Z]{3})$) - The three character ISO-4217 currency code that identifies the currency. The currency is defined on the configuration of the shop, and can be modified in the SCAYLE Panel.customDataobject (optional) (object is extensible as desired) - Additional data attached by the client to enhance the orderreferenceKeystring (^[0-9a-zA-Z\-\\_\.\@]*$) (optional) (maximum length: 100) - External reference set by the client to integrate a 3rd party systemcreatedAtstring (date-timevalidation)updatedAtstring (date-timevalidation)
packagesarrayidinteger - Basket and order items are matched to a package by cross-referencing theitem[].packageId.carrierKeystringdeliveryDateobject - The delivery dates are calculated based on the hour-to-hour estimates configured per supplier in the SCAYLE Panel. Once the order has been confirmed and shipments have been received, the calculation is based on the warehouse cut-off times and transport duration. If the carrier provides a delivery estimate, this is applied.maximumstring ([0-9]{4}\-[0-9]{2}\-[0-9]{2})minimumstring ([0-9]{4}\-[0-9]{2}\-[0-9]{2})
deliveryStatusenum (openshipment_pendingdelegation_pendingshipment_completedcancellation_completed)returnIdentCodenull,string (optional)shipmentKeystring (optional)trackingobject (optional)idstring (optional)urlstring (urivalidation) (optional)
paymentarrayamountinteger (optional)dataobject (optional) (object is extensible as desired)installmentarray (optional) - Details about installmentsamountinteger (optional)typeenum (annualInterestfirstInstallmentinstallmentAdditionpaymentMethodCostssubsequentInstallmentsvalutaAddition) (optional)
keystring (optional)optionsobject (optional)countOfInstallmentsinteger (optional)hasPaybreakboolean (optional)
transactionKeystring (optional)
vouchersarray (optional)idintegerapplicableItemsarray (optional)isAppliedboolean (optional)keystring (optional)
codestring ([A-z0-9]{0,12})typeenum (absoluterelative)valuenumber