# Add a virtual purchase to your game

> Set up virtual purchases to allow players to exchange in-game currency or items for other resources.

The following instructions describe how to define the parameters of virtual purchase in your game’s economy.

1. From the Unity Dashboard, open **Economy** and select **Configuration**.

2. Select **Add resource**.

3. Set **Choose a type** to **Virtual purchase**.

4. 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.

5. Select **Next**.

6. 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.

7. 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](./custom-data).

8. Select **Create**.

The new virtual purchase now appears on the Configuration page of Economy.

## Additional resources

* [Introduction to resources in Economy](./item-types)
* [Custom data](./custom-data)
