# Install and use the IAP AI skill

> Install the In-App Purchasing AI skill into your AI assistant and prompt it to migrate to or integrate IAP v5.

Install the In-App Purchasing (IAP) AI skill from the Unity Editor into your preferred AI assistant, then prompt the assistant to perform a migration or integration for you. If you subscribe to Unity AI Assistant or Unity AI Desktop, the skill is already built in, so you can prompt the assistant without any installation. To understand what the skill does before you install it, refer to [Introduction to the IAP AI skill](./ai-skill-introduction.md).

## Prerequisites

Before you start, make sure you meet the following prerequisites:

* Install In-App Purchasing version 5.3.0 or later. For more information, refer to [Install Unity IAP](./get-started.md).
* Set up a compatible AI assistant, such as Claude Code.

## Install the skill

If you subscribe to Unity AI Assistant or Unity AI Desktop, the skill is built in and you don't need to install it. Continue to [Write an effective prompt](#write-an-effective-prompt).

To install the skill in any other AI assistant, complete the following steps:

1. In the Unity Editor, select **Project Settings** > **Services** > **In-App Purchasing**.
2. At the bottom of the page, choose one of the following options:
   * **Open Skills Folder**: Opens the folder that contains the skill files. Use this option to copy or install the skill in your preferred AI assistant.
   * **Install to Claude Code**: Adds the skill directly to Claude Code as a skill named `in-app-purchases`.

After you install the skill, it's available to run from your AI assistant.

## Run the skill

To run the skill, complete the following steps:

1. Make the skill available in your assistant:
   * In Unity AI Assistant or Unity AI Desktop, prompt the assistant as usual. Keywords such as `in-app purchase` or `migrate native billing` activate the built-in skill automatically.
   * In Claude Code, prompt the assistant as usual. Claude Code activates the `in-app-purchases` skill automatically when your request matches it.
   * In another assistant, reference the `SKILL.md` file at the start of your prompt so the assistant loads the skill, for example: `Read the in-app-purchases SKILL.md and follow it.`
2. Prompt the assistant to perform the migration or integration you want. For a conversion, ask for a report before any code changes, for example: `Migrate my IAP code from v4 to v5. Show a report of the changes before you edit anything.`
3. Review the report the skill generates, then approve it to let the skill apply the changes.
4. Confirm that your project compiles, and complete any manual steps the report lists.

After the skill applies its changes, review the diff and test purchases on a real device with a sandbox or test account before you release your game. The Editor doesn't reproduce pending, deferred, or restore purchase behavior.

> **Tip:**
>
> If the skill produces v4 code, such as `IStoreListener` or `UnityPurchasing.Initialize`, prompt the assistant again and state explicitly that your project uses Unity IAP v5 and that the assistant must follow the skill.

## Write an effective prompt

Prompt the assistant in plain language. To get accurate results, include the following details in your prompt:

* The backend you use: For example, write `My project uses Cloud Save from Unity Gaming Services` or `I call BillingClient through AndroidJavaObject`. This detail helps the skill confirm the correct task path when it scans your project.
* Your products and their types: For example, write `a 100-coin pack (Consumable) and a Remove Ads unlock (NonConsumable)`. The skill needs product IDs and types to generate correct grant logic.
* What each purchase grants: For example, write `after the coin pack, add 100 to PlayerData.coins and save`. Otherwise, the assistant guesses how your economy works.
* A request for a report before any code changes: For example, write `Provide a migration report and don't change any code yet`. This is the safest way to start a conversion.
* Your platforms and constraints: For example, write `Android and iOS, subscriptions involved, backend validates receipts`. Blockers then surface earlier.

For an example prompt for each task, refer to [IAP AI skill capabilities reference](./ai-skill-features.md).
