Documentation

Economy

Economy

Add a real money purchase to your game

Set up real money purchases to allow players to exchange real money for in-game resources.
Read time 2 minutesLast updated a day ago

The following instructions describe how to define the parameters of a real money purchase in your game’s economy.
  1. In the Unity Dashboard, go to Development > Products.
  2. Select Economy.
  3. Select Configuration.
  4. Select Add resource.
  5. Give the transaction a resource name, and an ID for use in API calls. For example, if your real money purchase is for a shield, the item name could be Buy Shield. The ID is auto-generated from the item name, but you can change it to anything that suits you and your game.
  6. Under Type, select Real Money Purchase.
  7. Fill in the following information:
  • 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 then set the amount of the item the player receives. You can set multiple resources.
  • In the Which devices is this available on? section, enter the ID of the purchase in the reference store. If you do not allow the item to be purchased in one of the available stores, then leave the corresponding box empty. Some stores might require additional configuration. Refer to Configure the Google Play Store with IAP.
  1. To add optional custom JSON data you want allocated to this real money purchase, select Add custom JSON and enter the JSON into the field. Refer to Custom data.
  2. Select Create.
The new real money purchase now appears on the Configuration page of Economy.

Integrate in-app purchases using the IAP plug-in

The following process creates a real money purchase using the In-App Purchasing plug-in from Unity:
  1. Configure the products on both the Apple App Store and the Google Play Store.
  2. Define the same products as resources in the Economy configuration.
  3. Define real money purchases within Economy that describe the available in-app purchases and associated rewards.
  4. Retrieve the available real money purchases from Economy at runtime and display them to the player.
  5. Perform an IAP using Unity IAP.
  6. Verify, redeem and securely apply the purchase rewards with Economy.

Configure the Google Play Store with IAP

Google Store configuration requires you to set an additional key at project level. Developers will see an information banner in the Real Money Purchase configuration dialog that informs them to fill the required field, with a link to the page containing the section. To set up Google Play Store for use with IAP:
  1. Retrieve the Google Play License Key in addition to the Product ID for the item.
  2. In the Unity Dashboard, select Home > Projects and open your project.
  3. In the primary navigation menu, select Development > Settings.
  4. In the Google License Key setting, select the Edit pencil icon and add the Google key.
  5. Save the configuration change.

Additional resources