Skip to main content
Version: 5.9.0

OpenBundle

Allows a quantity of a specified bundle user item to be opened. Response indicates any items and currency awards configured for the associated bundle user item's BUNDLE type item definition, plus any 'items' awarded and any 'currencies' awarded, along with the resulting currency balances. If includeItemDef is true, the associated item definition will be included in the response for any user items awarded and for the bundle user item being opened (if any quantity of the bundle user item remains), with language fields limited to the current or default language.

ServiceOperation
userItemsOPEN_BUNDLE

Method Parameters

ParameterDescription
itemIdThe unique id of the bundle user item.
versionThe version of the bundle user item being sold. Accepts -1 if any version.
quantityThe quantity of the bundle user item to open.
includeDefIf true, the associated item definition will be included in the response for any user items awarded and if any quantity of the bundle user item remains.
optionsJsonOptional support for specifying 'blockIfExceedItemMaxStackable' indicating how to process awarding the bundle content items if the defId for any is for a stackable item with a max stackable quantity and the specified quantity to be awarded is too high. If true and the quantity is too high, the call is blocked and an error is returned. If false (default) and quantity is too high, the quantity is adjusted to the allowed maximum and the quantity not awarded is reported in response key 'itemsNotAwarded' - unless the adjusted quantity would be 0, in which case the call is blocked and an error is returned.

Usage

http://localhost:3000
string itemId = "aaa-bbb-ccc-ddd";
int version = 1;
int quantity = 1;
bool includeDef = True;
string optionsJson = "{\"blockIfExceedItemMaxStackable\": False}";

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.OpenBundle(itemId, version, quantity, includeDef, optionsJson, successCallback, failureCallback);
JSON Response
{
"data": {
"quantity": 1,
"itemsNotAwarded": {
"s001": 6,
"sword001": 8
},
"itemDef": {
"defId": "s001b",
"name": "s001b",
"desc": "desp",
"type": "BUNDLE",
"category": "weapon",
"tags": [
"sword"
],
"buyPriceDisabled": false,
"buyPrice": {},
"sellPrice": {},
"image": null,
"resourceGroup": null,
"resourceTag": null,
"meta": null,
"pState": "PUBLISHED",
"publishedAt": 1764001437452,
"stackable": false,
"maxStackable": null,
"tradable": false,
"blockchain": false,
"autoOpen": false,
"items": {
"s001": {
"defId": "s001",
"quantity": 1
},
"sword001": {
"defId": "sword001",
"quantity": 1
}
}
},
"items": {}
},
"status": 200
}