Promotions and Vouchers
Promotions
Get all promotions of a customer
This method retrieves all available promotions that are defined for a customer.
PROMOTIONS_DETAILS_FOR_CLIENT_READ
permission from the Client group.Declared In:
lib/modules/promotions/promotions_impl.dart
Class:
PromotionsModule
Declaration:
Future<PromotionResponse> getAllPromotions() async
Return Value:
No value is returned.
Example:
PromotionResponse promotionResponse = await Synerise.promotions.getAllPromotions().catchError((error)
Get promotions with query parameters
This method retrieves promotions that match the parameters defined in an API query.
PROMOTIONS_DETAILS_FOR_CLIENT_READ
permission from the Client group.Declared In:
lib/modules/promotions/promotions_impl.dart
Related To:
PromotionsApiQuery
Class:
PromotionsModule
Declaration:
Future<PromotionResponse> getPromotions(PromotionsApiQuery promotionsApiQuery) async
Parameters:
Parameter | Type | Mandatory | Default | Description |
---|---|---|---|---|
apiQuery | PromotionsApiQuery | yes | - | Object that stores all query parameters |
Return Value:
No value is returned.
Example:
PromotionResponse promotionResponse = await Synerise.promotions.getPromotions(promotionsApiQuery).catchError((error)
Get promotion by UUID
This method retrieves the promotion with the specified UUID.
PROMOTIONS_DETAILS_FOR_CLIENT_READ
permission from the Client group.Declared In:
lib/modules/promotions/promotions_impl.dart
Class:
PromotionsModule
Declaration:
Future<Promotion> getPromotionByUUID(String uuid) async
Parameters:
Parameter | Type | Mandatory | Default | Description |
---|---|---|---|---|
uuid | String | yes | - | UUID of the promotion |
Return Value:
No value is returned.
Example:
Promotion promotion = await Synerise.promotions.getPromotionByUUID(uuid).catchError((error)
Get promotion by code
This method retrieves the promotion with the specified code.
PROMOTIONS_DETAILS_FOR_CLIENT_READ
permission from the Client group.Declared In:
lib/modules/promotions/promotions_impl.dart
Class:
PromotionsModule
Declaration:
Future<Promotion> getPromotionByCode(String code) async
Parameters:
Parameter | Type | Mandatory | Default | Description |
---|---|---|---|---|
code | String | yes | - | Code of the promotion |
Return Value:
No value is returned.
Example:
Promotion promotion = await Synerise.promotions.getPromotionByCode(code).catchError((error)
Activate promotion by UUID
This method activates the promotion with the specified UUID.
PROMOTIONS_ACTIVATE_PROMOTIONS_UPDATE
permission from the Promotions group.Declared In:
lib/modules/promotions/promotions_impl.dart
Class:
PromotionsModule
Declaration:
Future<void> activatePromotionByUUID(String uuid) async
Parameters:
Parameter | Type | Mandatory | Default | Description |
---|---|---|---|---|
uuid | String | yes | - | UUID of the promotion |
Return Value:
No value is returned.
Example:
await Synerise.promotions.activatePromotionByUUID(code).catchError((error)
Activate promotion by code
This method activates the promotion with the specified code.
PROMOTIONS_ACTIVATE_PROMOTIONS_UPDATE
permission from the Promotions group.Declared In:
lib/modules/promotions/promotions_impl.dart
Class:
PromotionsModule
Declaration:
Future<void> activatePromotionByCode(String code) async
Parameters:
Parameter | Type | Mandatory | Default | Description |
---|---|---|---|---|
code | String | yes | - | Code of the promotion |
Return Value:
No value is returned.
Example:
await Synerise.promotions.activatePromotionByCode(code).catchError((error)
Activate promotions in a batch
This method activates promotions with a code or with UUID in a batch.
PROMOTIONS_ACTIVATE_PROMOTIONS_UPDATE
permission from the Promotions group.Declared In:
lib/modules/promotions/promotions_impl.dart
Related To:
PromotionIdentifier
Class:
PromotionsModule
Declaration:
Future<void> activatePromotionsBatch(List<PromotionIdentifier> promotionsToActivate) async
Parameters:
Parameter | Type | Mandatory | Default | Description |
---|---|---|---|---|
promotionsIdentifiers | List<PromotionIdentifier> | yes | - | List of promotion identifiers |
Return Value:
No value is returned.
Example:
await Synerise.promotions.activatePromotionsBatch(promotionIdentifierList).catchError((error)
Deactivate promotion by UUID
This method deactivates the promotion with the specified UUID.
PROMOTIONS_DEACTIVATE_PROMOTIONS_UPDATE
permission from the Promotions group.Declared In:
lib/modules/promotions/promotions_impl.dart
Class:
PromotionsModule
Declaration:
Future<void> deactivatePromotionByUUID(String uuid) async
Parameters:
Parameter | Type | Mandatory | Default | Description |
---|---|---|---|---|
uuid | String | yes | - | UUID of the promotion |
Return Value:
No value is returned.
Example:
await Synerise.promotions.deactivatePromotionByUUID(code).catchError((error)
Deactivate promotion by code
This method deactivates the promotion with the specified code.
PROMOTIONS_DEACTIVATE_PROMOTIONS_UPDATE
permission from the Promotions group.Declared In:
lib/modules/promotions/promotions_impl.dart
Class:
PromotionsModule
Declaration:
Future<void> deactivatePromotionByCode(String code) async
Parameters:
Parameter | Type | Mandatory | Default | Description |
---|---|---|---|---|
code | String | yes | - | Code of the promotion |
Return Value:
No value is returned.
Example:
await Synerise.promotions.deactivatePromotionByCode(code).catchError((error)
Deactivate promotions in a batch
This method deactivates promotions with a code or with UUID in a batch.
PROMOTIONS_DEACTIVATE_PROMOTIONS_UPDATE
permission from the Promotions group.Declared In:
lib/modules/promotions/promotions_impl.dart
Related To:
PromotionIdentifier
Class:
PromotionsModule
Declaration:
Future<void> deactivatePromotionsBatch(List<PromotionIdentifier> promotionsToDeactivate) async
Parameters:
Parameter | Type | Mandatory | Default | Description |
---|---|---|---|---|
promotionsIdentifiers | List<PromotionIdentifier> | yes | - | List of promotion identifiers |
Return Value:
No value is returned.
Example:
await Synerise.promotions.deactivatePromotionsBatch(promotionIdentifierList).catchError((error)
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 customer every time the method is called.
VOUCHERS_ITEM_ASSIGN_CREATE
and VOUCHERS_ITEM_ASSIGN_READ
permission from the Assign group.Declared In:
lib/modules/promotions/promotions_impl.dart
Class:
PromotionsModule
Declaration:
Future<AssignVoucherResponse> getOrAssignVoucher(String poolUuid) async
Parameters:
Parameter | Type | Mandatory | Default | Description |
---|---|---|---|---|
poolUuid | String | yes | - | Pool’s universally unique identifier |
Return Value:
No value is returned.
Example:
AssignVoucherResponse assignVoucherResponse = await Synerise.promotions.getOrAssignVoucher(poolUuid).catchError((error)
Assign voucher code from pool
This method assigns a voucher from a pool identified by UUID to the customer.
Every request returns a different code until the pool is empty.
VOUCHERS_ITEM_ASSIGN_CREATE
and VOUCHERS_ITEM_ASSIGN_READ
permission from the Assign group.Declared In:
lib/modules/promotions/promotions_impl.dart
Class:
PromotionsModule
Declaration:
Future<AssignVoucherResponse> assignVoucherCode(String poolUuid) async
Parameters:
Parameter | Type | Mandatory | Default | Description |
---|---|---|---|---|
poolUuid | String | yes | - | Pool’s universally unique identifier |
Return Value:
No value is returned.
Example:
AssignVoucherResponse assignVoucherResponse = await Synerise.promotions.assignVoucherCode(poolUuid).catchError((error)
Get voucher codes assigned to customer
This method retrieves voucher codes for a customer.
VOUCHERS_ITEM_ASSIGN_READ
permission from the Assign group.Declared In:
lib/modules/promotions/promotions_impl.dart
Class:
PromotionsModule
Declaration:
Future<VoucherCodesResponse> getAssignedVoucherCodes() async
Return Value:
No value is returned.
Example:
VoucherCodesResponse voucherCodesResponse = await Synerise.promotions.getAssignedVoucherCodes().catchError((error)