Stores - Guide
Allow players to purchase items from in-game stores [ECON-Stores-02]
Overview
The purpose of this guide is for game makers to setup a complete store experience using Beamable.
This guide includes everything needed to use the Store Flow Feature PrefabFeature Prefab - The drag-and-drop template for a specific Beamable product feature in the "Beamable SDK for Unity". Or watch this video.
Video Series
Part 1 & 2
Part 3
Game Maker User Experience
There are 3 major parts to StoreStore - A collection of Beamable store listings setup process. During development, the game maker's user experience is as follows:
Steps
Follow these steps to get started:
Note: The game maker is to choose either Step 1a or Step 1b. Not both.
Step 1a. Set up Unity IAP
This step assumes a dependency on Unity's UnityIAP solution. There is little or no custom code required for this solution.
A benefit here is fast development.
Step | Detail |
---|---|
| • Unity → Window → General → Services |
|
|
Step 1b. Set up Custom IAP
This step assumes no dependency on Unity's UnityIAP solution. There is significant custom code required for this solution.
A benefit here is flexible development.
Step | Detail |
---|---|
| • See Adding Custom Purchaser for more info |
Step 2. Set up Platform
The following assumes a cross-platform mobile project. Adjust the steps according to the specific target platforms as desired.
Step | Detail |
---|---|
| Choose exactly one of the following solutions
|
Gotchas
Here are hints to help explain some of the trickier concepts:
• These platform-specific instructions are subject to change because platform development is rapid.
• App Store SKU’s must be properly setup in the App Store(s) before the system will allow the player to complete a Hard CurrencyHard Currency - A currency type rewarded to the player through IAP transactions of real-world money. (Ex. Gems) purchase.
• The Google Play Console requires an .apk (or .aab) to be uploaded that has billing permissions, before allowing the user to create in-app products. This should be enabled by default if you have the Unity IAP service enabled.
Step 3. Set up Beamable Content
For simplicity, some Beamable data structures may be omitted from this diagram.:
For the setup, objects of types StoreStore - A collection of Beamable store listings, ListingListing - A collection of Beamable store items, ItemItem - An archetype of a Beamable store object. There may be a single instance or multiple instances of each., and SKUSKU - A Stock Keeping Unit is a unique indicator of a Beamable store item in an platform App Store are needed. In the following steps, one of each type of object is created.
Note: An ItemItem - An archetype of a Beamable store object. There may be a single instance or multiple instances of each. is a resource archetype, meaning one can be represented in multiple ListingListing - A collection of Beamable store itemss by using a Lookup TableLookup Table - A data structure which represents a collection of keys - each mapped to one or more values an associated script. See Multiple Listings With Same Item below for more info.
To ease the process, the objects are created in reverse order; starting with the lowest-level concept: SKUSKU - A Stock Keeping Unit is a unique indicator of a Beamable store item in an platform App Store.
Step | Detail |
---|---|
| • Unity → Window → Beamable → Open Content Manager |
|
|
|
|
|
|
| |
|
|
|
|
|
|
| • Unity → File → Save Project |
| • Press the "Publish" button in the Content Manager Window |
Step 4a. Setup Beamable UI
Note: The game maker is to choose either Step 4a or Step 4b. Not both.
A benefit here is fast development.
Step | Detail |
---|---|
| • See Store Flow for more info |
Step 4b. Setup Custom UI
A benefit here is flexible development.
Step | Detail |
---|---|
| • See Adding Custom Store for more info |
Advanced
This section contains any advanced configuration options and workflows.
Advanced Listings
The required fields are populated in the Create & Configure the "Listing" content step above.
Here are optional, advanced fields for greater ListingListing - A collection of Beamable store items customization.
Name | Detail |
---|---|
Purchase Limit | • Restrict the total lifetime purchase quantity per-player |
Player Stat Requirement | • Restrict the listing to only players with a specific stat value Example: Available only to players with |
Offer Requirement | • Restrict the listing to only players who have purchased another listing Example: The "Arrows" are available only to players who purchased the "Bow" |
Client Data | • Add arbitrary name/value pairs to be sent along with the listing. For advanced use cases |
Button Text | • Additional flavor-text Example: "Buy Today!" |
Scheduled Offers
Beamable allows you the ability to schedule particular offers in a store to be available to players starting at a particular date and ending on another date. For example, players will only see a Christmas special offer only during the week of Christmas.” Pairing this to the previously mentioned “SET TIME” cheat and you can be sure that what will be delivered to players is what you’d expect.
The required fields are populated in the Create & Configure the "Listing" content step above.
Here are optional, advanced fields to setup Scheduled Offers for a ListingListing - A collection of Beamable store items.
Name | Detail |
---|---|
Active Period | • Restrict the listing to only after a start date |
Limited Time Offers
These are very similar to Scheduled Offers but these are player specific. For example, when a player first sees an offer, that player has N minutes to purchase before the offer is no longer available. This creates a sense of urgency to make sure to “get it before it’s too late!”
The required fields are populated in the Create & Configure the "Listing" content step above.
Here are optional, advanced fields to setup Limited Time Offers for a ListingListing - A collection of Beamable store items.
Name | Detail |
---|---|
Active Duration Seconds | • Restrict the listing to only a limited time-frame after the player sees the listing in the store Example: "Available for 24 hours from... now." |
Active Duration Cool Down Seconds | • This requires "Active Duration Seconds" Example: "Available for 24 hours from... now. After that, available again in 72 hours." |
Active Duration Purchase Limit | • This requires "Active Duration Seconds" Example: "Available for 24 hours from... now. Maximum 3 purchases allowed." |
Multiple Listings With Same Item
An ItemItem - An archetype of a Beamable store object. There may be a single instance or multiple instances of each. can be singularly represented with an icon as shown above. For example, the data can represent exactly one "Hat".
However an ItemItem - An archetype of a Beamable store object. There may be a single instance or multiple instances of each. can also be re-instanced multiple times for use in the same game project. For example, the data can represent a category of "Hats" with specific sub-types like "Normal Hat", "Magic Hat", and "Stylish Hat".
A Lookup TableLookup Table - A data structure which represents a collection of keys - each mapped to one or more values allows for reuse of one Item archetype rather than create new ItemItem - An archetype of a Beamable store object. There may be a single instance or multiple instances of each.s for each ListingListing - A collection of Beamable store items. The Lookup TableLookup Table - A data structure which represents a collection of keys - each mapped to one or more values may define the name, behavior, icon, and more for each instance of the defined ItemItem - An archetype of a Beamable store object. There may be a single instance or multiple instances of each. archetype.
To create one ItemItem - An archetype of a Beamable store object. There may be a single instance or multiple instances of each. and for use in multiple ListingListing - A collection of Beamable store itemss follow the steps below.
Step | Detail |
---|---|
| • Create a new C# file |
| • Unity → Asset → Create |
|
|
Code
Beamable SDK Examples
• The following example code is available for download at GitHub.com/Beamable_SDK_Examples
Here is the code for step #1 above. It is presented as inspiration, however the actual code needed will vary per the specific needs of the project.
using UnityEngine;
using Beamable;
using Beamable.Common;
namespace Beamable.Examples.Features.StoreFlow
{
[System.Serializable]
public struct HatLookupEntry
{
public string Name;
public HatBehaviour Hat;
public Sprite PreviewSprite;
}
[CreateAssetMenu(
fileName = "MyCustomHatLookupTable",
menuName = "Beamable/Examples/Features/MyCustomHatLookupTable",
order = 0)]
public class MyCustomHatLookupTable : ScriptableObject
{
public List<HatLookupEntry> Hats;
public HatBehaviour GetHatPrefab(string name) => GetHatEntry(name).Hat;
public HatLookupEntry GetHatEntry(string name) =>
Hats.FirstOrDefault(entry =>
entry.Name.Equals(name,
StringComparison.CurrentCultureIgnoreCase));
}
}
Configuration of Item Renderers
The ShopConfiguration
asset file contains references for these renderers.
- ListingRenderer - This determines the rendering of each ListingListing - A collection of Beamable store items UI within the overall StoreStore - A collection of Beamable store listings UI. The default value is
BasicListingRenderer
. - ObtainRenderer - This determines the rendering of each ItemItem - An archetype of a Beamable store object. There may be a single instance or multiple instances of each. UI within the overall ListingListing - A collection of Beamable store items UI. The default value is
ObtainSummaryListRenderer
.


The "Shop" within the Beamable Configuration Manager
The defaults are provided automatically for basic functionality. Override as needed for advanced use cases. The default object's source code is viewable and serves as the starting points for creating custom overrides.
Updated about 1 month ago