# IAP AI skill capabilities reference

> Explore the migration and integration tasks the In-App Purchasing AI skill can perform, including what each task changes and its limitations.

The In-App Purchasing (IAP) AI skill supports the following tasks. The skill scans your project to determine which task applies, then follows one task path. Before you run any task, review how the skill works and how to prompt it safely in [Introduction to the IAP AI skill](./ai-skill-introduction.md).

Each task uses an example prompt to show how to start. Adapt the product IDs, types, and grant logic to your project. For migrations and conversions, ask the skill for a report before it changes any code.

## Add IAP to a project

The skill sets up Unity IAP v5 in a project that has no purchasing logic yet, such as a project with a shop scene UI but no purchase handling. The skill installs the package and creates an `IAPManager` class that matches your project's patterns. It implements the [two-step purchase flow](./purchases.md), connects that flow to your shop buttons, and integrates it with your save system. If your project has non-consumables or subscriptions, the skill also adds a Restore Purchases button.

The following limitations apply:

* You create your products in App Store Connect and Google Play Console manually.
* Local Google Play validation requires that you run the Receipt Validation Obfuscator (**Services** > **In-App Purchasing** > **Receipt Validation Obfuscator**).

Use the following example prompt:

```text
Add Unity IAP 5 to my game. Products: coins100 (Consumable) grants 100 coins to
PlayerData.coins; removeads (NonConsumable) removes ads. Use my SaveManager to
persist. Android and iOS. Show a plan first.
```

## Migrate from v4 to v5

The skill migrates a project from the IAP v4 API to v5. It replaces `IStoreListener`, `UnityPurchasing.Initialize`, and `ConfigurationBuilder` with the event-driven `StoreController` pattern. The skill moves your `ProcessPurchase` logic into `OnPurchasePending` and `OnPurchasesFetched`, and converts ownership checks from `product.hasReceipt` to `store.CheckEntitlement(product)`.

The following limitations apply:

* `product.receipt` and `product.hasReceipt` are removed, so verify your entitlement logic after migration.
* The developer payload argument is removed, which requires a backend change if you relied on it.
* Apple local validation does nothing under StoreKit 2. Move Apple validation server-side with the JWS representation (`order.Info.Apple.jwsRepresentation`).

Use the following example prompt:

```text
Migrate my IAP code from Unity IAP v4 to v5. Work on a branch and show the
v4-to-v5 mapping before you edit anything.
```

## Convert a Google Play billing integration

The skill converts Android purchases that go through a custom Java `BillingClient` integration to Unity IAP v5. It builds a Unity IAP adapter behind a compatibility facade, so your gameplay code changes little. The skill wraps the previous calls in `#if` guards for rollback and maps the acknowledge and consume operations to a single `ConfirmPurchase` call after the grant.

The following limitations apply:

* Unity IAP v5 doesn't support multiple subscription base plans or offer tokens, personalized pricing, alternative billing, or multi-quantity purchases. The skill can't convert an integration that relies on these features.
* The receipt format changes to `order.Info.Receipt`, which requires a backend update if your server parses raw fields.

> **Warning:**
>
> Don't run a custom billing integration and Unity IAP at the same time. Both contend for the same purchase callback. Use the `#if` guard to switch between them.

Use the following example prompt:

```text
My project calls Google Play BillingClient through a custom Java integration.
Convert it to Unity IAP 5. Provide the migration report and detect any blockers
first. Keep the old code behind #if guards.
```

## Convert an iOS StoreKit plugin

The skill replaces a custom Objective-C or Swift StoreKit plugin with Unity IAP v5, and keeps your game-facing C# purchase API stable through a facade. The skill converts the bridge to Unity IAP and adds handling for promotional purchases and Ask to Buy deferred purchases.

The following limitations apply:

* The receipt format is a breaking backend change: per-transaction JWS replaces the StoreKit 1 receipt bundle. Backends that use `/verifyReceipt` must move to the App Store Server API.
* Unity IAP v5 doesn't support promotional-offer signing or StoreKit 2 win-back offers. The skill can't convert a plugin that relies on these features.
* Objective-C and Swift files can't use `#if` guards, so the skill guards only the C# call sites.

Use the following example prompt:

```text
I have a custom StoreKit plugin that uses SKPaymentQueue. Replace it with Unity
IAP 5 and keep my C# purchase API stable through a facade.
```

## Convert Essential Kit billing

The skill disables VoxelBusters Essential Kit billing and replaces it with Unity IAP v5, while all other Essential Kit features keep working. The skill turns off the billing service flag in `EssentialKitSettings.asset`, removes the conflicting billing Gradle dependency, and implements Unity IAP v5 with the product IDs from the Essential Kit settings.

The following limitations apply:

* Essential Kit source files aren't deleted. The skill only disables the billing flag.
* If you use server-side validation, the receipt format changes. Document the backend change.

> **Note:**
>
> After the skill edits your project, run **Assets** > **External Dependency Manager** > **Android Resolver** > **Force Resolve**, then confirm that billing is disabled in the Essential Kit settings.

