Need to create rules based on bundles?
Learn more
LogoLogo
APIsChangelog
  • Getting started
  • Rules
  • Conditions
    • Scope
    • Aggregations
    • Nested
    • Dynamic values
  • Actions
    • Types
      • Percentage
      • Fixed amount
      • Fixed price
      • Buy X pay Y
      • Every X discount Y
    • Bundle
      • Balanced
      • Every
    • Aggregation
    • Limit
  • Matchers
  • Operators
  • Check and validation
  • Core API integration
    • Order rules
    • Price rules
    • Virtual relationships
  • Resources
    • Promotions
    • Price lists
  • Use cases
    • Promotions
      • Discount line items based on item's price
      • Get a discount when paying by credit card
      • Discount an order based on promo item and total number of items
      • Offer a specific shipping method for free in a specific country
      • Discount items with large stock availability
      • Discount all the SKU in an order based on the shipping country
      • Discount all the SKU in an order based on the customer email domain
    • Price lists
      • Discount all prices greater than or equal to a specific value
      • Discount specific SKUs for new clients
      • Change strike-through price based on customer email domain
On this page

Getting started

An overview of the Domain-Specific Language (DSL) used for defining rules and their respective conditions and actions within the Commerce Layer Rules Engine

NextRules

Last updated 3 months ago

The Commerce Layer Rules Engine is a Domain-Specific Language (DSL) used for defining rules that can support from the simplest to the most complex logic. The can be evaluated against a specific payload to check if the requested are met so that the respective will be applied.

Core API integration

The Rules Engine is currently with Commerce Layer to enable the creation and management of a super-flexible promotional system that covers a wide set of .

The Rules Engine integration is currently enabled for a subset of : at the moment and are available (more to come).

When defining fields and selectors for the and of a , use the to navigate the relationship tree down to the desired attribute or related resource of Commerce Layer Core API. For more information explore the and , or double-check the public .

Most of the examples and JSON snippets used in the following sections to illustrate how the Rules Engine works refer to . You can easily use them as a reference to create or other rules related to any possible future Rule Engine integrations.

The Rules Engine integration is still in beta and available only to our enterprise customers. If you're one of them and want to test and leverage its functionalities reach out to us and request to be part of the beta program.

rules
actions
integrated
use cases
resources
conditions
actions
rule
dot notation
data model
resources schema
order rules
price rules
conditions
promotions
price lists
Core API
API reference