Loyalty

Loyalty in mobile SDK covers two features:

  • Promotions - In Synerise, the Promotions module allows you to:
    • introduce a system of awarding and spending loyalty points so your profiles can use them and purchase your products.
    • use the module as a distribution channel for discounted products.
  • Vouchers - In Synerise, you can create a pool of discount codes which you can distribute through the mobile application.
    Tip: Read more about voucher pools.

Promotions


Overview

Promotions let you fetch special offers for your profiles.

Tip: Documentation on how to prepare promotions is available here.

Class reference for promotions: Android, iOS, React Native, Flutter.

Method reference for promotions: Android, iOS, React Native, Flutter.

Basic implementation

The example below is the basic implementation and retrieves all promotions for a profile, without any parameters to filter them.

IDataApiCall<PromotionResponse> apiCall = Promotions.getPromotions();
        apiCall.execute(onSuccess, showAlertError);

Advanced implementation

If you want to have full possibilities of configuring the query for promotions, getting items using the PromotionsApiQuery is the best way to achieve it.

The table explains the filtering options available when fetching promotions.

Property Type Default Description
statuses List<PromotionStatus> [] List of statuses for query
types List<PromotionType> [] List of types for query
sortParameters LinkedHashMap<PromotionSortingKey, ApiQuerySortingOrder> [] Specifies sorting rules for items in the response
limit Int 100 Limit of items per page in the response
page Int 1 Page number
includeMeta Boolean false Specifies if metadata should be included in the response

The example below is the advanced implementation and fetches promotions using PromotionsApiQuery object.

List<PromotionStatus> statuses = new ArrayList<>();
        if (activeBox.isChecked()) statuses.add(PromotionStatus.ACTIVE);
        if (assignedBox.isChecked()) statuses.add(PromotionStatus.ASSIGNED);
        if (redeemedBox.isChecked()) statuses.add(PromotionStatus.REDEEMED);

        List<PromotionType> types = new ArrayList<>();
        if (generalBox.isChecked()) types.add(PromotionType.GENERAL);
        if (customBox.isChecked()) types.add(PromotionType.CUSTOM);
        if (membersOnlyBox.isChecked()) types.add(PromotionType.MEMBERS_ONLY);

PromotionsApiQuery query = new PromotionsApiQuery();
            query.limit = 100;
            query.statuses = statuses;
            query.types = types;
            query.page = page;
            query.includeMeta = includeButton.isChecked();
            LinkedHashMap<PromotionSortingKey, ApiQuerySortingOrder> sortParams = new LinkedHashMap<>();
            sortParams.put(PromotionSortingKey.TYPE, ApiQuerySortingOrder.ASCENDING);
            sortParams.put(PromotionSortingKey.CREATED_AT, ApiQuerySortingOrder.ASCENDING);
            sortParams.put(PromotionSortingKey.EXPIRE_AT, ApiQuerySortingOrder.DESCENDING);
            query.setSortParameters(sortParams);
            IDataApiCall<PromotionResponse> apiCall = Promotions.getPromotions(query);
            apiCall.execute(onSuccess, new DataActionListener<ApiError>() {
                @Override
                public void onDataAction(ApiError apiError) {
                   // error handling
                }
            });

Promotion type

The promotion type options correspond to the promotion type options available in the Synerise application in the creating promotion form.

  • GENERAL - promotions are available to all profiles.
  • MEMBERS_ONLY - promotions are available to profiles who joined a loyalty program.
  • HANDBILL - promotions which can only be selected by the AI promotion engine for a customer.
  • CUSTOM - custom promotions are a category that has custom configuration, tailored for chosen profiles.

Constants in the SDK correlated with promotion types:

Android iOS React Native Flutter
PromotionType.GENERAL SNR_PROMOTION_TYPE_GENERAL PromotionType.General PromotionType.general
PromotionType.MEMBERS_ONLY SNR_PROMOTION_TYPE_MEMBERS_ONLY PromotionType.MembersOnly PromotionType.membersOnly
PromotionType.CUSTOM SNR_PROMOTION_TYPE_CUSTOM PromotionType.Custom PromotionType.custom
PromotionType.HANDBILL SNR_PROMOTION_TYPE_HANDBILL PromotionType.Handbill PromotionType.handbill

Promotion status

  • ACTIVE - promotion is activated by the profile.
  • ASSIGNED - promotion is assigned to a profile and visible to them.
  • REDEEMED - promotion is redeemed and finished for the profile.

Constants in the SDK correlated with promotion statuses:

Android iOS React Native Flutter
PromotionStatus.ACTIVE SNR_PROMOTION_STATUS_ACTIVE PromotionStatus.Active PromotionStatus.active
PromotionStatus.ASSIGNED SNR_PROMOTION_STATUS_ASSIGNED PromotionStatus.Assigned PromotionStatus.assigned
PromotionStatus.REDEEMED SNR_PROMOTION_STATUS_REDEEMED PromotionStatus.Redeemed PromotionStatus.redeemed

