# Flex promotions

Flex promotions enable you to cover the most comprehensive range of use cases you may need in your promotion strategy.

## Order rules

Flex promotions leverage our [Rules Engine integration](/rules-engine/core-api-integration/order-rules.md) with Commerce Layer Core API and, when triggered, are responsible for adding a discount to the orders involved based on the conditions and actions provided in the associated rules.

<details>

<summary>How-to</summary>

Please refer to the [Rules Engine documentation](https://docs.commercelayer.io/rules-engine/) to learn more about how to set up promotional [rules](/rules-engine/rules.md), define [conditions](/rules-engine/conditions.md) and [actions](/rules-engine/actions.md), browse the most common [use cases](/rules-engine/use-cases/promotions.md), and more.

</details>

{% hint style="info" %}
For performance reasons, `rules`, `rule_outcomes`, and `resource_payload` objects are returned when retrieving a single flex promotion only.
{% endhint %}

## Application scope

Except for the case where you need them to be associated with a coupon, when using flex promotions you're not required to define any [promotion rules](/core-api-reference/promotion_rules.md), set a currency code, or associate a specific market. Just use the `rules` JSON object to define how and when the flex promotion should be applied.

## Discount calculation and distribution

The total discount due to flex promotions is calculated and distributed on the matching line items, based on the conditions and actions provided in the associated rules.


---

# 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/core-api-reference/flex_promotions.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.
