Promotions are closely associated with Products to offer end-users special value on the products for a certain period.
Scheduled Promotions are used to automatically set sale pricing of your products for a particular calendar date range.
From the Scheduled Promotions page, you can create, view, edit, and delete promotions. The promotions come with the functions as listed:
set the scheduled time period
send localizable notifications
specify target users scope
set products prices individually
extra custom data appended.
Creating a promotion
As a prerequisite, there must be some products that have been created either from portal Design | Marketplace | Products page or through API SysCreateProduct, and these products should have regular and promotion prices tagged, check the example below:
If your promotions are set to only for the end-users of segments, you need to pre-define the segments as well, check Design | Segmentation | Segments for detail.
Advance to the Design | Promotions | Scheduled page, click the [+Create] button at the right up corner of the Scheduled Promotions list.
Fill out the necessary fields for your promotion and click Save. Make sure the Enable checkbox beside the Name field is selected.
Name - This is a good field use to enter a short description for this promotion. It is recommended to use a concise description to accommodate text display concerns in your app. For example, HalloweenPromotion.
Start & End - Set the scheduled promotion time period from here. Note: this timezone is your portal server time, you can find it from the right-up corner of your portal page.
Message - This message with the localize function will make your target end-users receive your pre-defined custom localizable messages based on their timezone. This message can be retrieved from SysReadPromotion and GetEligiblePromotions calls. It can be displayed on your app's UI for the targeted end-users.
Notification Sent On Promotion Start - Set the notification that will be sent to the target users after this promotion is started. From the drop-down menu, select the pre-defined template notification to send out to the target users when this promotion is stated. Check out the Design | Notifications | Templates page for the detail of how to set notification templates.
(Note: notifications that scheduled to send to end-users may take some time to be triggered, if the start time too short to the current server time, the end-users may not able to get the notification on the time of promotion started)
Target All Users - Make this promotion applied to all the end-users of your app.
Target Segments - Make this promotion applied to certain users of segments.
select the radio button of Target Segments
choose a segment from the drop-down menu and click the [+] icon to add it to this promotion.
you can add multiple segments for this promotion by repeating the above step.
Product Price List - You will see a list of each product of your app with drop-down collection prices that you defined for each product. From here you are able to set promotion price for each product respectively. For the products with origin price, just leave them with the default option -- 'As Is'.
Extra Data - This field gives you an option to set some custom data, then you can retrieve it from the related APIs.
Retrieving promotions from APIs
If the promotion is started and the current user belongs to the target users when calling GetSalesInventory from AppStore service, you should get the promotion info from this call:
{
"data": {
"productInventory": [
{
"itemId": "barBundle1Imp",
"type": "Consumable",
"category": "bars",
"title": "Bars (10)",
"description": "Bundle of 10 Bars.",
"imageUrl": "https://sharedprod.braincloudservers.com/files/portal/g/13229",
"currency": {
"bar": 10
},
"parentCurrency": {},
"peerCurrency": {},
"data": {
"customAttr": "value"
},
"createdAt": 1599248706625,
"updatedAt": 1603688380120,
"version": 9,
"priceData": {
"id": "aaaaa",
"referencePrice": 399,
"isPromotion": true
},
"defaultPriceData": {
"id": "aaaaa",
"referencePrice": 499,
"isPromotion": false
}
},
{
"itemId": "gemcollection",
"type": "Consumable",
"category": "gems",
"title": "gemcolection",
"description": null,
"imageUrl": null,
"currency": {
"gem": 5
},
"parentCurrency": {},
"peerCurrency": {},
"data": null,
"createdAt": 1603747376399,
"updatedAt": 1603747446664,
"version": 5,
"priceData": {
"id": "aaa",
"referencePrice": 1599,
"isPromotion": true
},
"defaultPriceData": {
"id": "aaa",
"referencePrice": 2999,
"isPromotion": false
}
}
],
"serverTime": 1603765003634
},
"status": 200
}
To check promotions in your app, calling SysGetPromotionList from the service of the promotions, you should get the list of the type (scheduled or automated) your select:
{
"data": {
"promotions": [
{
"promotionId": 1,
"type": "SCHEDULED",
"name": "forbundle",
"enabled": true,
"segments": [
3
],
"startAt": 1603602912096,
"endAt": 1603862112096,
"createdAt": 1603685947859,
"updatedAt": 1603688782335,
"version": 17
},
{
"promotionId": 3,
"type": "SCHEDULED",
"name": "forGemCollection",
"enabled": true,
"segments": [],
"startAt": 1603751420341,
"endAt": 1603837820341,
"createdAt": 1603747893231,
"updatedAt": 1603764949019,
"version": 4
}
]
},
"status": 200
}