> For the complete documentation index, see [llms.txt](https://docs.commercelayer.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.commercelayer.io/rules-engine/readme.md).

# 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

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 [rules](/rules-engine/rules.md) can be evaluated against a specific payload to check if the requested [conditions](/rules-engine/conditions.md) are met so that the respective [actions](/rules-engine/actions.md) will be applied.

## Core API integration

The Rules Engine is currently [integrated](/rules-engine/core-api-integration/order-rules.md) with Commerce Layer [Core API](https://docs.commercelayer.io/core/) to enable the creation and management of a super-flexible promotional system that covers a wide set of [use cases](/rules-engine/use-cases/promotions.md).

The Rules Engine integration is currently enabled for a subset of [resources](/rules-engine/resources/promotions.md): at the moment [promotions](/rules-engine/resources/promotions.md) and [price lists](/rules-engine/resources/price-lists.md) are available (more to come).

{% hint style="success" %}
When defining fields and selectors for the [conditions](/rules-engine/conditions.md) and [actions](/rules-engine/actions.md) of a [rule](/rules-engine/rules.md), use the [dot notation](https://idratherbewriting.com/learnapidoc/docapis_diving_into_dot_notation.html) to navigate the relationship tree down to the desired attribute or related resource of Commerce Layer Core API. For more information explore the [data model](https://docs.commercelayer.io/data-model/) and [API reference](https://docs.commercelayer.io/core-api-reference/), or double-check the public [resources schema](https://core.commercelayer.io/api/public/resources.json).
{% endhint %}

{% hint style="info" %}
Most of the examples and JSON snippets used in the following sections to illustrate how the Rules Engine works refer to [order rules](/rules-engine/core-api-integration/order-rules.md). You can easily use them as a reference to create [price rules](/rules-engine/core-api-integration/price-rules.md) or other rules related to any possible future Rule Engine integrations.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.commercelayer.io/rules-engine/readme.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
