# Important principles

**Understanding how campaigns work behind the scenes helps you avoid surprises and set up campaigns that work exactly as intended.**

## The system always picks the best price

Flow Retail automatically finds the lowest price for every product by checking multiple sources, in the following order:

1. **Store price** - if a store-specific price list is set
2. **Chain price** - if a tenant-specific price list is set
3. **Item price** - the price set on the product
4. **Campaign price** - if it is lower than any of the above

You don't need to worry about managing the sorting - this happens automatically ✨

{% hint style="warning" %}

#### **Best price&#x20;*****always*****&#x20;wins**

If you set a campaign price that for some reason is *higher* than an existing price according to the above inheritance, the lowest price wins.
{% endhint %}

## Only *one* campaign applies per product

When a product qualifies for multiple campaigns, the system picks the most beneficial one for the customer.

#### **Example scenario:**

* **Campaign A:** "20% off all products"
* **Campaign B:** "30% off shirts"
* Customer buys a shirt → Gets **Campaign B** (30% off)

The system does this automatically - you don't need to set priorities or worry about conflicts.

## Confirmed orders

If you **Confirm** an order, the prices on the existing order lines are "locked", e.g. wont get new campaign updates if there are relevant changes on the order that would otherwise affect any of the existing order lines.

### Activating campaigns on existing order lines on Confirmed orders

To activate campaign discounts on a confirmed order, simply remove and add the relevant product(s) on that order.

To prevent this from happening, simply don't confirm orders until the customer is ready to pay.

{% hint style="info" %}

#### Tips for developers

Dont confirm orders unless strictly needed, and eventually confirm it after all products are added to the order to make sure all relevant campaigns are applie
{% endhint %}

## Key concepts explained

### Discount Types

#### These determine how the discount is calculated:

* **Price List** Set specific campaign prices on individual products. Use when you want complete control over final prices. *Example: "Summer shorts now $19.99"*
* **Cheapest Product** Give a discount on the cheapest item in a set. Perfect for quantity deals. *Example: "Buy 3, get the cheapest free" or "Buy 2, save 30% on cheapest"*
* **Percent** Take a percentage off qualifying products or the entire order. *Example: "20% off all shoes" or "Members get 15% off everything"*
* **Amount** Take a fixed amount off. *Example: "$10 off orders over $100"*

### Qualified Products

#### Choose which products can receive the discount:

* **Specific products** - Select individual items or categories
* **All products** - Leave empty to include everything

Most campaigns target specific products or categories. Leave this empty only for store-wide campaigns or member discounts that apply to everything.

### Rules

#### Add conditions that must be met for the campaign to activate:

* **Minimum amount** - Order must reach a certain total *Example: "Spend $100 to get 10% off"*
* **Minimum quantity** - Must have X qualifying products in the order *Example: "Buy 3 or more to get discount"*
* **Required products** - Specific products must be in the order *Example: "Buy laptop to get discount on accessories"*

{% hint style="warning" %}

#### **Important regarding minimum amount**

You cannot combine minimum amount rules with qualified products. Choose one or the other.
{% endhint %}

### Customer Groups

#### Limits who can use the campaign:

* **Specific groups** - Members, employees, VIP customers, etc.
* **All customers** - Leave empty for everyone

Use this to create exclusive offers for your best customers or special pricing for employees. If you don't have customer groups set up yet, leave this empty.

## Remember

* [x] The system always finds the best price - you don't need to manage it
* [x] Customers automatically get the best campaign - no stacking needed
* [x] Don't confirm order lines until checkout is complete
* [x] Simpler campaigns are easier to understand and maintain

Understanding these principles helps you create campaigns that work smoothly and avoid common pitfalls.


---

# 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.flowretail.com/docs/extensions-addons/campaign/important-principles.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.
