Developer Console

Step-by-Step Guide: Testing In-App Purchases for Amazon Apps

Moses Roth Mar 12, 2025
Share:
Best practices
Blog_Header_Post_Img

In-app purchasing (IAP) can be one of the best ways for you to make money with your app. That’s why it’s essential to test your purchase flows and make sure everything is working correctly before you launch your app. A well-tested IAP system ensures a smooth user experience and prevents transaction failures, so that your users are satisfied and you make money on every purchase.

Testing your IAP flows involves verifying purchase functionality, validating receipts, and handling edge cases such as failed transactions or interrupted purchases. Simulating real-world user behavior will help you identify and resolve potential issues before your app goes live.

We provide two primary tools for testing IAP: App Tester, for local, isolated testing in sandbox mode, and Live App Testing (LAT), for testing your app in a live environment with real testers before making it publicly available.

For this guide, we’ll focus on testing IAP with LAT, which provides a smooth user experience and enables fast publishing and quick feedback across a broad set of devices.

Overview of Live App Testing

LAT is a crucial step in preparing your app for public release, because it offers these features:

  • Ensuring real-world scenarios are covered: LAT provides a testing environment that closely mirrors actual usage conditions, helping developers uncover issues that might not appear in sandbox testing.

  • Handling actual user behavior: By using real testers, developers can identify usability concerns and potential edge cases that might affect actual customers.

  • Detecting potential issues missed during other test modes: LAT enables developers to catch bugs related to device compatibility, network conditions, and real payment processing flows, all of which may not be apparent in other testing modes.
  •  

By leveraging LAT, you can gain confidence in your app’s stability, improve the user experience, and avoid costly issues that may arise once your app is live and public.

Remember that you must use the Amazon IAP API, if you want make digital content available for purchase in your app, per the Amazon Appstore policy.

Prepare your app to use the IAP SDK

To follow along with this guide, you can clone this GitHub repo of an app built in Kotlin that facilitates an IAP subscription to a magazine, which is referenced and pictured below.

Obtain your app’s public key

For your app to authenticate to the IAP API, it must include the public key which is generated by the Amazon Appstore.

1. Go to the Developer Console dashboard

2. Click Apps & Services in the top navigation bar

3. Open your app, or if you haven’t created one yet, click Add New App

4. Enter any necessary details, and then scroll to the bottom of Step 1: Upload Your App File

5. Under the Additional information section, click View public key

Overview of Live App Testing

LAT is a crucial step in preparing your app for public release, because it offers these features:

  • Ensuring real-world scenarios are covered: LAT provides a testing environment that closely mirrors actual usage conditions, helping developers uncover issues that might not appear in sandbox testing.

  • Handling actual user behavior: By using real testers, developers can identify usability concerns and potential edge cases that might affect actual customers.

  • Detecting potential issues missed during other test modes: LAT enables developers to catch bugs related to device compatibility, network conditions, and real payment processing flows, all of which may not be apparent in other testing modes.
  •  

By leveraging LAT, you can gain confidence in your app’s stability, improve the user experience, and avoid costly issues that may arise once your app is live and public.

Remember that you must use the Amazon IAP API, if you want make digital content available for purchase in your app, per the Amazon Appstore policy.

Testing IAP Additional Information Screenshot

6. Download the key (AppstoreAuthenticationKey.pem) to your local machine

7. Copy this key to your project, for Kotlin projects, the key goes into the app/src/main/assets folder

8. Now that you have your app’s unique public key, build your APK bundle file

Create a new test in LAT

To set up a new test in LAT, go back to the Developer Console, and proceed to the Live App Testing section.

1. Click Live App Testing in the side navigation bar from within your app submission

Testing IAP Additional Information Screenshot

2. Click Create a new Live App Test

Testing IAP Additional Information Screenshot

3. Upload the recently built APK file from your local machine

This version of your app should have the app’s unique public key in it, along with the necessary in-app purchase functionality. Use the same version intended for production release, incorporating proper logging and debugging tools for effective issue resolution.

Testing IAP Additional Information Screenshot

After Amazon validates your uploaded file, you should see it listed like this:

Testing IAP Additional Information Screenshot

4. Add any needed details (don’t worry about adding testers yet)

5. Click Submit Test

Testing IAP Additional Information Screenshot

Add test IAP items to LAT

After creating a LAT version of your app, you need to add IAP items for testing.

1. Click in In-App Items in the side navigation bar

Testing IAP Additional Information Screenshot

2. At the top of the page, click Add Single IAP

There are three categories of purchasable items:

  • Consumables: Purchases that are consumed within the app, such as extra lives, extra moves, or in-game currency. May be purchased multiple times.
  • Entitlements: One-time purchases to unlock access to features or content within an app or game.
  • Subscriptions: Offers access to a premium set of content or features for a limited period of time.

3. Click Add a Subscription (for the purposes of this walkthrough, late you can set up other types)

Testing IAP Additional Information Screenshot

4. Enter a title and SKU

Each item needs a SKU, and it must be unique across your entire developer account, not just within a single app.

5. Click Add Subscription

Testing IAP Additional Information Screenshot

6. Add the needed details

