# Add many in-app purchases at once from a file

> Give an Agent a list of products, and it creates them all in App Store Connect in one run, with their names, descriptions and review screenshots. Then finish them on the In-App Purchases tab.

Source: https://air.build/docs/app-store/add-many-in-app-purchases-from-a-file/

The **In-App Purchases** tab adds one product at a time with **Add Product** (see [Sell in-app purchases and subscriptions](https://air.build/docs/app-store/sell-in-app/#add-a-one-off-product)). When you have many, give an Agent the whole list instead. It writes the list into a JSON file, checks it, and creates every product in one run.

> [!NOTE]
> AirBuild has no button for this. You ask an Agent in the Project's chat, and it uses `asc iap import` (listed under `iap` in [asc: in-app purchases and subscriptions](https://air.build/docs/cli/asc-monetization/#iap)). The products it creates appear on the **In-App Purchases** tab.

## Before you start

- Your app has an App Store Connect record. See [Create your app's App Store Connect record](https://air.build/docs/app-store/create-your-app-record/).
- You've settled on the product IDs. "The product ID is what the app requests from StoreKit and cannot be changed later." Neither can the type.
- The import makes one-off products only: consumables, non-consumables and non-renewing subscriptions. Auto-renewable plans live in a subscription group: see Sell a subscription in [Sell in-app purchases and subscriptions](https://air.build/docs/app-store/sell-in-app/#sell-a-subscription).

## What to put in the list

You don't write the JSON yourself. Type the list in your message, or attach a spreadsheet with one row per product (see [Send photos, files and sketches to an Agent](https://air.build/docs/projects/send-photos-and-files/)). For each product, give:

| What | Required | What it is |
| --- | --- | --- |
| Reference name | Yes | "The reference name is used only in App Store Connect and your reports." |
| Product ID | Yes | Each one only once in the list. |
| Type | Yes | Consumable, non-consumable or non-renewing subscription. In the file: `CONSUMABLE`, `NON_CONSUMABLE` or `NON_RENEWING_SUBSCRIPTION`. |
| Family Sharing | No | On or off. It's off unless you say. |
| Name and description, per language | No | What **App Store Text** holds: a **Display Name** and a **Description** for each language, such as English (U.S.), `en-US`. Each language you list needs a name; the description is optional. Each language appears once per product. "App Review needs at least the app’s primary language." |
| Review screenshot | No | One PNG or JPEG for App Review. Attach it as a file (`.png`, `.jpg` or `.jpeg`) and say which product it's for. |

The command's help says "Pricing, availability, and offers are not part of this command." The file has no place for a **Review Note** either. You add those afterward: see Finish the products, below.

## Import the products

Ask in the Project's chat, for example:

```text
Add these in-app purchases to the app. Show me the plan before you create anything.
- 100 Coins: product ID com.example.app.coins100, consumable. English (U.S.) name "100 Coins", description "A pouch of 100 coins".
- Pro: product ID com.example.app.pro, non-consumable, Family Sharing on. English (U.S.) name "Pro", description "Unlock every feature". The attached pro.png is its review screenshot.
```

1. The Agent writes your list into the import file and runs `asc iap import --dry-run`. That checks the file and lists what would happen, without creating anything: each product is `planned`. It shows you the plan in the chat.
2. Read it. Fix any reference name, product ID or type now, since the product ID and the type can't be changed later.
3. Say yes. The Agent runs the import with `--confirm`. The command creates nothing without it, so the Agent asks you first. For each product it creates the in-app purchase, then its languages, then its review screenshot.
4. The Agent tells you what it made. The command's receipt counts the products created and skipped, the languages and screenshots added, and names a product that failed with its error.

If any product ID in the list already exists on the app, the run stops before anything is created. To add only the new ones, ask the Agent to skip the others: it runs the import with `--skip-existing`, and those products are listed as `skipped`.

If a product fails partway through, the run stops there. The command's help says "the receipt lists every product already created; nothing is rolled back." See If something goes wrong, below.

The command takes a limited number of products in one run. For a long list, ask the Agent to import it in parts.

## Check them in AirBuild

Open the **In-App Purchases** tab (see Open the tabs in [Sell in-app purchases and subscriptions](https://air.build/docs/app-store/sell-in-app/#open-the-tabs)). On iPhone and iPad, pull down to read the catalog from Apple again. The new products are listed with your one-off products, each with its product ID and type. A new product says **Missing Metadata** until it has what App Review needs.

## Finish the products

Tap a product to open it. **App Store Text** has the languages the import added, and **Review Screenshot** says **Set** when one was uploaded. **Price and Storefronts** says **Not Priced**: the import doesn't price anything.

- Set each price under **Price and Storefronts**, and add a **Review Note**. See Finish a product for App Review in [Sell in-app purchases and subscriptions](https://air.build/docs/app-store/sell-in-app/#finish-a-product-for-app-review).
- To price many products at once, or to give some countries their own price, ask an Agent. See [Set a different price in some countries](https://air.build/docs/app-store/price-by-country/#in-app-purchases-and-subscriptions).
- When they're **Ready to Submit**, send them to App Review. See Send products to App Review in [Sell in-app purchases and subscriptions](https://air.build/docs/app-store/sell-in-app/#send-products-to-app-review).

## If something goes wrong

**The Agent says the product IDs already exist on the app.**

The message reads `product ID(s) already exist on app … (use --skip-existing to skip them)`. Nothing was created. Ask the Agent to skip those products, or change their product IDs in your list.

**The Agent says the type must be one of CONSUMABLE, NON_CONSUMABLE, NON_RENEWING_SUBSCRIPTION.**

A product has another type, such as an auto-renewable subscription. The import can't make those. Add the plan to a subscription group on the **In-App Purchases** tab: see [Sell in-app purchases and subscriptions](https://air.build/docs/app-store/sell-in-app/#sell-a-subscription).

**The Agent says there's a duplicate productId or a duplicate locale.**

Two products in your list have the same product ID, or one product lists the same language twice. Correct the list and ask again. Nothing was created.

**The Agent says a review screenshot isn't a PNG or JPEG.**

The messages read `review screenshot "…" is not a PNG or JPEG image`, or that the file has another extension and "App Store Connect accepts only .png, .jpg, or .jpeg file names". Export the picture as PNG or JPEG, attach it again, and ask the Agent to try once more.

**The run stopped partway through.**

The products created before the failure stay in App Store Connect. The receipt names the product that failed and the error. That product may have been created without all its languages or its screenshot: open it on the **In-App Purchases** tab and add what's missing. Then ask the Agent to import the rest, skipping the products that now exist.

**Can I undo an import?**

Not as a whole: nothing is rolled back. To remove a product, open it and tap **Delete Product**. "A product that has ever been purchased cannot be removed." See Delete a product or plan in [Sell in-app purchases and subscriptions](https://air.build/docs/app-store/sell-in-app/#delete-a-product-or-plan).
