# Sell in-app purchases and subscriptions

> Set up what your app sells in App Store Connect from the In-App Purchases tab, and see each sale as it happens on the AirPayment tab.

Source: https://air.build/docs/app-store/sell-in-app/

Two tabs cover selling inside your app:

- **In-App Purchases** is your app's catalog in App Store Connect: the one-off products, and the subscription plans in their groups. What you change here is changed at Apple.
- **AirPayment** shows the purchases people make in your app, as they happen: revenue, refunds and each transaction.

Your Agents write the code that sells: ask them in the Project's chat, for example "Add a Pro subscription with a monthly and a yearly plan". They can also set up the products in App Store Connect with `asc` (see [asc: in-app purchases and subscriptions](https://air.build/docs/cli/asc-monetization/)).

## Open the tabs

**iPhone**

Open the Project's chat and tap the tabs button (four squares) in the top-right corner. In the list under the tab cards, tap **In-App Purchases** or **AirPayment**.

**Mac**

Open the Project's chat and choose **View › Go To › In-App Purchases** or **View › Go To › AirPayment**. You can also open the inspector (**View › Show Inspector**, ⌥⌘I), click **New Tab** (**+**) and pick the tab.

**In-App Purchases** opens once your Apple Developer account is connected, an Apple team is switched on, the Project has had its first build and the app has an App Store Connect record. See [Share a beta with TestFlight](https://air.build/docs/app-store/test-with-testflight/#before-you-start) for what the tab shows until then. **AirPayment** doesn't need an Apple Developer account.

## The catalog

The **In-App Purchases** tab lists your one-off products first, with **Add Product** under them. Each subscription group follows as its own section, with **Add Plan** and **Group Settings**. On iPhone and iPad, **Add Product**, **Add Plan** and **Group Settings** are the last rows of their cards; on the Mac they're buttons under the cards. **New Subscription Group** is in the bar under the page; on iPhone it's the **+** at the start of the tab row.

Each row shows the product's name, its product ID and type (or a plan's duration), and where Apple has it, for example **Missing Metadata**, **Ready to Submit**, **Waiting for Review** or **Approved**. While a change is being saved, the row says **Saving…**. On iPhone and iPad, pull down to read the catalog from Apple again.

## Add a one-off product

1. Tap **Add Product**.
2. In **New In-App Purchase**, type a **Reference Name** and a **Product ID**. "The reference name is used only in App Store Connect and your reports. The product ID is what the app requests from StoreKit and cannot be changed later."
3. Choose a **Type** (see the table below).
4. Optionally turn on **Family Sharing**, and write a **Review Note**: "The review note is for App Review only. Say how to reach the purchase in the app."
5. Tap **Create**.

| Type | What it's for |
| --- | --- |
| **Consumable** | "Used up and bought again — coins, hints, a single delivery." |
| **Non-Consumable** | "Bought once and kept forever, restored on every device." |
| **Non-Renewing Subscription** | "Access for a fixed span that the person renews by buying again." |

The product ID and the type can't be changed once the product exists. Use the same product ID in your app's code, or tell your Agents which one to use.

## Finish a product for App Review

A new product shows **Missing Metadata** until it has what App Review needs. Tap the product to open it. Besides **Reference Name**, **Family Sharing** and **Review Note** (save them with **Save**), it has three rows, each opening its own page:

| Row | What you set |
| --- | --- |
| **App Store Text** | Per language, a **Display Name** (up to 30 characters) and a **Description** (up to 45). Tap **+** (**Add Language**) at the top right, pick the **Language**, fill in both and tap **Add**. To change a language, edit its fields and tap **Save**; **Remove** deletes that language right away, without asking. On iPhone and iPad both are the last rows of the language's card (**Save** shows once you've changed something); on the Mac they're buttons under the card. "App Review needs at least the app’s primary language." |
| **Price and Storefronts** | A **Base Storefront** and a **Price** from Apple's price list. "Apple equalizes every other storefront from this one." Under **Availability**, tap **Storefronts** to choose where it sells (**Select All** at the top right; once every storefront is chosen it reads **Deselect All**), and turn on **Sell in New Storefronts** to include storefronts Apple opens later. Tap **Save**. |
| **Review Screenshot** | One PNG or JPEG "showing the purchase inside the app." On iPhone and iPad, tap the empty row to choose a file; later, tap the **File** row for **Replace…** or **Remove**. On the Mac, click **Choose File…**; later **Replace…** or **Remove**. "App Review requires one when a product is first submitted." |

