# Getting started

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](#conditions) are met so that the respective [actions](/rules-engine/actions.md) will be applied.

{% hint style="success" icon="robot" %}
Commerce Layer documentation is [LLM-ready](/readme.md#llm-friendly)! To feed the knowledge base into your own LLM, read [this file](https://docs.commercelayer.io/llms.txt).
{% endhint %}

## 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](#order-rules) and [price lists](#price-rules) 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://commercelayer.io/docs/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: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

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

The question should be specific, self-contained, and written in natural language.
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.
