Add a virtual purchase to your game
The following instructions describe how to define the parameters of virtual purchase in your game’s economy.
From the Unity Cloud Dashboard, open Economy and select Configuration.
Select Add resource.
Set Choose a type to Virtual purchase.
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.
The next screen contains these sections to fill.
- In the What does this purchase buy? section, set the resource field to a currency or inventory item the player acquires as a result of this transaction, as well as the amount of the item the player receives.
- In the How much does it cost? section, set the resource field to a currency or inventory item the player needs to give to acquire the item, as well as the amount of that item the player needs to spend.
You can add any optional custom JSON data you want allocated to this virtual purchase by entering it into the Custom Data box. See Custom data.
The new virtual purchase now appears on the Configuration page of Economy.