The row on the product says **None**, **Not Priced** or **Set**, so you can see what's left.

### Promote it on the App Store

Turn on **Promote on the App Store** on a product or plan, and tap **Save**. "A promoted purchase can appear on the app’s App Store page and in search results. Apple reviews it, and it needs a promotional image added in App Store Connect before it shows." Turn **Show to Everyone** off to keep it hidden until your app offers it to a particular customer. **Promotion Review** shows where Apple's review stands.

## Sell a subscription

A renewable plan lives in a subscription group, and people switch between the plans of one group, for example "Premium Monthly" and "Premium Yearly".

1. Tap **New Subscription Group** (on iPhone, the **+** at the start of the tab row), type a **Reference Name** (for example "Premium") and tap **Create**.
2. Under the new group, tap **Add Plan**.
3. In **New Subscription**, type a **Reference Name** and a **Product ID**, and choose a **Duration**: **1 Week**, **1 Month**, **2 Months**, **3 Months**, **6 Months** or **1 Year**.
4. Set the **Group Level**. "Level 1 is the highest tier in the group. Moving to a higher tier is an upgrade; moving to a lower tier is a downgrade."
5. Optionally turn on **Family Sharing** and write a **Review Note**, then tap **Create**.
6. Tap the new plan and fill in **App Store Text**, **Price and Storefronts** and **Review Screenshot**, as for a product.

