In-game purchases
How to add, edit, or remove items
1. Get access to admin dashboard
2. Select one of your games and click the store button Items
3. You have access to change items, their description, and prices
How to use Shop API
After you create your items, you can integrate them into your game.
1. First of all, you need to get all your items:
ShopItem
has the same fields as in the admin, and the most important is the id
public class ShopItem
{
/// <summary>
/// The unique identifier of the shop item.
/// </summary>
public int id;
/// <summary>
/// The name of the shop item.
/// </summary>
public string name;
/// <summary>
/// The description of the shop item.
/// </summary>
public string description;
/// <summary>
/// The price of the shop item.
/// </summary>
public int price;
/// <summary>
/// The date and time when the shop item was created.
/// </summary>
public DateTime created;
/// <summary>
/// The date and time when the shop item was last updated.
/// </summary>
public DateTime updated;
}
2. The second important API method is getPurchasedShopItems
:
It gives you all the purchased items by the current player.
Now you can display your shop screen and associate your items with ShopItems
from the API and mark purchased it.
If your item can be purchased infinitely, you can just not mark it. SDK API does not limit you in the number of purchased items per player.
3. Make a code to buy an item by id
After player will see modal window:
If a user doesn't have enough balance, a top-up popup will be shown
If the player confirms a purchase, after all, you will get the response IsSuccessful = true
or status == "success"