A pending purchase can be initiated from the Amazon Kids experience. A child can make a purchase request, which is then reviewed and approved asynchronously by a parent on their own device. For more information about Amazon Kids, see the What is Amazon Kids? help article.
To test Pending Purchases, follow the instructions on this page. The Pending Purchase feature is only supported for entitlement and consumable in-app purchases. Pending Purchases is not available for subscriptions.
For more information on how to implement other features of Amazon's In-App Purchasing (IAP) API in your app, see Implement Appstore SDK IAP. For information specific to implementing the Pending Purchase feature, see Implement Pending Purchases.
You can download the Appstore SDK on the SDK Downloads page. The download includes the JAR file, API documentation, and examples.
Implement Pending Purchases
To implement Pending Purchases in your app, follow the instructions in Implement Pending Purchases. Then, return to this page and continue with the next section.
Set up App Tester for Pending Purchases
App Tester is a tool that enables you to test the in-app purchase flow locally before uploading your app to the Appstore or Live App Testing. This section explains how to install App Tester and how to use it to test Pending Purchases.
To see detailed instructions, click the following button.
Install App Tester
App Tester is a free app that runs on Android mobile devices. Download App Tester from the Amazon Appstore.
Important: App Tester only works with the debug version of your app. You cannot use App Tester with release versions. If you're using a version of your app downloaded from Live App Testing on the Appstore, uninstall it and install a debug version instead.
Configure App Tester
This section explains how to set up App Tester.
Sandbox mode
Run the following command to turn on sandbox mode. Sandbox mode routes calls that would usually go to the Appstore client to go to the App Tester client instead.
adb shell setprop debug.amazon.sandboxmode debug
If you want to exit sandbox mode, use the following command.
adb shell setprop debug.amazon.sandboxmode none
Upload your IAP JSON file
App Tester must have a JSON list of the in-app purchases you want to test. You can automatically create the JSON file through the Developer Console using these steps:
This section describes the Pending Purchases flow in App Tester.
Request a purchase
Open your app and select an in-app item to initiate a purchase. If Pending Purchases is enabled in your app, the dialog that appears has a Request Purchase button.
When you tap Request Purchase, you won't immediately purchase the item. Instead, the request is forwarded to be approved or declined. In the actual customer experience, this request would be sent to a parent or guardian. For this test, you can manage the request in App Tester.
Manage a purchase request
After a purchase is requested, it can be approved or declined from the Manage Transactions tab in App Tester.
Open App Tester and select Manage Transactions. The pending transaction will be shown with options to approve or decline the request.
If you select Approve Request, the in-app item is purchased. The IAP flow continues like other regularly purchased items, and must be fulfilled.
If you select Decline Request, the in-app purchase is canceled.
Set up a live integration test
After you have implemented Pending Purchases in your app and tested it locally using App Tester, you can start a live integration test.
Note: Before you start, use the following commands to uninstall the debug version of your app and App Tester.
Create an Amazon Household with parent and child profiles.
Set up a Live App Test with the version of your app that has the Pending Purchase code.
In the Amazon Kids app on your Fire tablet, add your app to the child profile and enable in-app purchasing.
Initiate an IAP from within the child experience to test the Pending Purchase flow.
To see detailed instructions, click the following button.
Create an Amazon account
If you don't have an Amazon account, go to the Amazon website for your marketplace, such as Amazon.com and create one. Hover over Account & Lists, and select Start here under the Sign in button.
Important: The Fire tablet you are testing on needs to be registered with this account.
Add a child profile
Child profiles can be added from the Amazon website or on a Fire tablet.
Method 1: Add a child profile from the Amazon website
Sign in, hover over Accounts & Lists and select Account under Your Account.
Scroll to Shopping programs and rentals and select Amazon Household.
Select Add a Child. You can add up to four child profiles.
Method 2: Add a child profile from a Fire tablet
On your Fire tablet, launch the Amazon Kids app from the parent profile.
Follow the on-screen instructions to add a child profile.
After adding a child profile, you will see the newly created profile when you launch the Amazon Kids app on the device.
Create a Live App Test
The Appstore's Live App Testing (LAT) feature allows you to test your app in Amazon's production environment. With LAT, you can deliver your app to your Fire tablet and test in-app purchasing. Follow these steps to set up your device.
Go to the Developer Console Dashboard, sign in to your account and select your app. If you don't have an app listing for this app yet, follow these steps:
From the top navigation bar, select Apps & Services > My Apps.
Select Add new app > Android.
Complete the New App Submission page, click Save, then go to step 2.
Select Live App Testing under your app's name.
Select Create a new Live App Test.
Upload your binary file with the Pending Purchase code changes and complete the form. For more details on using LAT, see Get Started with Live App Testing. After you have completed all the required fields, click Submit.
Note: Make sure to send the tester invitation to the Amazon Household parent account that is registered to your Fire tablet.
You will receive an email indicating you've been invited to a Live App Test. Click the link for the Amazon website to be taken to your app's retail web page. Alternatively, you can get to your app's web page with these steps:
Go to the Amazon website for your marketplace (such as Amazon.com).
Select the All menu in the top navigation bar.
Under Digital Content & Devices, select Amazon Appstore, then Your Apps and Subscriptions.
Find your test app and select it to open its retail web page.
Your app's web page will look similar to the following image. Choose to deliver the app to your Fire tablet.
The test app will appear on your Fire tablet in the parent profile.
Add your app to the child profile
After your app is available in the parent profile account, you need to add it to the child account. Follow these steps.
Open the Amazon Kids app.
You will see a list of the child profiles in your Household. Tap on the gear icon next to a child profile to go to the settings screen.
Select Add Content and then Share Content.
Tap Games & Apps, then find and select your app.
Tap Done.
Enable in-app purchasing
Now you need to enable in-app purchasing for the child account. While on the child settings screen, toggle on the Enable In-App Purchasing option.
If this option is disabled, you see a "feature is blocked" message when trying to purchase entitlements and consumables in the child profile, as shown in the following image.
Press the back arrow to return to the child profile list. Launch the child experience by tapping on the child profile.
Initiate a purchase from the child profile
After launching the child experience, find your test app and tap the icon to download it. After you download and open your app, you can test both entitlement and consumable purchases.
To test Pending Purchases for an entitlement or consumable, follow these steps.
Select an entitlement to purchase from your test app. A dialog like the one shown here appears.
To initiate the Pending Purchase flow, click Request Purchase. This causes the pending status to be sent to your app. You don't need to implement state management in your app or be concerned with handling duplicate requests as Amazon's IAP API handles this.
On this dialog, you can also initiate the regular in-app purchase flow by clicking Grown ups, purchase on device. In this flow, a parent enters their password on the device and the purchase is completed immediately.
After the request is created, go to the Parent Dashboard at parents.amazon.com to review the request. Make sure to sign in with the parent account for the Amazon Household. You will also receive an email for the request.
Click You have notifications.
Click Store under the child profile to open the store requests page and review the request. You can review all the consumable and entitlement requests on this page.
Click Review request to view the details of the request.
On the request detail screen, choose Buy Now to approve the request or Decline to reject it.
If you choose Buy Now, the entitlement is added to the child profile. A push notification with a message of the parent's approval is sent to Fire tablet with the child profile, as shown here.
Note: This notification is different from Real-Time Developer Notifications (RTN). RTN is supplemental to getPurchaseUpdates() for your app to get notified of the purchase receipt and deliver content to the customer.
Tap the notification to launch the app and initiate the getPurchaseUpdates() flow. The new entitlement appears in the app.
Tip: There is caching on client side. If you don't immediately see the receipt, wait up to 20 minutes and retry invoking onResume().
If you choose Decline, the entitlement is not added to the child profile. The child receives a push notification with a message that says the in-app purchase is not approved, as shown here.
There will be no update to the getPurchaseUpdates() response, and the child can request the entitlement again.
Test a pending purchase for a consumable
Select a consumable to purchase from your test app. A dialog like the one shown here appears.
To initiate the Pending Purchase flow, click Request Purchase. This causes the pending status to be sent to your app. You don't need to implement state management in your app or be concerned with handling duplicate requests as Amazon's IAP API handles this.
On this dialog, you can also initiate the regular in-app purchase flow by clicking Grown ups, purchase on device. In this flow, a parent enters their password on the device and the purchase is completed immediately.
After the request is created, go to the Parent Dashboard at parents.amazon.com to review the request. Make sure to sign in with the parent account for the Amazon Household. You will also receive an email for the request.
Click You have notifications.
Click Store under the child profile to open the store requests page and review the request. You can review all the consumable and entitlement requests on this page.
Click Review request to view the details of the request.
On the request detail screen, choose Buy Now to approve the request or Decline to reject it.
If you choose Buy Now, the consumable is added to the child profile. A push notification with a message of the parent's approval is sent to Fire tablet with the child profile, as shown here.
Note: This notification is different from Real-Time Developer Notifications (RTN). RTN is supplemental to getPurchaseUpdates() for your app to get notified of the purchase receipt and deliver content to the customer.
Tap the notification to launch the app and initiate the getPurchaseUpdates() flow. The new entitlement appears in the app.
Tip: There is caching on client side. If you don't immediately see the receipt, wait up to 20 minutes and retry invoking onResume().
If you choose Decline, the consumable is not added to the child profile. The child receives a push notification with a message that says the in-app purchase is not approved, as shown here.
There will be no update to the getPurchaseUpdates() response, and the child can request the consumable again.