
---
## 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-6534">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-6534-0" data-tab-group="tabgrp-6534" data-tab-active="true">SDK &gt;= 1.0.0</button><button class="tab-button" data-tab-id="tabgrp-6534-1" data-tab-group="tabgrp-6534">Legacy SDK</button></div>

<div class="tab-panel" data-tab-id="tabgrp-6534-0" data-tab-group="tabgrp-6534" 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-6534-1" data-tab-group="tabgrp-6534">

**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-6535">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-6535-0" data-tab-group="tabgrp-6535" data-tab-active="true">SDK &gt;= 1.0.0</button><button class="tab-button" data-tab-id="tabgrp-6535-1" data-tab-group="tabgrp-6535">Legacy SDK</button></div>

<div class="tab-panel" data-tab-id="tabgrp-6535-0" data-tab-group="tabgrp-6535" 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-6535-1" data-tab-group="tabgrp-6535">

**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-6536">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-6536-0" data-tab-group="tabgrp-6536" data-tab-active="true">SDK &gt;= 1.0.0</button><button class="tab-button" data-tab-id="tabgrp-6536-1" data-tab-group="tabgrp-6536">Legacy SDK</button></div>

<div class="tab-panel" data-tab-id="tabgrp-6536-0" data-tab-group="tabgrp-6536" 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-6536-1" data-tab-group="tabgrp-6536">

**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-6537">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-6537-0" data-tab-group="tabgrp-6537" data-tab-active="true">SDK &gt;= 1.0.0</button><button class="tab-button" data-tab-id="tabgrp-6537-1" data-tab-group="tabgrp-6537">Legacy SDK</button></div>

<div class="tab-panel" data-tab-id="tabgrp-6537-0" data-tab-group="tabgrp-6537" 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-6537-1" data-tab-group="tabgrp-6537">

**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-6538">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-6538-0" data-tab-group="tabgrp-6538" data-tab-active="true">SDK &gt;= 1.0.0</button><button class="tab-button" data-tab-id="tabgrp-6538-1" data-tab-group="tabgrp-6538">Legacy SDK</button></div>

<div class="tab-panel" data-tab-id="tabgrp-6538-0" data-tab-group="tabgrp-6538" 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-6538-1" data-tab-group="tabgrp-6538">

**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-6539">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-6539-0" data-tab-group="tabgrp-6539" data-tab-active="true">SDK &gt;= 1.0.0</button><button class="tab-button" data-tab-id="tabgrp-6539-1" data-tab-group="tabgrp-6539">Legacy SDK</button></div>

<div class="tab-panel" data-tab-id="tabgrp-6539-0" data-tab-group="tabgrp-6539" 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-6539-1" data-tab-group="tabgrp-6539">

**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-6540">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-6540-0" data-tab-group="tabgrp-6540" data-tab-active="true">SDK &gt;= 1.0.0</button><button class="tab-button" data-tab-id="tabgrp-6540-1" data-tab-group="tabgrp-6540">Legacy SDK</button></div>

<div class="tab-panel" data-tab-id="tabgrp-6540-0" data-tab-group="tabgrp-6540" 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-6540-1" data-tab-group="tabgrp-6540">

**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-6541">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-6541-0" data-tab-group="tabgrp-6541" data-tab-active="true">SDK &gt;= 1.0.0</button><button class="tab-button" data-tab-id="tabgrp-6541-1" data-tab-group="tabgrp-6541">Legacy SDK</button></div>

<div class="tab-panel" data-tab-id="tabgrp-6541-0" data-tab-group="tabgrp-6541" 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-6541-1" data-tab-group="tabgrp-6541">

**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-6542">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-6542-0" data-tab-group="tabgrp-6542" data-tab-active="true">SDK &gt;= 1.0.0</button><button class="tab-button" data-tab-id="tabgrp-6542-1" data-tab-group="tabgrp-6542">Legacy SDK</button></div>

<div class="tab-panel" data-tab-id="tabgrp-6542-0" data-tab-group="tabgrp-6542" 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-6542-1" data-tab-group="tabgrp-6542">

**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-6543">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-6543-0" data-tab-group="tabgrp-6543" data-tab-active="true">SDK &gt;= 1.0.0</button><button class="tab-button" data-tab-id="tabgrp-6543-1" data-tab-group="tabgrp-6543">Legacy SDK</button></div>

<div class="tab-panel" data-tab-id="tabgrp-6543-0" data-tab-group="tabgrp-6543" 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-6543-1" data-tab-group="tabgrp-6543">

**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-6544">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-6544-0" data-tab-group="tabgrp-6544" data-tab-active="true">SDK &gt;= 1.0.0</button><button class="tab-button" data-tab-id="tabgrp-6544-1" data-tab-group="tabgrp-6544">Legacy SDK</button></div>

<div class="tab-panel" data-tab-id="tabgrp-6544-0" data-tab-group="tabgrp-6544" 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-6544-1" data-tab-group="tabgrp-6544">

**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-6545">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-6545-0" data-tab-group="tabgrp-6545" data-tab-active="true">SDK &gt;= 1.0.0</button><button class="tab-button" data-tab-id="tabgrp-6545-1" data-tab-group="tabgrp-6545">Legacy SDK</button></div>

<div class="tab-panel" data-tab-id="tabgrp-6545-0" data-tab-group="tabgrp-6545" 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-6545-1" data-tab-group="tabgrp-6545">

**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-6546">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-6546-0" data-tab-group="tabgrp-6546" data-tab-active="true">SDK &gt;= 1.0.0</button><button class="tab-button" data-tab-id="tabgrp-6546-1" data-tab-group="tabgrp-6546">Legacy SDK</button></div>

<div class="tab-panel" data-tab-id="tabgrp-6546-0" data-tab-group="tabgrp-6546" 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-6546-1" data-tab-group="tabgrp-6546">

**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>
 

