How to Create Test Accounts for In-App Purchases and Subscriptions
Testing in-app purchases and subscriptions is a crucial step in releasing a monetized app. You don’t want to use real money during development and testing, and Apple provides a simple solution - sandbox test accounts. In this post, I’ll show you how to create and use these accounts to test your in-app purchases without spending real money.
Why Use Sandbox Test Accounts?
Sandbox test accounts let you:
- Test the full purchase flow without real charges
- Verify subscription renewals (at accelerated time intervals)
- Test upgrade, downgrade, and cancellation flows
- Ensure receipt validation works correctly
- Test the restore purchases functionality
Step 1: Create Sandbox Test Accounts in App Store Connect
To create a sandbox test account:
- Log in to App Store Connect
- Click on “Users and Access” in the sidebar
- Select the “Sandbox” tab
- Click on “Test Accounts”
- Click the “+” button to add a new tester
- Fill in the required information:
- First Name and Last Name
- Email Address (use an email you have access to)
- Password (meeting Apple ID requirements)
- Select your territory
Important: Use a real email address that you own, but one that’s not already associated with an Apple ID. You’ll need to verify this email.
Step 2: Configure Your Device for Testing
After creating your sandbox tester, you need to add it to your test device:
- On your iOS device, go to Settings
- Scroll down and tap on Developer
- If you don’t see this option, make sure you’ve installed your app from Xcode at least once
- Tap on StoreKit Testing or Sandbox Apple Account
- Tap Add Account and enter your sandbox account email and password
Step 3: Test In-App Purchases with Your Sandbox Account
Now you’re ready to test purchases:
- Open your app on your test device
- Attempt to make a purchase
- When prompted to sign in with an Apple ID, use your sandbox account credentials
- Complete the purchase process
The purchase will go through as if it were a real transaction, but no actual money will be charged. You’ll see a confirmation showing it’s a sandbox purchase.
Common Issues and Solutions
Sandbox Account Not Working
If your sandbox account isn’t working:
- Make sure you’ve verified the email address
- Check that you’re signed out of your regular Apple ID in the App Store
- Restart your device and try again
“This In-App Purchase Has Already Been Bought” Error
If you see this error:
- Open Settings → App Store
- Sign out of your regular Apple ID
- Try the purchase again, and it will prompt for the sandbox account
Best Practices
- Create multiple sandbox accounts to test different scenarios
- Test all subscription tiers and upgrade/downgrade paths
- Test purchase restoration functionality
- Verify receipt validation with your server (if applicable)
- Test cancellation flows and grace periods
Conclusion
Setting up sandbox test accounts is essential for properly testing in-app purchases and subscriptions. This approach ensures your monetization features work correctly before your app reaches real users, preventing potential revenue loss and negative reviews.
Have you encountered any challenges when testing in-app purchases? Share your experiences in the comments below!
Note: StoreKit testing configurations and sandbox behavior may change with newer iOS versions. This guide is current as of iOS 18.