User Items
The User Items service, introduced in 4.2, is used to manage a collection of in-app items that users can be awarded, buy, sell, or trade (using virtual currency). Optionally, these items can be backed up to the blockchain.
Key concepts:
- Items are first defined in the Item Catalog
- Defined items can be purchased or awarded to users, where they will be recorded as userItem instances.
- Using an item may consume it (or a portion of it - or none of it). Consumed items will automatically disappear from the user's user item inventory.
- Using an item may trigger a status effect (i.e. invulnerability for 60 seconds)
- Using an item may trigger a cool-down period (before the item can be used again) or a regeneration period (a period after which the item regenerates a "use.")
API Summary
Read Items
- GetUserItem - Retrieves the identified user item from the server.
- GetUserItemsPage - Retrieves the page of user's items from the server based on the context.
- GetUserItemsPageOffset - Retrieves the page of user's items from the server based on the encoded context.
Affect Item Owner
- AwardUserItem - Allows item(s) to be awarded to a user without collecting the purchase amount.
- DropUserItem - Allows a quantity of a specified user item to be dropped, without any recovery of the money paid for the item.
- SellUserItem - Allows a quantity of a specified user item to be sold.
- GiveUserItemTo - Gifts item to the specified player.
- ReceiveUserItemFrom - Retrieves and transfers the gift item from the specified player, who must have previously called giveUserItemTo.
- PurchaseUserItem - Purchases a quantity of an item from the specified store, if the user has enough funds.
Edit Item State
- UseUserItem - Uses the specified item, potentially consuming it.
- UpdateUserItemData - Updates the item data on the specified user item.
Blockchain
- PublishUserItemToBlockchain - Publishes the specified item to the item management attached blockchain.
- RefreshBlockchainUserItems - Syncs the caller's user items with the item management attached blockchain.
📄️ AwardUserItem
Allows item(s) to be awarded to a user without collecting the purchase amount. If includeDef is true, response includes associated itemDef with language fields limited to the current or default language.
📄️ DropUserItem
Allows a quantity of a specified user item to be dropped, without any recovery of the money paid for the item. If any quantity of the user item remains, it will be returned, potentially with the associated itemDef (with language fields limited to the current or default language).
📄️ GetUserItem
Retrieves the identified user item from the server. If includeDef is true, response includes associated itemDef with language fields limited to the current or default language.
📄️ GetUserItemsPage
Retrieves the page of user's inventory from the server based on the context. If includeDef is true, response includes associated itemDef with each user item, with language fields limited to the current or default language.
📄️ GetUserItemsPageOffset
Retrieves the page of user's inventory from the server based on the encoded context. If includeDef is true, response includes associated itemDef with each user item, with language fields limited to the current or default language.
📄️ GiveUserItemTo
Gifts item to the specified player.
📄️ PublishUserItemToBlockchain
Publishes the specified item to the item management attached blockchain. Results are reported asynchronously via an RTT event.
📄️ PurchaseUserItem
Purchases a quantity of an item from the specified store, if the user has enough funds. If includeDef is true, response includes associated itemDef with language fields limited to the current or default language.
📄️ ReceiveUserItemFrom
Retrieves and transfers the gift item from the specified player, who must have previously called giveUserItemTo.
📄️ RefreshBlockchainUserItems
Syncs the caller's user items with the item management attached blockchain. Results are reported asynchronously via an RTT event.
📄️ RemoveUserItemFromBlockchain
Removes the specified item from the item management attached blockchain. Results are reported asynchronously via an RTT event.
📄️ SellUserItem
Allows a quantity of a specified user item to be sold. If any quantity of the user item remains, it will be returned, potentially with the associated itemDef (with language fields limited to the current or default language), along with the currency refunded and currency balances.
📄️ UpdateUserItemData
Updates the item data on the specified user item.
📄️ UseUserItem
Uses the specified item, potentially consuming it.