The product ID and the duration are fixed once the plan exists. The reference name is only for App Store Connect and your reports. People see the group's App Store name above the plans, and a group without one says "This group has no App Store name yet — people see it above the plans." The tab doesn't set that name: set it in App Store Connect, or see [Give your subscription group the name people see](https://air.build/docs/app-store/name-your-subscription-group/).

To rename or delete a group, open **Group Settings**. **Delete Group** is the trash at the bottom left on iPhone and iPad, and a button with those words at the bottom left on the Mac; the app asks first. While the group still has plans, it says **Unable to Delete Group**: "A group can only be removed while it has no plans."

### Offers

A plan's **Offers** page has four kinds of offer, each with its own button: **New Introductory Offer**, **New Offer Code**, **New Promotional Offer** and **New Win-Back Offer**.

| Offer | Who gets it |
| --- | --- |
| **Introductory Offer** | "The offer for first-time subscribers to this plan." A free trial applies to every storefront; a paid introductory price is set per storefront. |
| **Offer Codes** | People who redeem a code in the App Store or in the app. In a code offer, tap **Generate Codes** for one-time codes (Apple delivers them in App Store Connect) or **Add a Custom Code**. A code offer can be switched off with **Active**, but not removed. |
| **Promotional Offers** | Subscribers, current or lapsed, that your app chooses to show it to. The app signs the offer when it presents it. |
| **Win-Back Offers** | Lapsed subscribers. The App Store shows it to them automatically. |

The discount is a **Free Trial** ("The plan is free for the offer's length."), **Pay As You Go** ("A lower price is charged each period of the offer.") or **Pay Up Front** ("One payment covers the whole offer.").

To end an introductory, promotional or win-back offer, tap it to open it and tap **Delete Offer**: the trash at the bottom left on iPhone and iPad, and a button with that name at the bottom left on the Mac. The app asks **Delete Offer?** and says what ending it does; tap **Delete Offer** to confirm.

- Introductory offer: "Ending an offer stops new subscribers from receiving it. Current subscribers keep it for its full length."
- Promotional offer: "A promotional offer cannot be changed after it is created. Removing it stops the app from offering it; current subscribers keep their price."
- Win-back offer: "Removing an offer stops the App Store from showing it. Current subscribers keep their price."

## Send products to App Review

The tab doesn't submit products to App Review. When the products are **Ready to Submit**, ask an Agent to submit them, or submit them in App Store Connect. A product or plan sent with an app version is listed under **Submitted Items** on the **App Review** tab (see Follow the review in [Submit to App Review and release](https://air.build/docs/app-store/submit-for-review/#follow-the-review)).

## Delete a product or plan

Open it and tap **Delete Product** or **Delete Plan**: the trash at the bottom left on iPhone and iPad, and a button with that name at the bottom left on the Mac. The app asks **Delete _name_?** and says what's at stake; tap **Delete Product** or **Delete Plan** to confirm. This can't be undone.

- "Removing a product removes it from every version that has not shipped it. A product that has ever been purchased cannot be removed."
- "A plan that has ever been subscribed to cannot be removed."

## See each sale with AirPayment

AirPayment records each purchase your app makes and notifies the Team. It's free with AirBuild.

### Turn it on

1. Open the **AirPayment** tab.
2. Tap **Ask Agents to Add**, then **Send**. The request goes into the Project's chat, and the tab says "Added — the agents are on it", with **Open Chat** to follow the work.
3. Your Agents add purchase reporting to the app. Once they've started, the tab shows **Added** and "Waiting for the first purchase".
4. Install a build with the change, make a purchase, for example in a TestFlight build, and tap **Check Again**. A test purchase is listed like any other, but "Sandbox and TestFlight purchases never count toward revenue."

### What the tab shows

| Item | What it is |
| --- | --- |
| **Revenue**, **Purchases** | Totals for the **Last 30 days**. Revenue is summed in one currency, the one most purchases used. |
| **Refunds**, **Sandbox** | How many purchases were refunded, and how many were test purchases (TestFlight and sandbox). |
| **Purchases (Last 30 Days)** | Purchases per day. |
| **Transactions** | Each purchase, newest first. **Load Older** reads further back. |

Tap a transaction to see its **Product**, **Source** (**App Store** or **Your server**), **Type**, **Quantity**, **Storefront**, when it was **Purchased** or **Refunded**, the **App Version** and the **Device**. Touch and hold a row (on the Mac, right-click it) for **Copy Transaction ID** and **Delete Record**. "This removes the record only. It does not refund the purchase."

To narrow the list, use the filter button (three lines). It's at the top right of the tab on iPhone, and in the inspector's bar on the Mac. Filter by environment (**Production** or **Sandbox**), status (**Completed** or **Refunded**), source and product, or tap **Clear Filters**. The totals and the chart always count every purchase.

### Get notified

Each purchase sends a notification to the people in your Team, except refunded ones and test purchases: Sandbox and TestFlight purchases are recorded but send no notification. The notification's row in the app's notifications has **Open Purchase**, which opens the transaction. To turn these off on your devices, switch off **Purchase Notifications** in Settings › [Notifications](https://air.build/docs/settings/notifications/).

### Purchases paid outside the App Store

If your app also takes payments through your own server, for example with Stripe, the server can report them to AirPayment with a purchase key:

1. On the **AirPayment** tab, tap **Purchase Keys**.
2. Tap **New Key**, type a **Key Name** ("Where this key is used, for example “payments server”.") and tap **Create**.
3. Copy the secret from **Save Your New Key**. "This secret won’t be shown again. Copy it to your server’s secret settings now." Keep it on the server, never in the app or a repository.
4. Copy the **Report URL** too. Your server reports each purchase there, signed with the key.

Each key shows when it was created and last used. To stop one, choose **Revoke**. "Purchases reported with this key stop at once. Create its replacement first. This can’t be undone." Ask an Agent to set up the server side.

For App Store totals as Apple reports them, see [Track sales and App Store search](https://air.build/docs/app-store/track-sales-and-aso/).

## Questions

**Why does my product say Missing Metadata?**

It's missing something App Review needs: **App Store Text** in at least the primary language, a price, a storefront, or for a first submission a **Review Screenshot**. Open the product; the rows that say **None** or **Not Priced** are what's left.

**Can I change a product ID?**

No. Apple fixes the product ID and type (or a plan's duration) when the product is created. Create a new product with the right ID, and delete the old one if it has never been bought.

**Price and Storefronts won't save.**

If the page says "Apple answered with _n_ of this app’s _m_ storefronts…", Apple didn't send the whole storefront list, and saving from part of it would remove the rest. Close the page and open it again.

**The In-App Purchases tab shows an error.**

Reading from App Store Connect failed, and the notice shows Apple's reason. Tap **Try Again**. An error after a change shows above the cards.

**AirPayment still says Waiting for the first purchase.**

The app has to be built with the reporting your Agents added, and a purchase has to be made in that build. Make a test purchase and tap **Check Again**.

**AirPayment shows Unable to Load Purchases.**

The purchases couldn't be read. Tap **Try Again**.

**Does Delete Record refund the customer?**

No. It only removes the record from AirPayment. Refunds are handled by Apple.
