> For the complete documentation index, see [llms.txt](https://docs.candy-smith.com/main/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.candy-smith.com/main/block-puzzle-game-toolkit/setting-up-in-app-purchase-products.md).

# Setting Up In-App Purchase Products

This guide will walk you through the process of setting up in-app purchase (IAP) products for your Spot the Difference game's store.

### Product Types Overview

Your game includes two main types of IAP products:

1. Coin Products: These are consumable items that players can purchase to obtain in-game coins.
2. No Ads Product: This is a non-consumable item that removes ads from the game when purchased.

### Locating the Product Definitions

1. In the Unity Editor, navigate to your Project window.
2. Go to `Assets >` BlockPuzzleGameToolkit `> Resources > ProductIDs`.
3. Here you'll find the product definitions for your IAPs.\ <br>

   <figure><img src="/files/EpBY8fiImIaltiBqZAeH" alt=""><figcaption></figcaption></figure>

### Coin Products Setup

You have multiple coin products available:

* CoinsProduct1
* CoinsProduct2
* CoinsProduct3
* CoinsProduct4

For each Coin Product:

1. Select the product in the Project window.
2. In the Inspector, you'll see the following settings:
   * **Id**: The unique identifier for the product (e.g., "CoinsProduct1")
   * **Product Type**: Set to "Consumable"

Example for CoinsProduct1:

* Id: CoinsProduct1
* Product Type: Consumable\ <br>

  <figure><img src="/files/luTdCZ5P8Zmo7r0ZKfqD" alt=""><figcaption></figcaption></figure>

### No Ads Product Setup

To set up the No Ads product:

1. Select the "NoAds" product in the Project window.
2. In the Inspector, configure the following:
   * **Id**: Set to "noAds"
   * **Product Type**: Set to "Non Consumable"\ <br>

     <figure><img src="/files/jKxg5XdtUC3xAoNI4Hbq" alt=""><figcaption></figcaption></figure>

### Best Practices

1. **Unique Identifiers**: Ensure each product has a unique Id that matches the identifier in your app store console (Google Play Store, Apple App Store, etc.).
2. **Consumable vs Non-Consumable**: Double-check that coin products are set as "Consumable" and the No Ads product is set as "Non Consumable".
3. **Naming Convention**: Maintain a clear naming convention for easy management, especially if you plan to add more products in the future.
4. **Version Control**: Keep these product definitions under version control to track changes over time.

### Integration Steps

1. **Store Integration**: Ensure your game's store UI references these product Ids correctly when initiating purchases.
2. **Purchase Validation**: Implement proper purchase validation logic in your game to verify and process these products when purchased.
3. **Store Listing**: Update your app store listings with the corresponding product information, ensuring the Ids match exactly.

### Technical Note

These product definitions are used by Unity's IAP system to manage in-app purchases. Make sure you have the Unity IAP package installed and properly configured in your project.

By following this setup, you'll have a structured system for managing in-app purchases in your Spot the Difference game, allowing players to buy coins and remove ads seamlessly.
