
---
## Promotions
---
### Get all promotions of a customer
---
This method retrieves all available promotions that are defined for a customer.


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

The API key must have the `PROMOTIONS_DETAILS_FOR_CLIENT_READ` permission from the **Client** group.

</div></div></div>

**Declared In:**  
lib/modules/promotions/promotions_impl.dart
  
**Related To:**  
[PromotionResponse](/developers/mobile-sdk/class-reference/flutter/promotions-and-vouchers#promotionresponse)
  
**Class:**  
[PromotionsImpl](/developers/mobile-sdk/class-reference/flutter/modules#promotions)


<div class="content-tabs" data-tab-group="tabgrp-933">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-933-0" data-tab-group="tabgrp-933" data-tab-active="true">SDK &gt;= 1.0.0</button><button class="tab-button" data-tab-id="tabgrp-933-1" data-tab-group="tabgrp-933">Legacy SDK</button></div>

<div class="tab-panel" data-tab-id="tabgrp-933-0" data-tab-group="tabgrp-933" data-tab-active="true">

**Declaration:**  

<pre><code class="language-Dart">Future&lt;void&gt; getAllPromotions(
      {required void Function(PromotionResponse promotionResponse) onSuccess,
      required void Function(SyneriseError error) onError}) async</code></pre>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **onSuccess** | Function([PromotionResponse](/developers/mobile-sdk/class-reference/flutter/promotions-and-vouchers#promotionresponse) promotionResponse) | yes | - | Function to be executed when the operation is completed successfully |
| **onError** | Function([SyneriseError](/developers/mobile-sdk/class-reference/flutter/miscellaneous#syneriseerror) error) | yes | - | Function to be executed when the operation is completed with an error |

**Return Value:**  
No value is returned.
  
**Example:**  

<pre><code class="language-Dart">await Synerise.promotions.getAllPromotions(onSuccess: (PromotionResponse promotionResponse) {
      //onSuccess handling
    }, onError: (SyneriseError error) {
      //onError handling
    });</code></pre>

</div>

<div class="tab-panel" data-tab-id="tabgrp-933-1" data-tab-group="tabgrp-933">

**Declaration:**  

<pre><code class="language-Dart">Future&lt;PromotionResponse&gt; getAllPromotions() async</code></pre>


**Return Value:**  
[PromotionResponse](/developers/mobile-sdk/class-reference/flutter/promotions-and-vouchers#promotionresponse)
  
**Example:**  

<pre><code class="language-Dart">await Synerise.promotions.getAllPromotions().catchError((error) {
      //onError handling
    });</code></pre>

</div>
</div>
 

### Get promotions with query parameters
---
This method retrieves promotions that match the parameters defined in an API query.


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

The API key must have the `PROMOTIONS_DETAILS_FOR_CLIENT_READ` permission from the **Client** group.

</div></div></div>

**Declared In:**  
lib/modules/promotions/promotions_impl.dart

**Related To:**  
[PromotionsApiQuery](/developers/mobile-sdk/class-reference/flutter/promotions-and-vouchers#promotionsapiquery)  
[PromotionResponse](/developers/mobile-sdk/class-reference/flutter/promotions-and-vouchers#promotionresponse)

**Class:**  
[PromotionsImpl](/developers/mobile-sdk/class-reference/flutter/modules#promotions)


<div class="content-tabs" data-tab-group="tabgrp-934">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-934-0" data-tab-group="tabgrp-934" data-tab-active="true">SDK &gt;= 1.0.0</button><button class="tab-button" data-tab-id="tabgrp-934-1" data-tab-group="tabgrp-934">Legacy SDK</button></div>

<div class="tab-panel" data-tab-id="tabgrp-934-0" data-tab-group="tabgrp-934" data-tab-active="true">

**Declaration:**  

<pre><code class="language-Dart">Future&lt;void&gt; getPromotions(PromotionsApiQuery apiQuery,
      {required void Function(PromotionResponse promotionResponse) onSuccess,
      required void Function(SyneriseError error) onError}) async</code></pre>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **apiQuery** | [PromotionsApiQuery](/developers/mobile-sdk/class-reference/flutter/promotions-and-vouchers#promotionsapiquery) | yes | - | Object that stores all query parameters |
| **onSuccess** | Function([PromotionResponse](/developers/mobile-sdk/class-reference/flutter/promotions-and-vouchers#promotionresponse) promotionResponse) | yes | - | Function to be executed when the operation is completed successfully |
| **onError** | Function([SyneriseError](/developers/mobile-sdk/class-reference/flutter/miscellaneous#syneriseerror) error) | yes | - | Function to be executed when the operation is completed with an error |

**Return Value:**  
No value is returned.

**Example:**  

<pre><code class="language-Dart">await Synerise.promotions.getPromotions(promotionsApiQuery, onSuccess: (PromotionResponse promotionResponse) {
      //onSuccess handling
    }, onError: (SyneriseError error) {
      //onError handling
    });</code></pre>

</div>

<div class="tab-panel" data-tab-id="tabgrp-934-1" data-tab-group="tabgrp-934">

**Declaration:**  

<pre><code class="language-Dart">Future&lt;PromotionResponse&gt; getPromotions(PromotionsApiQuery apiQuery) async</code></pre>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **apiQuery** | [PromotionsApiQuery](/developers/mobile-sdk/class-reference/flutter/promotions-and-vouchers#promotionsapiquery) | yes | - | Object that stores all query parameters |

**Return Value:**  
[PromotionResponse](/developers/mobile-sdk/class-reference/flutter/promotions-and-vouchers#promotionresponse)

**Example:**  

<pre><code class="language-Dart">await Synerise.promotions.getPromotions(promotionsApiQuery).catchError((error) {
      //onError handling
    });</code></pre>

</div>
</div>
 

### Get promotion by UUID
---
This method retrieves the promotion with the specified UUID.


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

The API key must have the `PROMOTIONS_DETAILS_FOR_CLIENT_READ` permission from the **Client** group.

</div></div></div>

**Declared In:**  
lib/modules/promotions/promotions_impl.dart

**Class:**  
[PromotionsImpl](/developers/mobile-sdk/class-reference/flutter/modules#promotions)


<div class="content-tabs" data-tab-group="tabgrp-935">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-935-0" data-tab-group="tabgrp-935" data-tab-active="true">SDK &gt;= 1.0.0</button><button class="tab-button" data-tab-id="tabgrp-935-1" data-tab-group="tabgrp-935">Legacy SDK</button></div>

<div class="tab-panel" data-tab-id="tabgrp-935-0" data-tab-group="tabgrp-935" data-tab-active="true">

**Declaration:**  

<pre><code class="language-Dart">Future&lt;void&gt; getPromotionByUUID(String uuid,
      {required void Function(Promotion promotion) onSuccess,
      required void Function(SyneriseError error) onError}) async</code></pre>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **uuid** | String | yes | - | UUID of the promotion |
| **onSuccess** | Function([Promotion](/developers/mobile-sdk/class-reference/flutter/promotions-and-vouchers#promotion) promotion) | yes | - | Function to be executed when the operation is completed successfully |
| **onError** | Function([SyneriseError](/developers/mobile-sdk/class-reference/flutter/miscellaneous#syneriseerror) error) | yes | - | Function to be executed when the operation is completed with an error |

**Return Value:**  
No value is returned.

**Example:**  

<pre><code class="language-Dart">await Synerise.promotions.getPromotionByUUID(uuid, onSuccess: (Promotion promotion) {
      //onSuccess handling
    }, onError: (SyneriseError error) {
      //onError handling
    });</code></pre>

</div>

<div class="tab-panel" data-tab-id="tabgrp-935-1" data-tab-group="tabgrp-935">

**Declaration:**  

<pre><code class="language-Dart">Future&lt;Promotion&gt; getPromotionByUUID(String uuid) async</code></pre>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **uuid** | String | yes | - | UUID of the promotion |

**Return Value:**  
[Promotion](/developers/mobile-sdk/class-reference/flutter/promotions-and-vouchers#promotion)

**Example:**  

<pre><code class="language-Dart">await Synerise.promotions.getPromotionByUUID(uuid).catchError((error) {
      //onError handling
    });</code></pre>

</div>
</div>
 

### Get promotion by code
---
This method retrieves the promotion with the specified code.


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

The API key must have the `PROMOTIONS_DETAILS_FOR_CLIENT_READ` permission from the **Client** group.

</div></div></div>

**Declared In:**  
lib/modules/promotions/promotions_impl.dart
  
**Related To:**  
[Promotion](/developers/mobile-sdk/class-reference/flutter/promotions-and-vouchers#promotion)
  
**Class:**  
[PromotionsImpl](/developers/mobile-sdk/class-reference/flutter/modules#promotions)


<div class="content-tabs" data-tab-group="tabgrp-936">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-936-0" data-tab-group="tabgrp-936" data-tab-active="true">SDK &gt;= 1.0.0</button><button class="tab-button" data-tab-id="tabgrp-936-1" data-tab-group="tabgrp-936">Legacy SDK</button></div>

<div class="tab-panel" data-tab-id="tabgrp-936-0" data-tab-group="tabgrp-936" data-tab-active="true">

**Declaration:**  

<pre><code class="language-Dart">Future&lt;void&gt; getPromotionByCode(String code,
      {required void Function(Promotion promotion) onSuccess,
      required void Function(SyneriseError error) onError}) async</code></pre>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **code** | String | yes | - | Code of the promotion |
| **onSuccess** | Function([Promotion](/developers/mobile-sdk/class-reference/flutter/promotions-and-vouchers#promotion) promotion) | yes | - | Function to be executed when the operation is completed successfully |
| **onError** | Function([SyneriseError](/developers/mobile-sdk/class-reference/flutter/miscellaneous#syneriseerror) error) | yes | - | Function to be executed when the operation is completed with an error |

**Return Value:**  
No value is returned.

**Example:**  

<pre><code class="language-Dart">await Synerise.promotions.getPromotionByCode(code, onSuccess: (Promotion promotion) {
      //onSuccess handling
    }, onError: (SyneriseError error) {
      //onError handling
    });</code></pre>

</div>

<div class="tab-panel" data-tab-id="tabgrp-936-1" data-tab-group="tabgrp-936">

**Declaration:**  

<pre><code class="language-Dart">Future&lt;Promotion&gt; getPromotionByCode(String code) async</code></pre>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **code** | String | yes | - | Code of the promotion |

**Return Value:**  
[Promotion](/developers/mobile-sdk/class-reference/flutter/promotions-and-vouchers#promotion)

**Example:**  

<pre><code class="language-Dart">await Synerise.promotions.getPromotionByCode(code).catchError((error) {
      //onError handling
    });</code></pre>

</div>
</div>
 

### Activate promotion by UUID
---
This method activates the promotion with the specified UUID.


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

The API key must have the `PROMOTIONS_ACTIVATE_PROMOTIONS_UPDATE` permission from the **Promotions** group.

</div></div></div>

**Declared In:**  
lib/modules/promotions/promotions_impl.dart

**Class:**  
[PromotionsImpl](/developers/mobile-sdk/class-reference/flutter/modules#promotions)


<div class="content-tabs" data-tab-group="tabgrp-937">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-937-0" data-tab-group="tabgrp-937" data-tab-active="true">SDK &gt;= 1.0.0</button><button class="tab-button" data-tab-id="tabgrp-937-1" data-tab-group="tabgrp-937">Legacy SDK</button></div>

<div class="tab-panel" data-tab-id="tabgrp-937-0" data-tab-group="tabgrp-937" data-tab-active="true">

**Declaration:**  

<pre><code class="language-Dart">Future&lt;void&gt; activatePromotionByUUID(String uuid,
      {required void Function() onSuccess,
      required void Function(SyneriseError error) onError}) async</code></pre>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **uuid** | String | yes | - | UUID of the promotion |
| **onSuccess** | Function() | yes | - | Function to be executed when the operation is completed successfully |
| **onError** | Function([SyneriseError](/developers/mobile-sdk/class-reference/flutter/miscellaneous#syneriseerror) error) | yes | - | Function to be executed when the operation is completed with an error |

**Return Value:**  
No value is returned.
  
**Example:**  

<pre><code class="language-Dart">await Synerise.promotions.activatePromotionByUUID(uuid, onSuccess: () {
      //onSuccess handling
    }, onError: (SyneriseError error) {
      //onError handling
    });</code></pre>

</div>

<div class="tab-panel" data-tab-id="tabgrp-937-1" data-tab-group="tabgrp-937">

**Declaration:**  

<pre><code class="language-Dart">Future&lt;void&gt; activatePromotionByUUID(String uuid) async</code></pre>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **uuid** | String | yes | - | UUID of the promotion |

**Return Value:**  
No value is returned.
  
**Example:**  

<pre><code class="language-Dart">await Synerise.promotions.activatePromotionByUUID(uuid).catchError((error) {
      //onError handling
    });</code></pre>

</div>
</div>
 

### Activate promotion by code
---
This method activates the promotion with the specified code.


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

The API key must have the `PROMOTIONS_ACTIVATE_PROMOTIONS_UPDATE` permission from the **Promotions** group.

</div></div></div>

**Declared In:**  
lib/modules/promotions/promotions_impl.dart

**Class:**  
[PromotionsImpl](/developers/mobile-sdk/class-reference/flutter/modules#promotions)


<div class="content-tabs" data-tab-group="tabgrp-938">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-938-0" data-tab-group="tabgrp-938" data-tab-active="true">SDK &gt;= 1.0.0</button><button class="tab-button" data-tab-id="tabgrp-938-1" data-tab-group="tabgrp-938">Legacy SDK</button></div>

<div class="tab-panel" data-tab-id="tabgrp-938-0" data-tab-group="tabgrp-938" data-tab-active="true">

**Declaration:**  

<pre><code class="language-Dart">Future&lt;void&gt; activatePromotionByCode(String code,
      {required void Function() onSuccess,
      required void Function(SyneriseError error) onError}) async</code></pre>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **code** | String | yes | - | Code of the promotion |
| **onSuccess** | Function() | yes | - | Function to be executed when the operation is completed successfully |
| **onError** | Function([SyneriseError](/developers/mobile-sdk/class-reference/flutter/miscellaneous#syneriseerror) error) | yes | - | Function to be executed when the operation is completed with an error |

**Return Value:**  
No value is returned.
  
**Example:**  

<pre><code class="language-Dart">await Synerise.promotions.activatePromotionByCode(code, onSuccess: () {
      //onSuccess handling
    }, onError: (SyneriseError error) {
      //onError handling
    });</code></pre>

</div>

<div class="tab-panel" data-tab-id="tabgrp-938-1" data-tab-group="tabgrp-938">

**Declaration:**  

<pre><code class="language-Dart">Future&lt;void&gt; activatePromotionByCode(String code) async</code></pre>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **code** | String | yes | - | Code of the promotion |

**Return Value:**  
No value is returned.
  
**Example:**  

<pre><code class="language-Dart">await Synerise.promotions.activatePromotionByCode(code).catchError((error) {
      //onError handling
    });</code></pre>

</div>
</div>


### Activate promotions in a batch
---
This method activates promotions with a code or with UUID in a batch.


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

The API key must have the `PROMOTIONS_ACTIVATE_PROMOTIONS_UPDATE` permission from the **Promotions** group.

</div></div></div>

**Declared In:**  
lib/modules/promotions/promotions_impl.dart

**Related To:**  
[PromotionIdentifier](/developers/mobile-sdk/class-reference/flutter/promotions-and-vouchers#promotionidentifier)

**Class:**  
[PromotionsImpl](/developers/mobile-sdk/class-reference/flutter/modules#promotions)  


<div class="content-tabs" data-tab-group="tabgrp-939">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-939-0" data-tab-group="tabgrp-939" data-tab-active="true">SDK &gt;= 1.0.0</button><button class="tab-button" data-tab-id="tabgrp-939-1" data-tab-group="tabgrp-939">Legacy SDK</button></div>

<div class="tab-panel" data-tab-id="tabgrp-939-0" data-tab-group="tabgrp-939" data-tab-active="true">

**Declaration:**  

<pre><code class="language-Dart">Future&lt;void&gt; activatePromotionsBatch(List&lt;PromotionIdentifier&gt; promotionsToActivate,
      {required void Function() onSuccess,
      required void Function(SyneriseError error) onError}) async</code></pre>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **promotionsToActivate** | List<[PromotionIdentifier](/developers/mobile-sdk/class-reference/flutter/promotions-and-vouchers#promotionidentifier)> | yes | - | List of promotion identifiers |
| **onSuccess** | Function() | yes | - | Function to be executed when the operation is completed successfully |
| **onError** | Function([SyneriseError](/developers/mobile-sdk/class-reference/flutter/miscellaneous#syneriseerror) error) | yes | - | Function to be executed when the operation is completed with an error |

**Return Value:**  
No value is returned.
  
**Example:**  

<pre><code class="language-Dart">await Synerise.promotions.activatePromotionsBatch(promotionIdentifierList, onSuccess: () {
      //onSuccess handling
    }, onError: (SyneriseError error) {
      //onError handling
    });</code></pre>

</div>

<div class="tab-panel" data-tab-id="tabgrp-939-1" data-tab-group="tabgrp-939">

**Declaration:**  

<pre><code class="language-Dart">Future&lt;void&gt; activatePromotionsBatch(List&lt;PromotionIdentifier&gt; promotionsToActivate) async</code></pre>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **promotionsToActivate** | List<[PromotionIdentifier](/developers/mobile-sdk/class-reference/flutter/promotions-and-vouchers#promotionidentifier)> | yes | - | List of promotion identifiers |

**Return Value:**  
No value is returned.
  
**Example:**  

<pre><code class="language-Dart">await Synerise.promotions.activatePromotionsBatch(promotionIdentifierList).catchError((error) {
      //onError handling
    });</code></pre>

</div>
</div>
  

### Deactivate promotion by UUID
---
This method deactivates the promotion with the specified UUID.


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

The API key must have the `PROMOTIONS_DEACTIVATE_PROMOTIONS_UPDATE` permission from the **Promotions** group.

</div></div></div>

**Declared In:**  
lib/modules/promotions/promotions_impl.dart

**Class:**  
[PromotionsImpl](/developers/mobile-sdk/class-reference/flutter/modules#promotions)


<div class="content-tabs" data-tab-group="tabgrp-940">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-940-0" data-tab-group="tabgrp-940" data-tab-active="true">SDK &gt;= 1.0.0</button><button class="tab-button" data-tab-id="tabgrp-940-1" data-tab-group="tabgrp-940">Legacy SDK</button></div>

<div class="tab-panel" data-tab-id="tabgrp-940-0" data-tab-group="tabgrp-940" data-tab-active="true">

**Declaration:**  

<pre><code class="language-Dart">Future&lt;void&gt; deactivatePromotionByUUID(String uuid,
      {required void Function() onSuccess,
      required void Function(SyneriseError error) onError}) async</code></pre>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **uuid** | String | yes | - | UUID of the promotion |
| **onSuccess** | Function() | yes | - | Function to be executed when the operation is completed successfully |
| **onError** | Function([SyneriseError](/developers/mobile-sdk/class-reference/flutter/miscellaneous#syneriseerror) error) | yes | - | Function to be executed when the operation is completed with an error |

**Return Value:**  
No value is returned.
  
**Example:**  

<pre><code class="language-Dart">await Synerise.promotions.deactivatePromotionByUUID(uuid, onSuccess: () {
      //onSuccess handling
    }, onError: (SyneriseError error) {
      //onError handling
    });</code></pre>

</div>

<div class="tab-panel" data-tab-id="tabgrp-940-1" data-tab-group="tabgrp-940">

**Declaration:**  

<pre><code class="language-Dart">Future&lt;void&gt; deactivatePromotionByUUID(String uuid) async</code></pre>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **uuid** | String | yes | - | UUID of the promotion |

**Return Value:**  
No value is returned.
  
**Example:**  

<pre><code class="language-Dart">await Synerise.promotions.deactivatePromotionByUUID(uuid).catchError((error) {
      //onError handling
    });</code></pre>

</div>
</div>
 

### Deactivate promotion by code
---
This method deactivates the promotion with the specified code.


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

The API key must have the `PROMOTIONS_DEACTIVATE_PROMOTIONS_UPDATE` permission from the **Promotions** group.

</div></div></div>

**Declared In:**  
lib/modules/promotions/promotions_impl.dart

**Class:**  
[PromotionsImpl](/developers/mobile-sdk/class-reference/flutter/modules#promotions)


<div class="content-tabs" data-tab-group="tabgrp-941">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-941-0" data-tab-group="tabgrp-941" data-tab-active="true">SDK &gt;= 1.0.0</button><button class="tab-button" data-tab-id="tabgrp-941-1" data-tab-group="tabgrp-941">Legacy SDK</button></div>

<div class="tab-panel" data-tab-id="tabgrp-941-0" data-tab-group="tabgrp-941" data-tab-active="true">

**Declaration:**  

<pre><code class="language-Dart">Future&lt;void&gt; deactivatePromotionByCode(String code,
      {required void Function() onSuccess,
      required void Function(SyneriseError error) onError}) async</code></pre>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **code** | String | yes | - | Code of the promotion |
| **onSuccess** | Function() | yes | - | Function to be executed when the operation is completed successfully |
| **onError** | Function([SyneriseError](/developers/mobile-sdk/class-reference/flutter/miscellaneous#syneriseerror) error) | yes | - | Function to be executed when the operation is completed with an error |

**Return Value:**  
No value is returned.
  
**Example:**  

<pre><code class="language-Dart">await Synerise.promotions.deactivatePromotionByCode(code, onSuccess: () {
      //onSuccess handling
    }, onError: (SyneriseError error) {
      //onError handling
    });</code></pre>

</div>

<div class="tab-panel" data-tab-id="tabgrp-941-1" data-tab-group="tabgrp-941">

**Declaration:**  

<pre><code class="language-Dart">Future&lt;void&gt; deactivatePromotionByCode(String code) async</code></pre>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **code** | String | yes | - | Code of the promotion |

**Return Value:**  
No value is returned.
  
**Example:**  

<pre><code class="language-Dart">await Synerise.promotions.deactivatePromotionByCode(code).catchError((error) {
      //onError handling
    });</code></pre>

</div>
</div>


### Deactivate promotions in a batch
---
This method deactivates promotions with a code or with UUID in a batch.


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

The API key must have the `PROMOTIONS_DEACTIVATE_PROMOTIONS_UPDATE` permission from the **Promotions** group.

</div></div></div>

**Declared In:**  
lib/modules/promotions/promotions_impl.dart

**Related To:**  
[PromotionIdentifier](/developers/mobile-sdk/class-reference/flutter/promotions-and-vouchers#promotionidentifier)

**Class:**  
[PromotionsImpl](/developers/mobile-sdk/class-reference/flutter/modules#promotions)


<div class="content-tabs" data-tab-group="tabgrp-942">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-942-0" data-tab-group="tabgrp-942" data-tab-active="true">SDK &gt;= 1.0.0</button><button class="tab-button" data-tab-id="tabgrp-942-1" data-tab-group="tabgrp-942">Legacy SDK</button></div>

<div class="tab-panel" data-tab-id="tabgrp-942-0" data-tab-group="tabgrp-942" data-tab-active="true">

**Declaration:**  

<pre><code class="language-Dart">Future&lt;void&gt; deactivatePromotionsBatch(List&lt;PromotionIdentifier&gt; promotionsToDeactivate,
      {required void Function() onSuccess,
      required void Function(SyneriseError error) onError}) async</code></pre>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **promotionsIdentifiers** | List<[PromotionIdentifier](/developers/mobile-sdk/class-reference/flutter/promotions-and-vouchers#promotionidentifier)> | yes | - | List of promotion identifiers |
| **onSuccess** | Function() | yes | - | Function to be executed when the operation is completed successfully |
| **onError** | Function([SyneriseError](/developers/mobile-sdk/class-reference/flutter/miscellaneous#syneriseerror) error) | yes | - | Function to be executed when the operation is completed with an error |

**Return Value:**  
No value is returned.
  
**Example:**  

<pre><code class="language-Dart">await Synerise.promotions.deactivatePromotionsBatch(promotionIdentifierList, onSuccess: () {
      //onSuccess handling
    }, onError: (SyneriseError error) {
      //onError handling
    });</code></pre>

</div>

<div class="tab-panel" data-tab-id="tabgrp-942-1" data-tab-group="tabgrp-942">

**Declaration:**  

<pre><code class="language-Dart">Future&lt;void&gt; deactivatePromotionsBatch(List&lt;PromotionIdentifier&gt; promotionsToDeactivate) async</code></pre>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **promotionsIdentifiers** | List<[PromotionIdentifier](/developers/mobile-sdk/class-reference/flutter/promotions-and-vouchers#promotionidentifier)> | yes | - | List of promotion identifiers |

**Return Value:**  
No value is returned.
  
**Example:**  

<pre><code class="language-Dart">await Synerise.promotions.deactivatePromotionsBatch(promotionIdentifierList).catchError((error) {
      //onError handling
    });</code></pre>

</div>
</div>
  

## Vouchers
---
### Get or assign voucher from pool
---
This method retrieves an assigned voucher code or assigns a voucher from a pool identified by UUID to the customer.
  
Once a voucher is assigned using this method, **the same** voucher is returned for the profile every time the method is called.

When the voucher is assigned for the first time, a [voucherCode.assigned](/docs/assets/events/event-reference/loyalty#vouchercodeassigned) event is produced.


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

The API key must have the `VOUCHERS_ITEM_ASSIGN_CREATE` and `VOUCHERS_ITEM_ASSIGN_READ` permission from the **Assign** group.

</div></div></div>

**Declared In:**  
lib/modules/promotions/promotions_impl.dart
  
**Related To:**  
[AssignVoucherResponse](/developers/mobile-sdk/class-reference/flutter/promotions-and-vouchers#assignvoucherresponse)
  
**Class:**  
[PromotionsImpl](/developers/mobile-sdk/class-reference/flutter/modules#promotions)


<div class="content-tabs" data-tab-group="tabgrp-943">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-943-0" data-tab-group="tabgrp-943" data-tab-active="true">SDK &gt;= 1.0.0</button><button class="tab-button" data-tab-id="tabgrp-943-1" data-tab-group="tabgrp-943">Legacy SDK</button></div>

<div class="tab-panel" data-tab-id="tabgrp-943-0" data-tab-group="tabgrp-943" data-tab-active="true">

**Declaration:**  

<pre><code class="language-Dart">Future&lt;void&gt; getOrAssignVoucher(String poolUuid,
      {required void Function(AssignVoucherResponse assignVoucherResponse) onSuccess,
      required void Function(SyneriseError error) onError}) async</code></pre>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **poolUuid** | String | yes | - | Unique identifier of a code pool |
| **onSuccess** | Function([AssignVoucherResponse](/developers/mobile-sdk/class-reference/flutter/promotions-and-vouchers#assignvoucherresponse) assignVoucherResponse) | yes | - | Function to be executed when the operation is completed successfully |
| **onError** | Function([SyneriseError](/developers/mobile-sdk/class-reference/flutter/miscellaneous#syneriseerror) error) | yes | - | Function to be executed when the operation is completed with an error |

**Return Value:**  
No value is returned.

**Example:**  

<pre><code class="language-Dart">await Synerise.promotions.getOrAssignVoucher(poolUuid, onSuccess: (AssignVoucherResponse assignVoucherResponse) {
      //onSuccess handling
    }, onError: (SyneriseError error) {
      //onError handling
    });</code></pre>

</div>

<div class="tab-panel" data-tab-id="tabgrp-943-1" data-tab-group="tabgrp-943">

**Declaration:**  

<pre><code class="language-Dart">Future&lt;AssignVoucherResponse&gt; getOrAssignVoucher(String poolUuid) async</code></pre>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **poolUuid** | String | yes | - | Unique identifier of a code pool |

**Return Value:**  
[AssignVoucherResponse](/developers/mobile-sdk/class-reference/flutter/promotions-and-vouchers#assignvoucherresponse)

**Example:**  

<pre><code class="language-Dart">await Synerise.promotions.getOrAssignVoucher(poolUuid).catchError((error) {
      //onError handling
    });</code></pre>

</div>
</div>
 

### Assign voucher code from pool
---
This method assigns a voucher from a pool identified by UUID to the profile.
  
Every request returns a **different code** until the pool is empty.

A [voucherCode.assigned](/docs/assets/events/event-reference/loyalty#vouchercodeassigned) event is produced.
  

<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

Returns the HTTP 416 status code when the pool is empty.

</div></div></div>



<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

The API key must have the `VOUCHERS_ITEM_ASSIGN_CREATE` and `VOUCHERS_ITEM_ASSIGN_READ` permission from the **Assign** group.

</div></div></div>

**Declared In:**  
lib/modules/promotions/promotions_impl.dart
  
**Related To:**  
[AssignVoucherResponse](/developers/mobile-sdk/class-reference/flutter/promotions-and-vouchers#assignvoucherresponse)
  
**Class:**  
[PromotionsImpl](/developers/mobile-sdk/class-reference/flutter/modules#promotions)


<div class="content-tabs" data-tab-group="tabgrp-944">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-944-0" data-tab-group="tabgrp-944" data-tab-active="true">SDK &gt;= 1.0.0</button><button class="tab-button" data-tab-id="tabgrp-944-1" data-tab-group="tabgrp-944">Legacy SDK</button></div>

<div class="tab-panel" data-tab-id="tabgrp-944-0" data-tab-group="tabgrp-944" data-tab-active="true">

**Declaration:**  

<pre><code class="language-Dart">Future&lt;void&gt; assignVoucherCode(String poolUuid,
      {required void Function(AssignVoucherResponse response) onSuccess,
      required void Function(SyneriseError error) onError}) async</code></pre>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **poolUuid** | String | yes | - | Unique identifier of a code pool |
| **onSuccess** | Function([AssignVoucherResponse](/developers/mobile-sdk/class-reference/flutter/promotions-and-vouchers#assignvoucherresponse) assignVoucherResponse) | yes | - | Function to be executed when the operation is completed successfully, returning the [AssignVoucherResponse](/developers/mobile-sdk/class-reference/flutter/promotions-and-vouchers#assignvoucherresponse) |
| **onError** | Function([SyneriseError](/developers/mobile-sdk/class-reference/flutter/miscellaneous#syneriseerror) error) | yes | - | Function to be executed when the operation is completed with an error |

**Return Value:**  
No value is returned.
  
**Example:**  

<pre><code class="language-Dart">await Synerise.promotions.assignVoucherCode(poolUuid, onSuccess: (AssignVoucherResponse assignVoucherResponse) {
      //onSuccess handling
    }, onError: (SyneriseError error) {
      //onError handling
    });</code></pre>

</div>

<div class="tab-panel" data-tab-id="tabgrp-944-1" data-tab-group="tabgrp-944">

**Declaration:**  

<pre><code class="language-Dart">Future&lt;AssignVoucherResponse&gt; assignVoucherCode(String poolUuid) async</code></pre>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **poolUuid** | String | yes | - | Unique identifier of a code pool |

**Return Value:**  
[AssignVoucherResponse](/developers/mobile-sdk/class-reference/flutter/promotions-and-vouchers#assignvoucherresponse)
  
**Example:**  

<pre><code class="language-Dart">await Synerise.promotions.assignVoucherCode(poolUuid).catchError((error) {
      //onError handling
    });</code></pre>

</div>
</div>
 

### Get voucher codes assigned to customer
---
This method retrieves voucher codes for a customer.


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

The API key must have the `VOUCHERS_ITEM_ASSIGN_READ` permission from the **Assign** group.

</div></div></div>

**Declared In:**  
lib/modules/promotions/promotions_impl.dart
  
**Related To:**  
[VoucherCodesResponse](/developers/mobile-sdk/class-reference/flutter/promotions-and-vouchers#vouchercodesresponse)
  
**Class:**  
[PromotionsImpl](/developers/mobile-sdk/class-reference/flutter/modules#promotions)


<div class="content-tabs" data-tab-group="tabgrp-945">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-945-0" data-tab-group="tabgrp-945" data-tab-active="true">SDK &gt;= 1.0.0</button><button class="tab-button" data-tab-id="tabgrp-945-1" data-tab-group="tabgrp-945">Legacy SDK</button></div>

<div class="tab-panel" data-tab-id="tabgrp-945-0" data-tab-group="tabgrp-945" data-tab-active="true">

**Declaration:**  

<pre><code class="language-Dart">Future&lt;void&gt; getAssignedVoucherCodes(
      {required void Function(VoucherCodesResponse voucherCodesResponse) onSuccess,
      required void Function(SyneriseError error) onError}) async</code></pre>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **onSuccess** | Function([VoucherCodesResponse](/developers/mobile-sdk/class-reference/flutter/promotions-and-vouchers#vouchercodesresponse) voucherCodesResponse) | yes | - | Function to be executed when the operation is completed successfully |
| **onError** | Function([SyneriseError](/developers/mobile-sdk/class-reference/flutter/miscellaneous#syneriseerror) error) | yes | - | Function to be executed when the operation is completed with an error |

**Return Value:**  
No value is returned.

**Example:**  

<pre><code class="language-Dart">await Synerise.promotions.getAssignedVoucherCodes(onSuccess: (VoucherCodesResponse voucherCodesResponse) {
      //onSuccess handling
    }, onError: (SyneriseError error) {
      //onError handling
    });</code></pre>

</div>

<div class="tab-panel" data-tab-id="tabgrp-945-1" data-tab-group="tabgrp-945">

**Declaration:**  

<pre><code class="language-Dart">Future&lt;VoucherCodesResponse&gt; getAssignedVoucherCodes() async</code></pre>


**Return Value:**  
[VoucherCodesResponse](/developers/mobile-sdk/class-reference/flutter/promotions-and-vouchers#vouchercodesresponse)

**Example:**  

<pre><code class="language-Dart">await Synerise.promotions.getAssignedVoucherCodes().catchError((error) {
      //onError handling
    });</code></pre>

</div>
</div>
 

