In-App Purchase

Offer users additional content and services through purchases made within your app.

Overview

In-App Purchase allows you to offer users the opportunity to purchase in-app content and features. Purchases can be made within your app, or directly from the App Store if you choose to promote the products there.

The StoreKit framework connects to the App Store on your app’s behalf to prompt for and securely process payments. The framework then notifies your app, which delivers the purchased products. To validate purchases, you can verify receipts on your server with the App Store or on the device. For auto-renewable subscriptions, the App Store can also notify your server of key subscription events.

A diagram of the interactions between StoreKit, your app, the App Store, and your server that occur during a transaction.

To use In-App Purchase, you must first configure the products you wish to offer users in App Store Connect. As you develop your app, you can add or remove products and refine or reconfigure your existing products.

Understand Product Types

Product types let you use In-App Purchase across a range of business models within your app by providing several different product behaviors. There are four In-App Purchase types you can offer:

  • Consumables are used once and depleted, and can be purchased multiple times.

  • Non-consumables are purchased once and do not expire.

  • Auto-renewable subscriptions to services or content are purchased once and renew automatically on a recurring basis until users decide to cancel.

  • Non-renewing subscriptions to services or content provide access over a limited duration, do not renew automatically, and can be purchased again.

Non-consumables and auto-renewable subscriptions can be synced and restored across devices using StoreKit. When a user purchases an auto-renewable or non-renewing subscription, your app is responsible for making it available across all the user's devices, and for enabling users to restore past purchases.

Topics

First Steps

Setting Up the Transaction Observer and Payment Queue

Set up the capability for your app to receive and handle transactions by adding an observer.

Offering, Completing, and Restoring In-App Purchases

Fetch, complete, and restore transactions in your app.

SKPaymentQueue

A queue of payment transactions to be processed by the App Store.

SKPaymentTransactionObserver

A set of methods that process transactions, unlock purchased functionality, and continue promoted in-app purchases.

Retrieving Product Information

SKProductsRequest

An object that can retrieve localized information from the App Store about a specified list of products.

SKProduct

Information about a product previously registered in App Store Connect.

SKProductsResponse

An App Store response to a request for information about a list of products.

SKProductSubscriptionPeriod

An object containing the subscription period duration information.

SKProductDiscount

The details of a discount offer for a subscription product.

Requesting Payment

SKPayment

A request to the App Store to process payment for additional functionality offered by your app.

SKMutablePayment

A mutable request to the App Store to process payment for additional functionality offered by your app.

SKPaymentDiscount

The signed discount applied to a payment.

SKPaymentQueue

A queue of payment transactions to be processed by the App Store.

Delivering Products

SKDownload

Downloadable content associated with a product.

Restoring Purchased Products

SKReceiptRefreshRequest

A request to refresh the receipt, which represents the user's transactions with your app.

SKRequest

An abstract class that represents a request to the App Store.

SKPaymentTransaction

An object in the payment queue.

SKTerminateForInvalidReceipt

Terminates an app if the license to use the app has expired.

Working with Subscriptions

Offering a Subscription Across Multiple Apps

Support a single auto-renewable subscription across multiple apps.

Enabling Status Update Notifications

Use server notifications from the App Store to monitor and respond to users' subscription status changes.

Promoting In-App Purchases

SKProductStorePromotionController

A product promotion controller for customizing the order and visibility of in-app purchases per device.

Testing Promoted In-App Purchases

Test your in-app purchases before making your app available in the App Store.

Providing Introductory Offers

Implementing Introductory Offers in Your App

Offer introductory pricing for auto-renewable subscriptions to eligible users.

Testing Introductory Offers

Test your introductory pricing in a variety of user scenarios.

SKProductDiscount

The details of a discount offer for a subscription product.

Providing Subscription Offers

Setting Up Subscription Offers

Generate a key and configure offers for auto-renewable subscriptions in App Store Connect.

Implementing Subscription Offers in Your App

Offer discounted pricing for auto-renewable subscription products to eligible subscribers.

Generating a Signature for Subscription Offers

Create a signature to validate a subscription offer using your private key.