
---
## 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/main/modules/PromotionsModule.js
  
**Class:**  
[PromotionsModule](/developers/mobile-sdk/class-reference/react-native/modules#promotions)
  
**Declaration:**  

<pre><code class="language-TypeScript">public getAllPromotions(onSuccess: (promotionResponse: PromotionResponse) =&gt; void, onError: (error: Error) =&gt; void)</code></pre>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **onSuccess** | Function | no | - | Function to be executed when the operation is completed successfully |
| **onError** | Function | no | - | Function to be executed when the operation is completed with an error |

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

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1181">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1181-0" data-tab-group="tabgrp-1181" data-tab-active="true">JavaScript</button></div>

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

```JavaScript
Synerise.Promotions.getAllPromotions(function(promotionResponse) {
    //success
}, function(error) {
    //failure
});
```

</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/main/modules/PromotionsModule.js

**Related To:**  
[PromotionsApiQuery](/developers/mobile-sdk/class-reference/react-native/promotions-and-vouchers#promotionsapiquery)  
  
**Class:**  
[PromotionsModule](/developers/mobile-sdk/class-reference/react-native/modules#promotions)
  
**Declaration:**  

<pre><code class="language-TypeScript">public getPromotions(apiQuery: PromotionsApiQuery, onSuccess: (promotionResponse: PromotionResponse) =&gt; void, onError: (error: Error) =&gt; void)</code></pre>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **apiQuery** | [PromotionsApiQuery](/developers/mobile-sdk/class-reference/react-native/promotions-and-vouchers#promotionsapiquery) | yes | - | [PromotionsApiQuery](/developers/mobile-sdk/class-reference/react-native/promotions-and-vouchers#promotionsapiquery) object responsible for storing all query parameters |
| **onSuccess** | Function | no | - | Function to be executed when the operation is completed successfully |
| **onError** | Function | no | - | Function to be executed when the operation is completed with an error |

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

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1182">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1182-0" data-tab-group="tabgrp-1182" data-tab-active="true">JavaScript</button></div>

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

```JavaScript
let apiQuery = new PromotionsApiQuery();
apiQuery.statuses = [
    PromotionStatus.Active
];
apiQuery.types = [
    PromotionType.General
]
apiQuery.sorting = [
    { property: PromotionSortingKey.CreatedAt, order: ApiQuerySortingOrder.Ascending }
];

apiQuery.limit = 120;
apiQuery.page = 2;
apiQuery.includeMeta = true;

Synerise.Promotions.getPromotions(apiQuery, function(promotionResponse) {
    //success
}, function(error) {
    //failure
});
```

</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/main/modules/PromotionsModule.js
  
**Class:**  
[PromotionsModule](/developers/mobile-sdk/class-reference/react-native/modules#promotions)
  
**Declaration:**  

<pre><code class="language-TypeScript">public getPromotionByUUID(uuid: string, onSuccess: (promotion: Promotion) =&gt; void, onError: (error: Error) =&gt; void)</code></pre>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **uuid** | string | yes | - | UUID of the promotion |
| **onSuccess** | Function | no | - | Function to be executed when the operation is completed successfully |
| **onError** | Function | no | - | Function to be executed when the operation is completed with an error |

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

**Example:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1183">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1183-0" data-tab-group="tabgrp-1183" data-tab-active="true">JavaScript</button></div>

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

```JavaScript
Synerise.Promotions.getPromotionByUUID("UUID", function(promotion) {
    //success
}, function(error) {
    //failure
});
```

</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/main/modules/PromotionsModule.js
  
**Class:**  
[PromotionsModule](/developers/mobile-sdk/class-reference/react-native/modules#promotions)
  
**Declaration:**  

<pre><code class="language-TypeScript">public getPromotionByCode(code: string, onSuccess: (promotion: Promotion) =&gt; void, onError: (error: Error) =&gt; void)</code></pre>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **code** | string | yes | - | Code of the promotion |
| **onSuccess** | Function | no | - | Function to be executed when the operation is completed successfully |
| **onError** | Function | no | - | Function to be executed when the operation is completed with an error |

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

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1184">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1184-0" data-tab-group="tabgrp-1184" data-tab-active="true">JavaScript</button></div>

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

```JavaScript
Synerise.Promotions.getPromotionByCode("CODE", function(promotion) {
    //success
}, function(error) {
    //failure
});
```

</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/main/modules/PromotionsModule.js
  
**Class:**  
[PromotionsModule](/developers/mobile-sdk/class-reference/react-native/modules#promotions)
  
**Declaration:**  

<pre><code class="language-TypeScript">public deactivatePromotionByUUID(uuid: string, onSuccess: () =&gt; void, onError: (error: Error) =&gt; void)</code></pre>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **uuid** | string | yes | - | UUID of the promotion |
| **onSuccess** | Function | no | - | Function to be executed when the operation is completed successfully |
| **onError** | Function | no | - | Function to be executed when the operation is completed with an error |

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

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1185">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1185-0" data-tab-group="tabgrp-1185" data-tab-active="true">JavaScript</button></div>

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

```JavaScript
Synerise.Promotions.activatePromotionByUUID("UUID", function() {
    //success
}, function(error) {
    //failure
});
```

</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/main/modules/PromotionsModule.js
  
**Class:**  
[PromotionsModule](/developers/mobile-sdk/class-reference/react-native/modules#promotions)
  
**Declaration:**  

<pre><code class="language-TypeScript">public activatePromotionByCode(code: string, onSuccess: () =&gt; void, onError: (error: Error) =&gt; void)</code></pre>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **code** | string | yes | - | Code of the promotion |
| **onSuccess** | Function | no | - | Function to be executed when the operation is completed successfully |
| **onError** | Function | no | - | Function to be executed when the operation is completed with an error |

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

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1186">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1186-0" data-tab-group="tabgrp-1186" data-tab-active="true">JavaScript</button></div>

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

```JavaScript
Synerise.Promotions.activatePromotionByCode("CODE", function() {
    //success
}, function(error) {
    //failure
});
```

</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/main/modules/PromotionsModule.js
  
**Related To:**  
[PromotionIdentifier](/developers/mobile-sdk/class-reference/react-native/promotions-and-vouchers#promotionidentifier)
  
**Class:**  
[PromotionsModule](/developers/mobile-sdk/class-reference/react-native/modules#promotions)  

**Declaration:**  

<pre><code class="language-TypeScript">public activatePromotionsBatch(promotionsIdentifiers: Array&lt;PromotionIdentifier&gt;, onSuccess: () =&gt; void, onError: (error: Error) =&gt; void)</code></pre>


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

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

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1187">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1187-0" data-tab-group="tabgrp-1187" data-tab-active="true">JavaScript</button></div>

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

```JavaScript
Synerise.Promotions.activatePromotionsBatch(promotionsIdentifiers, function() {
    //success
}, function(error) {
    //failure
});
```

</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/main/modules/PromotionsModule.js
  
**Class:**  
[PromotionsModule](/developers/mobile-sdk/class-reference/react-native/modules#promotions)
  
**Declaration:**  

<pre><code class="language-TypeScript">public deactivatePromotionByUUID(uuid: string, onSuccess: () =&gt; void, onError: (error: Error) =&gt; void)</code></pre>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **uuid** | string | yes | - | UUID of the promotion |
| **onSuccess** | Function | no | - | Function to be executed when the operation is completed successfully |
| **onError** | Function | no | - | Function to be executed when the operation is completed with an error |

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

**Example:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1188">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1188-0" data-tab-group="tabgrp-1188" data-tab-active="true">JavaScript</button></div>

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

```JavaScript
Synerise.Promotions.deactivatePromotionByUUID("UUID", function() {
    //success
}, function(error) {
    //failure
});
```

</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/main/modules/PromotionsModule.js
  
**Class:**  
[PromotionsModule](/developers/mobile-sdk/class-reference/react-native/modules#promotions)
  
**Declaration:**  

<pre><code class="language-TypeScript">public deactivatePromotionByCode(code: string, onSuccess: () =&gt; void, onError: (error: Error) =&gt; void)</code></pre>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **code** | string | yes | - | Code of the promotion |
| **onSuccess** | Function | no | - | Function to be executed when the operation is completed successfully |
| **onError** | Function | no | - | Function to be executed when the operation is completed with an error |

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

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1189">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1189-0" data-tab-group="tabgrp-1189" data-tab-active="true">JavaScript</button></div>

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

```JavaScript
Synerise.Promotions.deactivatePromotionByCode("CODE", function() {
    //success
}, function(error) {
    //failure
});
```

</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/main/modules/PromotionsModule.js
  
**Related To:**  
[PromotionIdentifier](/developers/mobile-sdk/class-reference/react-native/promotions-and-vouchers#promotionidentifier)
  
**Class:**  
[PromotionsModule](/developers/mobile-sdk/class-reference/react-native/modules#promotions)
  
**Declaration:**  

<pre><code class="language-TypeScript">public deactivatePromotionsBatch(promotionsIdentifiers: Array&lt;PromotionIdentifier&gt;, onSuccess: () =&gt; void, onError: (error: Error) =&gt; void)</code></pre>

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

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

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1190">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1190-0" data-tab-group="tabgrp-1190" data-tab-active="true">JavaScript</button></div>

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

```JavaScript
Synerise.Promotions.deactivatePromotionsBatch(promotionsIdentifiers, function() {
    //success
}, function(error) {
    //failure
});
```

</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/main/modules/PromotionsModule.js
  
**Class:**  
[PromotionsModule](/developers/mobile-sdk/class-reference/react-native/modules#promotions)
  
**Declaration:**  

<pre><code class="language-TypeScript"></code></pre>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **poolUuid** | string | yes | - | Unique identifier of a code pool |
| **onSuccess** | Function | no | - | Function to be executed when the operation is completed successfully |
| **onError** | Function | no | - | Function to be executed when the operation is completed with an error |

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

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1191">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1191-0" data-tab-group="tabgrp-1191" data-tab-active="true">JavaScript</button></div>

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

```JavaScript
Synerise.Promotions.getOrAssignVoucher(poolUuid, function(voucherResponse) {
      // success
  }, function(error) {
      // failure
  })
```

</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/main/modules/PromotionsModule.js
  
**Class:**  
[PromotionsModule](/developers/mobile-sdk/class-reference/react-native/modules#promotions)
  
**Declaration:**  

<pre><code class="language-TypeScript"></code></pre>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **poolUuid** | string | yes | - | Unique identifier of a code pool |
| **onSuccess** | Function | no | - | Function to be executed when the operation is completed successfully |
| **onError** | Function | no | - | Function to be executed when the operation is completed with an error |

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

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1192">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1192-0" data-tab-group="tabgrp-1192" data-tab-active="true">JavaScript</button></div>

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

```JavaScript
Synerise.Promotions.assignVoucherCode(poolUuid, function(voucherResponse) {
      // success
  }, function(error) {
      // failure
  })
```

</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/main/modules/PromotionsModule.js
  
**Class:**  
[PromotionsModule](/developers/mobile-sdk/class-reference/react-native/modules#promotions)
  
**Declaration:**  

<pre><code class="language-TypeScript"></code></pre>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **onSuccess** | Function | no | - | Function to be executed when the operation is completed successfully |
| **onError** | Function | no | - | Function to be executed when the operation is completed with an error |

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

**Example:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1193">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1193-0" data-tab-group="tabgrp-1193" data-tab-active="true">JavaScript</button></div>

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

```JavaScript
Synerise.Promotions.getAssignedVoucherCodes(function(voucherCodesResponse) {
  // success
  }, function(error) {
    // failure
  })
```

</div>
</div>
 

