Test in-app purchases before release
Buy your app's products in a TestFlight build or as a sandbox tester on your iPhone, see the test purchase in AirPayment, and have your Agents change how sandbox purchases behave.
Before your products go to App Review, buy them yourself. A purchase in a TestFlight build, or one made with a sandbox tester’s account, is a test purchase: Apple marks it as sandbox, and AirPayment lists it apart from real sales.
Before you start
- Set up the products on the In-App Purchases tab, and have your Agents add the code that sells them. See Sell in-app purchases and subscriptions.
- To see your test purchases in AirPayment, turn it on first. See Sell in-app purchases and subscriptions.
- Test on an iPhone or iPad. AirPayment keeps only purchases that Apple has signed. A purchase made in a simulator with a local StoreKit configuration file isn’t, so AirPayment refuses it.
Buy in a TestFlight build
- Have your Agents upload a build with the purchase code. See Share a beta with TestFlight.
- Add yourself to a testing group and install the build with Apple’s TestFlight app. See Share a beta with TestFlight.
- In the app, buy the product the way a customer would.
- Open the AirPayment tab. If it still says “Waiting for the first purchase”, tap Check Again. On iPhone you can also pull down on the tab to read it again.
Check the purchase in AirPayment
A test purchase is listed under Transactions like any other, and its row is marked Sandbox. In the totals at the top, it counts under Sandbox, not under Revenue: “Sandbox and TestFlight purchases never count toward revenue.”
- Tap the transaction to see its Product, Storefront and App Version, and check they’re the ones you tested.
- To see only test purchases, open the filter (three lines) and choose Sandbox.
- Test purchases don’t send the Team a purchase notification.
- To clear a test purchase out of the list, touch and hold it (on the Mac, right-click it) and choose Delete Record.
See Sell in-app purchases and subscriptions for every column and filter.
Buy as a sandbox tester
A sandbox tester is a test Apple Account for in-app purchases. You add sandbox testers in App Store Connect.
Sign in with the sandbox tester on the device you test on, then buy in a build of your app installed on it with Install. Install is in the TestFlight and direct-download builds of AirBuild, not the App Store build. See Install your app on your iPhone.
Change how sandbox purchases behave
Ask an Agent in the Project’s chat. Name the tester by their email.
| Ask | What it changes |
|---|---|
| “Set the sandbox tester’s storefront to France.” | The App Store country the tester buys in (--territory). Use it to test a price you set for one country. |
| “Turn on interrupted purchases for the sandbox tester.” | Purchases are interrupted before they finish (--interrupt-purchases), so you can check what the app does then. |
| “Make the sandbox tester’s subscriptions renew faster.” | A monthly subscription renews much sooner, from once an hour to every few minutes (--subscription-renewal-rate). |
| “Clear the sandbox tester’s purchase history.” | The tester’s purchase history is cleared, so you can test buying again (asc sandbox clear-history). |
The Agent tells you in the chat what it changed. To see the tester’s settings, ask “Show my sandbox tester’s settings.” (asc sandbox view).