Digital Goods

Elements supports traditional Web 2.0 digital goods. Examples of digital goods may be consumable items such as potions or gold coins in a video game. Alternatively, they maybe part of equipment sets such as swords, helmets, or weapon skins. Digital goods are not limited to games and can be used to represent other content such as boosts in a dating app. Essentially digital goods can be used to represent any types of content in an application which can be bought directly from your business.

The Digital Goods system in Elements manages three things:

  • Items represent the core metadata of the items offered for sale.
  • Inventory entries provide the association between a user and the Item they own.
  • Purchase Verification ties In-App Purchases to specific Items and Quantities which Elements will deposit upon successful validation of purchases tied to IAP bundles

Items

Items are digital goods in the Elements database. These exist independent of Applications, so any application in your instance can interact with any item. Core APIs allow for the reading of items for sale. Each Item contains the following properties: * id * name * displayName * tags * description is a brief human-readable description of the item. Client code may opt to show this directly to the user. * category describes one of two particular values. Fungible and Distinct. (Note: Fungible, in this context, is not related to the web3 concept of fungibility). * DISTINCT (See Below) * FUNGIBLE (See Below)

Inventory

Inventory is tied to each user, listing the items that user owns and the quantity. A user's inventory is accessible across all applications. Once an Item exists, you may use Cloud Functions to assign inventory items to users in the system. Additionally, you may use SUPERUSER APIs to award items to users for administrative purposes.

Fungible Inventory Item

Fungible inventory items exist as stacks in the user's inventory. Common examples for fungible items may be coins or potions in a game, credits for something else redeemable, or simply points accrued for playing a game.

Fungible items exist at he USER level only and will be visible to all applications within Elements. See Application scoping rules for more details.

Distinct Inventory Item

Distinct inventory items exist as single objects in the database. Unlike Fungible items, Distinct items may exist in multiples in the inventory. Additionally, they are not stackable. Distinct items would be useful to represent digital goods such as a sword, gun, or other in-game inventory item. In addition to the base Metadata, Distinct Inventory Items have their own metadata. This is useful, for example, if your game has degradation logic for particular items. For example, a sword will eventually wear out until it needs repair.

Purchase Verification

Elements can verify purchases for Apple App Store and Google Play applications. First, you must set up Application Configurations for iOS or Android, adding the relevant info for your app to Elements to interact with the App Store or Google Play.