Overview of testing in sandbox
Apple provides a sandbox environment that lets you test in-app purchases and Apple Pay transactions using test accounts without incurring charges. This environment uses the infrastructure of the App Store and returns transactions as if payments were successfully processed instead of processing actual payments.
You can test the following scenarios:
To get started, create Sandbox Apple IDs in App Store Connect and use them to sign in to devices that are running a development-signed version of your app. You’ll need to enable Developer Mode on each device so you can use it to test your app.
Alternatively, you can test in-app purchases with StoreKit Testing in Xcode, a local test environment that doesn’t require a connection to App Store servers to test in-app purchases. Use StoreKit Testing in Xcode to test 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.