All Collections
Portal Pages
Design | Marketplace | Products
Design | Marketplace | Products

Sell virtual currencies and bundles to your users

John Harley avatar
Written by John Harley
Updated over a week ago

The products page is where you define products and bundles and consider default and sale prices. 

Casino game example.

To get started, find the Products page on the brainCloud portal.  

Creating a product

  • You will click [Add Product] to create your initial product.

  • Item Id is a unique id for your product. You will use this id within the brainCloud APIs to identify your product.

  •  Title of your product.

  • Category is an optional field that allows you to categorize your products. When communicating with brainCloud you can ask for only a certain category of product (for cases where you have many products defined). Checking the related API GetSalesInventoryByCategory() for detail.

  • Description of your product

  • Product Type, configures what type of product you are defining. This is mostly related to the third party store that you are linking to the product.

  • Consumable – A one-time consumable product. Once purchased, this product will be consumed once and only once. Most products fall into this product type

  • Non-consumable – A product which can never be consumed. Buying an item in your game that can never be used up (say a special sword) might be an example of a non-consumable.

  • Subscription – A subscription to something in your app. Again this is mostly determined by the third party store item configuration as subscriptions generally incur some sort of regular charge to the end user.

  • Currency Type, the type of virtual currency to award

  • Currency Value, the amount of virtual currency to award

  • Prices, a list of prices for the item. We will configure this in the next section so you can leave it blank for now.

  • Extra Data, any custom key/value data pairs you’d like to attach to the product.

  • [Save] when done 😄

Add Prices to Your Product

After having created a product, you’ll want to attach some prices to it so that users can see and purchase it. Products by default are created with a “Not for sale” price which means they won’t show up in any of the brainCloud API requests for products. Let’s add a price so we can see our product.

Add a default price

  • If you just created the product, you should already see the [Add Price] button for your product. If not, select a product in the marketplace product table and make sure the product is in “Edit” mode, and click [Add Price] button.

  • Enter a default price which will be used to calculate internal brainCloud analytics such as daily/total revenue. Note this is NOT the actual price charged to the user. That information is defined elsewhere depending on the third party store being integrated. At this time you can also enter your third-party store information. If you’re unsure of what to enter here please refer to the “Third Party Store Integration” tutorials in the portal section for your appropriate third-party store.

  • Click Save.

  • Next, we can select our newly created price as the default. Note you may have to hit the “Edit” button at the top of the product dialog.

  • Click Save and that’s it!

  • For the more curious amongst you, you can also verify that your product is coming back in the Product GetSalesInventory API call using the Cloud Code API Explorer.

Design

It is common to underestimate the amount of effort that should be put into Product Design. Some suggestions follow.

Design suggestions: 

  • Create a basic set of products to establish an anchor value proposition. Basic products should only include one currency type. 

  • For Basic products at higher price points, offer more value per dollar spent.  

  • You may wish to avoid putting a product at the one dollar price point, since it is difficult to put these on sale on certain platforms.

  • When rigging a product, it is recommended to rig some discounted price points so if you decide to run a Basic Product sale, the pricing for the sale is already hooked up. 

  • When using a discount to drive sales, it is most effective to show the discount on the offer card so the player can understand the added value. eg. "50% off"

Promotions work in tandem with Products to offer your customers special value packages on regular intervals. brainCloud leverages your Products through the DESIGN | Promotions page.  When your Designer sets up Basic Products, it is a good time for them to also set up Products for each Promotion you want to run. 

Promotion Product Ideas:
Here are some of the most effective ideas for Promo Bundles:

  • Design a New Player Offer. The NPO should trigger after the tutorial and some brief game play that shows the player is interested in your game. The NPO should include a combination of items/currencies, and show a great value in comparison to your Basic products. This offer should be a one-time offer, and time-limited. These offers are typically most successful in the $5-$10 range. 

  • In particular, including an otherwise impossible-to-collect vanity item in any bundle improves the sell-through of that bundle. However, you should limit bundles with a vanity item to one-time sales, since players may not see value in buying the same vanity item twice. 

  • Create a Once-a-week Deal that offers a good value over the Basic Products for a small price. Offering these only during weekends improves their appeal. eg. "Weekend Booster"

  • Create one-time offers at key milestones of the player career. For example upon reaching "Level 20", "Level 30", etc... While the value should be superior to the Basic Products, the price for these offers can be medium to large, corresponding to the length of play invested.

  • Create one-time Seasonal bundles (eg. Easter, Halloween, XMas...) that include a combination of items. Vanity items corresponding to the season are highly sought after by players.

  • Create a time-limited Skill-based Promo to offer when the player demonstrates mastery of the game. For example, make an offer to the top player of a Weekly Leaderboard, or an offer when a player beats a tough boss. 

When rigging Promotion prices, rig both the MSRP (base price) and the discounted price you will actually be offering it at. Set the base price as the default. The discount will be applied in the DESIGN | Promotions page.

Writing the code

Now that you created products, on both the brainCloud portal, and on the third-party store portal, you will want to handle the purchasing in your app.

In your client code

  • Add the brainCloud client to your app

  • Pair the client with the dashboard

  • Authenticate your user into brainCloud

  • Request the sales catalog of products

  • Handle the third-party purchase logic. 

  • An example for Google Play can be found here.

  • Verify the receipts returned by the third-party stores

  • Review other achievement related calls for your app in the API Reference

void Start()
{
    // Unity
    GameObject go = new GameObject();
    _bc = go.AddComponent<BrainCloudWrapper>();
    _bc.WrapperName = _wrapperName; // optionally set a wrapper-name
    _bc.Init(); // extra data, such as: _appId, _secret and _appVersion, is taken from the brainCloud Unity Plugin.
    DontDestroyOnLoad(go); // keep the brainCloud game object through scene changes

    _bc.AuthenticateAnonymous((response, cbObject) => { GetSalesInventory(); });
}

List<string> salesPurchaseIds = new List<string>();
void GetSalesInventory() {
    _bc.AppStoreService.GetSalesInventory("itunes", "{\"userCurrency\":\"USD\"}",
        (response, cbObject) =>
        {
            var jsonMessage =
                (Dictionary<string, object>) BrainCloud.JsonFx.Json.JsonReader.Deserialize(response);
            var jsonData = (Dictionary<string, object>) jsonMessage["data"];
            var productInventory = (Dictionary<string, object>[]) jsonData["productInventory"];

            foreach (var product in productInventory)
            {
                var priceData = (Dictionary<string, object>) product["referencePrice"];
                var ids = (Dictionary<string, object>[]) priceData["priceData"];
                foreach (var id in ids)
                {
                    // Grab the ID needed for the current platform. ex. iphone.
                    if (id["appId"].Equals("iphone"))
                    {
                        salesPurchaseIds.Add((string)id["itunesId"]);
                    }
                }
            }

            ThirdPartyStorePurchase();
        });
}

void ThirdPartyStorePurchase() {
    // TODO Handle what the third party store requires to make a purchase.
    // Collect the receipt data the store provides.
    var receiptData = "TODO";
    // When done, verify those purchases with brainCloud
    VerifyPurchase(receiptData);
}

void VerifyPurchase(string receiptData)
{
    _bc.AppStoreService.VerifyPurchase("itunes", receiptData,
        (response, cbObject) => { Debug.Log("Purchase Verified");},
        (status, code, error, cbObject) => { Debug.Log("Receipt Error"); });
}
Did this answer your question?