Like with an app, a Display Title is the title your customers will see, which can be different than the Subscription Title, which is for your internal identification.

Testing IAP Additional Information Screenshot

7. Click Add New Term

Subscriptions are different from consumables and entitlements in that you can specify subscription terms (such as monthly or quarterly) which will be used to auto-bill subscribers.

8. For each term, provide a unique SKU and specify a subscription price

9. Click Create Term

Testing IAP Additional Information Screenshot

10. Once you are done with your terms, click the Submit IAP dropdown button at the top of the page

You’ll see two options:

  • Submit to Test adds this IAP item for use only within LAT tests. It will be marked with TEST to make this clear.
  • Submit to Test and Live makes this item available within LAT tests, but the item can then be promoted to live use in the production mode. The item will be marked with LIVE. After testing is complete, you can click Promote Test IAP to promote the item to your live app. You can also select multiple IAP items and promote them all at the same time.

11. For this walkthrough, click Submit to Test

Testing IAP Additional Information Screenshot

You can also add a batch of items through a bulk upload using a CSV file (spreadsheet). This is convenient for apps with multiple purchasable items. See our guide to CSV File for IAP Batch Submission for more details.

Add testers

The next step is to add testers to your LAT test session

1. In the side navigation bar, click Manage Testers

Testing IAP Additional Information Screenshot

2. Click Add new testers

3. Enter the email addresses of any tester you want to add

You can organize individual testers into groups for efficient management.

Testing IAP Additional Information Screenshot

4. Use the checkbox to confirm if you have the necessary rights to provide this information

5. Click Add

After you add testers to your LAT testing session, invitations will be sent to your testers, both by email and by push notification to their devices. It may take several minutes for these invitations to arrive.

The test process

Your testers will receive an email invitation to test the app.

Testing IAP Additional Information Screenshot

Testers who wish to accept the invitation will click on the appropriate Amazon marketplace link. If this is a tester’s first time being a LAT tester, they will be asked to agree to the LAT service terms of use.

Testing IAP Additional Information Screenshot

Next, the tester will click Get App, and Amazon will deliver the app to their Amazon device.

Testing IAP Additional Information Screenshot

Testers can immediately begin interacting with the app. Most importantly, they can interact with in-app purchases as they would in a real-world scenario.

Testing IAP Additional Information Screenshot

Alternatively, they can also receive a push notification on their device to download the LAT. Once they’ve downloaded the LAT (either from the email or push notification), they will receive another notification that they are participating in the LAT test session and that the app under test has been successfully installed.

Testing IAP Additional Information Screenshot

At this point, testers can interact with your app as if it were a production app downloaded from the Amazon Appstore. However, one significant difference is that testers will not incur any costs for IAP transactions.

For this demonstration, the tester opens the app and clicks Buy Subscription.

Testing IAP Additional Information Screenshot

Clicking the button calls the IAP API, which fetches product data related to the IAP SKUs (which have been hard-coded into the demo application code). The tester sees information about the subscription IAP and the subsequent subscription terms.

Testing IAP Additional Information Screenshot

The tester chooses a term and clicks Subscribe, resulting in a subscription confirmation message from the app.

Testing IAP Additional Information Screenshot

By using LAT, developers can verify the app behaviors throughout the IAP transaction flow and that IAP API calls are properly made.

After subscribing, testers will receive an email confirming their purchase (although the price will confirm they were not charged).

Testing IAP Additional Information Screenshot

For subscription IAP items, testers can verify and manage their subscriptions in the Amazon Appstore app:

Testing IAP Additional Information Screenshot

Ending a test session

Once you are ready to end a LAT session, return to the Live App Testing page for your app in the Developer Console, where you can end the test and start a new test, or even promote a test to a live public submission, once you are ready.

Testing IAP Additional Information Screenshot

Any IAP items you create will be available for all future LAT test sessions and (if you selected “Submit to Test and Live”) for promotion to the live production environment.

As your LAT testers make IAP purchases for entitlements or subscriptions, those will persist in their accounts throughout the duration of the test session. You can reset a tester’s purchased entitlements or subscriptions on the Manage Testers page for your app. Select the testers you want to reset and click Choose an action and decide which IAP type to reset.

Testing IAP Additional Information Screenshot

Throughout the testing session, developers should monitor test logs, analyze performance metrics, and gather insights from tester feedback. Addressing any issues before the final release ensures a seamless purchasing experience for customers once the app is live.

Other considerations

Conducting realistic tests is essential to uncovering potential issues before launch. As an app developer using IAP in your apps, you should simulate various cases, including product data retrieval, subscription checks, and successful purchases.

Reviewing LAT results thoroughly ensures that all purchase flows work as expected. Logs and tester feedback provide valuable insights into areas that need refinement. These possible areas also include latency issues and error handling. In addition, addressing edge cases, such as network interruptions during purchases, helps create a more robust in-app purchase experience.

Conclusion

Thorough testing of IAP flows in an app is critical to provide a seamless user experience and maximize revenue. By simulating real-world conditions, you will ensure that an app’s IAP flows work as expected before launching publicly.

For additional insights and detailed testing resources, refer to:

Sign up for our newsletter

Stay up to date with the latest Amazon Developer news, industry trends and blog posts.