Skip to main content
Version: 5.9.0

GetItemsOnPromotion

Returns all catalog items for which the current user has an eligible promotion, with optional support to filter on a specific 'category'. For each item, the most recently started promotion is considered the 'winning' promotion, if more than one promotion is active at the same time with a promotional price for same item. Optionally include the catalog item definition for each item and the promotion details for all 'winning' promotions.

ServiceOperation
userItemsGET_ITEMS_ON_PROMOTION

Method Parameters

ParameterDescription
shopIdThe id identifying the store the item is from, if applicable.
includeDefIf true, the associated item definition info of the promotional items will be included in the response.
includePromotionDetailsIf true, the promotion details of the eligible promotions will be included in the response.
optionsJsonOptional support for specifying additional options. Currently supporting option 'category' to include only catalog items configured with the specified category, if desired.

Usage

http://localhost:3000
string shopId = "None";
bool includeDef = True;
bool includePromotionDetails = True;
string optionsJson = "{\"category\": \"Equipment\"}";

SuccessCallback successCallback = (response, cbObject) =>
{
Debug.Log(string.Format("Success | {0}", response));
};
FailureCallback failureCallback = (status, code, error, cbObject) =>
{
Debug.Log(string.Format("Failed | {0} {1} {2}", status, code, error));
};

_bc.UseritemsService.GetItemsOnPromotion(shopId, includeDef, includePromotionDetails, optionsJson, successCallback, failureCallback);
JSON Response
{
"data": {
"items": [
{
"defId": "s001",
"itemDef": {
"resourceGroup": null,
"sellPrice": {},
"type": "ITEM",
"coolDownSecs": 0,
"recoverySecs": 0,
"statusName": null,
"buyPrice": {
"bar": 88
},
"image": null,
"stackable": true,
"publishedAt": 1713324249793,
"pState": "PUBLISHED",
"activatable": false,
"tags": null,
"defId": "s001",
"maxStackable": 1,
"blockchain": false,
"meta": null,
"consumable": false,
"name": {
"en": "Sword"
},
"tradable": false,
"resourceTag": null,
"uses": null,
"_id": {
"timestamp": 1711508420,
"date": 1711508420000
},
"activeSecs": null,
"category": "weapon",
"desc": {
"en": "weapon"
}
},
"winningPromotionId": 1,
"promotionPrices": [
{
"promotionPrice": {
"bar": 44
},
"name": "test",
"type": "AUTOMATED",
"promotionId": 1
}
]
}
],
"promotionDetails": [
{
"promotionId": 1,
"type": "AUTOMATED",
"name": "test",
"duration": 10,
"customJson": {
"priority": 100,
"itemIds": {
"barBundle1Imp": {
"currency": {
"bars": 12
},
"extra": {
"specialItemReward": "bonusItemA"
}
},
"gemcollection": {
"currency": {
"gems": 7
},
"extra": {
"specialItemReward": "bonusItemA"
}
}
}
},
"isRetriggerable": true,
"maxRetriggers": null,
"maxPurchases": null,
"triggeredForUserAt": 1764353888374,
"expiresForUserAt": 1764389888374
}
]
},
"status": 200
}