Test in-app purchases

Overview of testing in sandbox

Apple provides a sandbox environment, which lets you test in-app purchases and Apple Pay transactions without incurring charges using test accounts. This environment uses the infrastructure of the App Store but doesn’t process actual payments. Instead, it returns transactions as if payments were processed successfully.

Users can test the following scenarios:

Scenario

Description

Testing App Store country or region

Associate your sandbox testers with any of the 175 App Store storefronts. This lets you test on different storefronts using the same Sandbox Apple ID, without having to create new testers.

Testing auto-renewable subscription events

Test auto-renewable subscription events, such as renewals, state changes and interrupted purchases without having to wait the length of the subscription duration.

Testing App Store server notifications

Test any server-to-server functionalities your app depends on, such as receipt validation.

Testing Apple Pay transactions

Test your app's implementation of Apple Pay with test credit and debit cards.

To get started, create Sandbox Apple IDs in App Store Connect and use them to sign in to a development-signed version of your app.

You also have the option to test in-app purchases with StoreKit. StoreKit testing in Xcode is a local test environment for testing in-app purchases that doesn’t require a connection to App Store servers. Use StoreKit testing in Xcode for testing in-app purchases before you configure them in App Store Connect, or to test your code when a network connection isn’t available. Learn how to test in-app purchases with Xcode and sandbox.