> For the complete documentation index, see [llms.txt](https://docs.akinon.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.akinon.com/technical-guides/commerce/consume-group-in-campaigns.md).

# Consume Group in Campaigns

The Akinon campaign system supports **two distinct consumption modes** when multiple campaigns are applied to basket items:

1. **Without Consume Group** (Condition Application Group) – **Combinable** campaigns are allowed to combine freely, even if they consume the same basket items. The exception is a campaign whose **Condition Application Type** is **“Products affected by the campaign cannot be included in other campaigns.”**: campaigns evaluated after it cannot use the items it counts toward its condition or discounts from the condition collection, unless their Application Type is **“The campaign is implemented independently of other campaigns.”** in both the Campaign Conditions and Campaign Action tabs (see [Combining Campaigns](https://docs.akinon.com/technical-guides/commerce/promotions.md#combining-campaigns), including the case where the Action tab uses a different collection).
2. **With Consume Group** (Condition Application Group) – Campaigns are restricted to consume items sequentially within the same group, preventing overlapping usage of the same products.

A campaign is considered *combinable* when the **“Can be combined with other campaigns”** checkbox is enabled; the **“Condition Application Type”** does not change this. The Condition Application Type decides whether the campaign's products remain available to the campaigns evaluated after it. With “The campaign is implemented independently of other campaigns.” (in both the Campaign Conditions and Campaign Action tabs), the campaign can also use products that an earlier campaign has taken.

To set up the campaigns in the examples below:

* In the **Campaign Information** tab, the **“Can be combined with other campaigns”** checkbox must be enabled.

  <figure><img src="https://2911598027-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlQinVPnOffBiOp126ldR%2Fuploads%2Fgit-blob-673b4956dbe30c36961b4333e8feceacc88e3e7c%2Funknown.png?alt=media" alt=""><figcaption></figcaption></figure>
* In the **Campaign Conditions** tab, set the **“Condition Application Type”** to **“Campaign products can be included in other campaigns.”** if the campaign's products should remain available to other campaigns.

  <figure><img src="https://2911598027-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlQinVPnOffBiOp126ldR%2Fuploads%2Fgit-blob-c03de54d752c30b13c05e01ef1f4e8e6dad7c535%2Funknown.png?alt=media" alt=""><figcaption></figcaption></figure>

Both approaches are valid and intentional. The choice depends on the business rules and how marketers want multiple campaigns to interact in practice.

To better understand these modes, let’s walk through two real-life examples. The first scenario demonstrates a simple *Buy X, Pay for Y* campaign, while the second focuses on *quantity-based percentage discounts*.

## <mark style="color:red;">**Example Basket 1 – Buy 3, Pay for 2**</mark>

* Product A × 5

The basket contains 5 items of the same product.

#### **Active Campaigns**

1. **Campaign 1**: “Buy 3, Pay for 2” *(combinable with other campaigns: checkbox enabled, condition type set to ‘Campaign products can be included in other campaigns.’)*
2. **Campaign 2**: “Buy 3, Pay for 2” *(combinable with other campaigns: checkbox enabled, condition type set to ‘Campaign products can be included in other campaigns.’)*

Both campaigns share the same structure and are marked as combinable.

<figure><img src="https://2911598027-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlQinVPnOffBiOp126ldR%2Fuploads%2Fgit-blob-9d3478e94d7740ace51819ed965e942b7fe3aa8f%2Funknown.png?alt=media" alt=""><figcaption></figcaption></figure>

### <mark style="color:red;">**Mode 1 – Without Consume Group**</mark>

When the **Consume Group feature is not used**, campaigns marked as *combinable* can both be applied, even if they share the same condition and discount structure.

* **Campaign 1** consumes 3 of the 5 items and applies its discount.
* **Campaign 2** also consumes 3 of the 5 items and applies its discount.

<figure><img src="https://2911598027-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlQinVPnOffBiOp126ldR%2Fuploads%2Fgit-blob-6d031b91501e8c125cf95efa5eb671f70717b618%2Funknown.png?alt=media" alt=""><figcaption></figcaption></figure>

**Result:** Both campaigns are applied on the same set of items. This behavior is correct in this mode because the system interprets *combinable* literally — campaigns do not block each other, and all eligible ones can be triggered simultaneously.

### <mark style="color:red;">**Mode 2 – With Consume Group**</mark>

To enable controlled consumption, the system provides **Consume Group logic**.

#### **Step 1 – Enable Dynamic Setting**

Set the `BASKET_OFFER_IS_CONSUME_GROUP_ENABLED` dynamic setting to **Yes**.

<figure><img src="https://2911598027-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlQinVPnOffBiOp126ldR%2Fuploads%2Fgit-blob-8ef8c6ad304a18c511805cdb0a3f1f7f82ca616d%2Funknown.png?alt=media" alt=""><figcaption></figcaption></figure>

This adds a new field, **Condition Application Group**, to the Campaign Conditions tab.

#### **Step 2 – Assign to Same Group**

For the **Consume** mechanism to take effect, the campaigns must first be explicitly assigned to the **same group** (e.g., `group1`) by giving the **Condition Application Group** field any unique identifier. Once campaigns are grouped under the same identifier, the evaluation process changes:

* The campaigns are no longer treated as independent and parallel promotions.
* Instead, they are processed **sequentially**, following the **priority values** defined for each campaign.
* The campaign with the **higher priority value** is evaluated first. The next campaign in the group can use only the items the higher-priority campaign has left; if too few remain for its condition, it does not apply. For example, with two *Buy 3, Pay for 2* campaigns in the same group, a basket with 5 items of a product receives only the higher-priority campaign, while a basket with 6 items receives both.
* If the first campaign only partially consumes the conditions, the system continues to evaluate the next campaign(s) in the group until all applicable conditions are exhausted.

This ensures that **only one campaign per group can be applied at a time**, unless there is remaining eligibility after the higher-priority campaign has been evaluated.

<figure><img src="https://2911598027-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlQinVPnOffBiOp126ldR%2Fuploads%2Fgit-blob-bed376e29d0ce810e7c9b4e3cd8694346d538b7e%2Funknown.png?alt=media" alt=""><figcaption></figcaption></figure>

#### **Basket Evaluation with Consume Group**

**Case A – Basket with 5 Items**

* **Campaign 1** consumes 3 out of 5 items and applies its discount.
* Only 2 items remain, so **Campaign 2** cannot meet its condition.
* **Result:** Only Campaign 1 is applied.

<figure><img src="https://2911598027-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlQinVPnOffBiOp126ldR%2Fuploads%2Fgit-blob-24275c75a896d59a9c9497be6b5868f7b7b3950a%2Funknown.png?alt=media" alt=""><figcaption></figcaption></figure>

**Case B – Basket with 6 Items**

* **Campaign 1** consumes 3 out of 6 items and applies its discount.
* **Campaign 2** then finds 3 items still available and applies its discount.
* **Result:** Both campaigns are applied, but only when there are enough items to satisfy both independently.

<figure><img src="https://2911598027-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlQinVPnOffBiOp126ldR%2Fuploads%2Fgit-blob-246a8ea8cbabe57c44c5e9e439d28cb5e028d791%2Funknown.png?alt=media" alt=""><figcaption></figcaption></figure>

## <mark style="color:red;">**Example Basket 2 – Quantity-Based Percentage Discounts**</mark>

While the first basket scenario highlights how consume logic affects identical promotions with the same threshold, real-world campaigns often involve **tiered benefits** — for example, different discount percentages based on different quantity thresholds. The following scenario demonstrates how consume groups work in this more layered setup.

* Product A × 10
* Product B × 7\
  **Total: 17 items**

#### **Active Campaigns**

1. **Campaign 1**: Buy 10 or more items → Get **10% discount** *(combinable with other campaigns: checkbox enabled, condition type set to ‘Campaign products can be included in other campaigns.’)*
2. **Campaign 2**: Buy 15 or more items → Get **20% discount** *(combinable with other campaigns: checkbox enabled, condition type set to ‘Campaign products can be included in other campaigns.’)*

### <mark style="color:red;">**Mode 1 – Without Consume Group**</mark>

If no consume group is defined, both campaigns are eligible to run:

* Basket contains **17 items**, which satisfies both conditions.
* **Campaign 1** applies 10% discount.
* **Campaign 2** applies 20% discount.

**Result:** Both campaigns apply on the same basket, and the customer benefits from both discounts.

This is correct behavior in **without consume group** mode, since campaigns marked as *combinable* can overlap without restrictions.

### <mark style="color:red;">**Mode 2 – With Consume Group**</mark>

To ensure that only one campaign applies at a time, while still keeping them combinable with other unrelated campaigns, both campaigns should be placed in the same consume group (e.g., `group2`).

Additionally, enable the `BASKET_OFFER_IS_CONSUME_GROUP_ENABLED` dynamic setting by selecting **Yes** so that the **Condition Application Group** field is available in the campaign conditions.

Also, set the “Priority” values: the campaign with the higher priority value applies first.

* **Campaign 1** (10 items, 10% discount): Lower priority
* **Campaign 2** (15 items, 20% discount): Higher priority

#### **Basket Evaluation with Consume Group**

**Case A – Basket with 17 Items**

* Basket satisfies both conditions.
* Since campaigns are in the same consume group, only the **higher-priority campaign** applies.
* **Result:** 20% discount from Campaign 2 is applied, Campaign 1 is skipped.

**Case B – Basket with 25 Items**

* Basket satisfies both conditions multiple times.
* **Campaign 2** (higher priority) applies its 20% discount to all 25 items.
* **Campaign 1** is skipped, because it is in the same consume group.
* **Result:** Only Campaign 2 applies. For example, 25 items priced 10 TRY each receive a 50 TRY discount.

## <mark style="color:red;">**Comparison of the Two Modes**</mark>

<table><thead><tr><th width="193.30859375">Aspect</th><th width="221.9296875">Without Consume Group</th><th>With Consume Group</th></tr></thead><tbody><tr><td><strong>Campaign Interaction</strong></td><td>Combinable campaigns can overlap</td><td>Campaigns respect group restrictions</td></tr><tr><td><strong>Item Consumption</strong></td><td>Same items can be reused by multiple campaigns, except after a campaign whose Condition Application Type is “Products affected by the campaign cannot be included in other campaigns.”; after it, only campaigns applied independently (in both the Campaign Conditions and Campaign Action tabs) can reuse them (see <a href="https://docs.akinon.com/technical-guides/commerce/promotions.md#combining-campaigns">Combining Campaigns</a> for an Action tab with a different collection)</td><td>Items are consumed sequentially and cannot be reused</td></tr><tr><td><strong>Use Case</strong></td><td>Aggressive promotions, maximum stacking</td><td>Controlled promotions, fair distribution of discounts</td></tr></tbody></table>


---

# 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.akinon.com/technical-guides/commerce/consume-group-in-campaigns.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.