Promotion sorting options

You can set an array of sorting options. Each sorting option is a key-value pair. The key is the sorting key constant and the value is the sorting order.

Promotion-related sorting constants:

  • EXPIRE_AT - time when the promotion expires.
  • CREATED_AT - time when the promotion was created.
  • LASTING_AT - time when the promotion stops being active for the profile.
  • REQUIRE_REDEEMED_POINTS - how many loyalty points are needed to redeem the promotion.
  • UPDATED_AT - time when the promotion was last updated.
  • TYPE - type of the promotion.
  • PRIORITY - priority of the promotion.

Constants in the SDK correlated with promotion sorting options:

Android iOS React Native Flutter
PromotionSortingKey.EXPIRE_AT SNR_PROMOTION_SORTING_KEY_EXPIRE_AT PromotionSortingKey.ExpireAt PromotionSortingKey.expireAt
PromotionSortingKey.CREATED_AT SNR_PROMOTION_SORTING_KEY_CREATED_AT PromotionSortingKey.CreatedAt PromotionSortingKey.createdAt
PromotionSortingKey.LASTING_AT SNR_PROMOTION_SORTING_KEY_LASTING_AT PromotionSortingKey.LastingAt PromotionSortingKey.lastingAt
PromotionSortingKey.REQUIRE_REDEEMED_POINTS SNR_PROMOTION_SORTING_KEY_REQUIRE_REDEEMED_POINTS PromotionSortingKey.requireRedeemPoints PromotionSortingKey.ExpireAt
PromotionSortingKey.UPDATED_AT SNR_PROMOTION_SORTING_KEY_UPDATED_AT PromotionSortingKey.UpdatedAt PromotionSortingKey.updatedAt
PromotionSortingKey.TYPE SNR_PROMOTION_SORTING_KEY_TYPE PromotionSortingKey.Type PromotionSortingKey.type
PromotionSortingKey.PRIORITY SNR_PROMOTION_SORTING_KEY_PRIORITY PromotionSortingKey.Priority PromotionSortingKey.priority

You can sort each of the above ascending or descending by using the values:

  • ASCENDING
  • DESCENDING

Constants in the SDK correlated with sorting order values:

Android iOS React Native Flutter
ApiQuerySortingOrder.ASCENDING SNR_API_QUERY_SORTING_ASC ApiQuerySortingOrder.Ascending ApiQuerySortingOrder.ascending
ApiQuerySortingOrder.DESCENDING SNR_API_QUERY_SORTING_DESC ApiQuerySortingOrder.Descending ApiQuerySortingOrder.descending

You can add a number of key-value pairs for sorting.

Working with single promotions


In addition to getting all promotions or a filtered list, you can get a single promotion.

You can get a single promotion by:

  • UUID of the promotion
  • Code of the promotion

These are the basic identity properties for a promotion. They are useful and thanks to them, you can activate and deactivate a single promotion too.

The following methods are available:

Android iOS React Native
Get promotion identified by UUID Get promotion identified by UUID Get promotion identified by UUID
Get promotion identified by code Get promotion identified by code Get promotion identified by code
Activate promotion identified by UUID Activates promotion identified by UUID Activates promotion identified by UUID
Activate promotion identified by code Activate promotion identified by code Activate promotion identified by code
Activate promotions Activate promotions Activate promotions
De-activate promotion identified by UUID De-activate promotion identified by UUID De-activate promotion identified by UUID
De-activate promotion identified by code De-activate promotion identified by code De-activate promotion identified by code
De-activate promotions De-activate promotions De-activate promotions

Vouchers


Overview

In Synerise, you can create a voucher pool to distribute discount codes to your profiles for the campaign purposes.

The codes in a voucher pool get two forms:

  • a text string
  • a barcode
Tip: Before using it in your mobile app, create a voucher pool in Synerise.

Class reference for vouchers: Android, iOS, React Native, Flutter.

Method reference for vouchers: Android, iOS, React Native, Flutter.

Voucher status

  • UNASSIGNED - voucher is unassigned to any profile.
  • ASSIGNED - voucher is assigned to a profile and visible to them.
  • REDEEMED - voucher is redeemed and finished for the profile.
  • CANCELED - voucher is canceled for the profile.

Working with vouchers

The following methods are available:

Android iOS React Native
Get voucher code only once or assign a voucher with provided pool UUID for the profile Get voucher code only once or assign a voucher with provided pool UUID for the profile Get voucher code only once or assign a voucher with provided pool UUID for the client
Assign voucher with provided pool UUID for the profile Assign voucher with provided pool UUID for the profile Assign voucher with provided pool UUID for the profile
Get profile’s voucher codes Get profile’s voucher codes Get profile’s voucher codes
😕

We are sorry to hear that

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

😉

Awesome!

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

Close modal icon Placeholder alt for modal to satisfy link checker