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. Customers can make the purchases within your app, or directly from the App Store. For information about promoting your products in the App Store, see Promoting Your In-App Purchases.

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.

Configure In-App Purchases in App Store Connect

To use In-App Purchase, you must first configure the products in App Store Connect. As you develop your app, you can add or remove products and refine or reconfigure existing products. For more information, see Workflow for configuring in-app purchases.

You can also offer apps and in-app purchases that run on multiple platforms as a single purchase. For more information about universal purchase, see App Store Connect Help.

Understand Product Types

There are four In-App Purchase types you can offer:

  • Consumables are a type that are depleted after one use. Customers can purchase them multiple times.

  • Non-consumables are a type that customers purchase once. They don't expire.

  • Auto-renewable subscriptions to services or content are a type that customers purchase once and that renew automatically on a recurring basis until customers decide to cancel.

  • Non-renewing subscriptions to services or content provide access over a limited duration and don't renew automatically. Customers can purchase them again.

You can sync and restore non-consumables and auto-renewable subscriptions 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

Essentials

Setting Up the Transaction Observer for the Payment Queue

Enable 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.

SKPaymentQueueDelegate

The protocol implemented to provide information needed to complete transactions.

SKRequest

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

Product Information

Loading In-App Product Identifiers

Load the unique identifiers for your in-app products in order to retrieve product information from the App Store.

Fetching Product Information from the App Store

Retrieve up-to-date information about the products for sale in your app to display to the user.

SKProductsRequest

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

SKProductsResponse

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

SKProduct

Information about a product previously registered in App Store Connect.

Storefronts

SKStorefront

An object containing the location and unique identifier of an Apple App Store storefront.

Purchases

Requesting a Payment from the App Store

Submit a payment request to the App Store when a user selects a product to buy.

Processing a Transaction

Register a transaction queue observer to get and handle transaction updates from the App Store.

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.

SKPaymentTransaction

An object in the payment queue.

Purchase Validation

Choosing a Receipt Validation Technique

Select the type of receipt validation that works for your app.

Validating Receipts with the App Store

Verify transactions with the App Store on a secure server.

SKReceiptRefreshRequest

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

Content Delivery

Unlocking Purchased Content

Deliver content to the user after validating the purchase.

Persisting a Purchase

Keep a persistent record of a purchase to continue making the product available as needed.

Finishing a Transaction

Finish the transaction to complete the purchase process.

SKDownload

Downloadable content associated with a product.

Providing Access to Previously Purchased Products

Restoring Purchased Products

Give users functionality that restores their purchases in your app, to maintain access to purchased content.

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.

Subscriptions

Subscriptions and Offers

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

Promotions

Promoting In-App Purchases

Show your in-app purchases on your app's product page.

Testing Promoted In-App Purchases

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

SKProductStorePromotionController

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

Testing in the Sandbox

Testing In-App Purchase Transactions

Verify that you have implemented in-app purchases correctly by testing your code in the sandbox environment.