Use the following example prompt:

```text
Disable Essential Kit billing and replace it with Unity IAP 5. Keep all other
Essential Kit features working.
```

## Assess and convert a RevenueCat project

The skill assesses whether Unity IAP v5 can handle store purchases while your project keeps most RevenueCat features, then sets up the conversion if it's viable. The recommended result is observer mode, in which Unity IAP performs the purchase and RevenueCat continues to validate it through `SyncPurchases()`.

The following limitations apply:

* Unity IAP v5 doesn't support the Amazon Appstore, so the skill can't convert a project that publishes to Amazon.
* Remote Offerings and paywalls, A/B experiments, cross-platform entitlement sync, and webhook events have no Unity IAP equivalent. Keep RevenueCat for these features, or rebuild them in your project.

> **Note:**
>
> If you omit `SyncPurchases()` after a purchase, RevenueCat never validates it and `CustomerInfo` becomes stale. Both SDKs bundle `com.android.billingclient`. The skill removes RevenueCat's copy (not a project-wide exclude, which would strip Unity IAP's own billing client) and runs Force Resolve.

Use the following example prompt:

```text
My project uses RevenueCat. Assess whether Unity IAP 5 can handle store purchases
in observer mode while RevenueCat keeps validation and subscription tracking. List
what I'd lose, then set it up if it's viable.
```

## Assess and convert an Adapty project

The skill assesses whether Unity IAP v5 can take over store purchases in observer mode while Adapty keeps validating and tracking purchases, then sets up the conversion if you approve. In observer mode, the skill calls `Adapty.ReportTransaction()` after each confirmed purchase.

The following limitations apply:

* The Adapty Paywall Builder has no Unity IAP equivalent and is also unavailable in Adapty's observer mode, so you can't convert the Paywall Builder. You must build the shop UI in Unity instead.
* A/B testing, cross-platform entitlements, and webhook events have no Unity IAP equivalent. Keep Adapty for these features, or rebuild them in your project.

> **Note:**
>
> If you omit `Adapty.ReportTransaction()`, Adapty doesn't validate the purchase. On Android, also call `Adapty.RestorePurchases` at startup to capture missed purchases.

Use the following example prompt:

```text
My project uses Adapty with the Paywall Builder. Assess whether Unity IAP 5 can
take over store purchases in observer mode. Tell me exactly what I lose, then set
it up if I approve.
```

## Assess a UniPay project

The skill assesses whether a UniPay (FLOBUK) project needs to migrate. Because UniPay already wraps Unity IAP for Apple and Google, a project that publishes only to those stores usually needs no conversion. The skill confirms your Unity IAP version and whether D2C payments are available.

The following limitations apply:

* Unity IAP v5 doesn't support the Amazon Appstore. If your UniPay project publishes to Amazon, you can't carry that store forward to v5.
* UniPay's Steam, Meta Quest, PayPal, and Facebook Instant Games integrations have no Unity IAP equivalent. Keep UniPay for those stores.
* D2C payments require the IAP package version 5.4 or later. Upgrade if you're on version 5.0 to 5.3.

> **Note:**
>
> This assessment often concludes that no action is needed, which is a valid result.

Use the following example prompt:

```text
My project uses UniPay. Assess whether I need to migrate to Unity IAP, and whether
I can add a third-party payment provider.
```

## Integrate D2C payment providers

The skill adds Direct-to-Consumer (D2C) payments with a third-party provider (Stripe or Coda) so players can pay through web checkout. The skill creates a separate `StoreController` for the payment provider, a Remote Catalog, deep-link configuration, and the built-in payment picker UI. The new controller coexists with your existing Apple and Google controller.

The following limitations apply:

* Requires the IAP package version 5.4 or later, Unity Editor 2022.3 or later, Authentication 3.7.1 or later, a Unity Cloud project, and a connected Stripe or Coda account.
* Subscriptions aren't supported in D2C v5.4. Only consumables and non-consumables are.
* Web payments are permitted in select regions only, and you're responsible for compliance.

> **Warning:**
>
> Configure a routing rule in the Unity Dashboard before you test. Without a routing rule, `GetEligiblePaymentProviders()` returns an empty list and the purchase UI never appears.

Use the following example prompt:

```text
Add Unity IAP D2C payments with Stripe so players can pay through web checkout.
Consumables and a Remove Ads unlock.
```

For the full D2C workflow, refer to [Integrate D2C payment providers workflow](./payment-providers/workflow.md).

## Work with Codeless IAP

The skill explains how Codeless IAP works and helps you decide between Codeless and scripted setups. For projects that use Codeless IAP, the skill also edits `Assets/Resources/IAPProductCatalog.json` to add products, change prices, and update descriptions, so you don't have to edit the file by hand.

Use one of the following example prompts:

```text
Explain how Codeless IAP works and whether I should use it instead of a scripted setup.
```

```text
Add a $1.99 consumable 'gems_50' to my IAP product catalog.
```
