Add a virtual purchase to your game
Set up virtual purchases to allow players to exchange in-game currency or items for other resources.
Read time 1 minuteLast updated 2 days ago
The following instructions describe how to define the parameters of virtual purchase in your game’s economy.
- In the Unity Dashboard, go to Development > Products.
- Select Economy.
- Select Configuration.
- Select Add resource.
- Give the transaction a resource name, and an ID for use in API calls. For example, if your virtual purchase is for a sword, the item name could be Buy Sword, and the ID is auto-generated from the name but you can change it to anything that suits you and your game.
- Under Type, select Virtual Purchase.
- Fill in the following sections:
- In the What does the player receive? section, set the resource field to a currency or inventory item the player acquires as a result of this transaction, and set the amount of the item the player receives. You can set multiple resources.
- In the What does the player spend? section, set the resource field to a currency or inventory item the player needs to give to acquire the item, and the amount of that item the player needs to spend. You can set multiple resources.
- To add optional custom JSON data you want allocated to this virtual purchase, select Add custom JSON and enter the JSON into the field. Refer to Custom data.
- Select Create.