IAP Overview
The In-App Purchasing (IAP) API allows your app to present, process, and fulfill purchases of digital content and subscriptions within your app. Amazon supports an IAP API for Vega apps. This page gives a high-level introduction to the IAP API and the features available in the preview release.
@amazon-devices/keplerscript-appstore-iap-lib
, IAP testing can be done on the device and Vega Virtual Device (VVD) simulator. There is a newer version of
@amazon-devices/keplerscript-appstore-iap-lib
which moves to a system bundle for memory benefits. Upgrade to avoid any IAP integration issues. Install the latest Vega SDK and upgrade @amazon-devices/keplerscript-appstore-iap-lib
to ~2.12.10.@amazon-devices/keplerscript-appstore-iap-lib
will no longer work, starting in the v0.20 release. Upgrade @amazon-devices/keplerscript-appstore-iap-lib
version to ~2.12.2 or the latest available version.There is a newer version of @amazon-devices/keplerscript-appstore-iap-lib
which moves to a system bundle for memory benefits. Upgrade to avoid any IAP integration issues. Install the latest Vega SDK and upgrade @amazon-devices/keplerscript-appstore-iap-lib
to ~2.12.10.
For more details around how to upgrade, see the following instructions.
What is In-App Purchasing (IAP)?
With In-App Purchasing (IAP), your app's users can purchase various types of digital items within your app, such as extra lives for a game or a subscription to premium content.
The following scenarios describe potential use cases for IAP:
- Create a "freemium" model for your app where the app itself is free but you charge a premium for advanced services or functionality.
- Allow your customers to purchase items to enhance their gaming experience, such as currency, extra moves, or lives.
- Unlock bonus levels or mini-games by allowing users to purchase access to this content.
- Enable customers to subscribe to content available within your app.
The IAP API handles details about purchase flow, payment processing, providing a receipt to your app, and managing rights to the purchasable content, so that you do not have to code these things yourself.
Include the necessary package dependencies in your app
In the package.json file, add the @amazon-devices/keplerscript-appstore-iap-lib and @amazon-devices/package-manager-lib packages as dependencies.
{
"dependencies": {
"@amazon-devices/keplerscript-appstore-iap-lib": "~2.12.10",
"@amazon-devices/package-manager-lib": "^1.0.0"
}
},
IAP methods for Fire OS vs Vega
API | Description | Fire OS objects (Java) | Vega objects (JS) | Is Vega different from Fire OS | What's different |
---|---|---|---|---|---|
getUserData |
Initiates a request to retrieve the user ID of the currently logged-in user. | UserDataRequest
UserDataResponse |
UserDataRequest UserDataResponse |
No | N/A |
getProductData |
Initiates a request to retrieve item data of up to one-hundred SKUs. | Send list of SKUs as part of getProductData API call. Response will be available via ProductDataResponse .
|
ProductDataRequest ProductDataResponse |
Yes | 1. Price is a string in Fire OS but in Vega, it's an object containing currencyFormattedPrice , currencyCode and priceValue in micros. This applies to promotionPrice as well.2. The promotionPlans field inside the Promotion object has been changed to plans in Vega.3. promotionPrice , promotionPriceCycles , promotionPricePeriod have been changed to price , priceCycles and period . |
purchase |
Initiates a purchase-flow for a product. | Send Single SKU as part of purchase API call. Response will be available through PurchaseResponse .
|
PurchaseRequest PurchaseResponse |
No | N/A |
getPurchaseUpdates |
Initiates a request to retrieve updates about items the customer has purchased and/or canceled. | Send reset flag as part of getPurchaseUpdates API call. Response will be available via PurchaseUpdatesResponse .
|
PurchaseUpdatesRequest PurchaseUpdatesResponse |
No | N/A |
modifySubscription |
Initiates a modifySubscription request for a subscription. |
send SKU and proration mode to modifySubscription API call. Response will be available through ModifySubscriptionResponse .
|
ModifySubscriptionRequest
ModifySubscriptionResponse |
No | N/A |
notifyFulfillment |
Notifies Amazon about the purchase fulfillment. | Send receiptId and FulfillmentResult in the request.
No response will be sent. It is a void call. |
NotifyFulfillmentRequest NotifyFulfillmentResponse |
Yes | NotifyFulfillmentResponseCode is sent |
IAP for Fire OS vs IAP for Vega
On Fire OS, the IAP SDK works with Android apps, written in Java. On Vega, the IAP API is integrated with the Vega SDK, written in JavaScript. You submit in-app items to the Amazon Appstore and can implement the API for production features, like Live App Testing.
The table below lists the current IAP components supported by Vega.
IAP Component | Description | Documentation |
---|---|---|
IAP API | API used to run and fulfill in-app purchases | IAP API Overview |
App Tester | Tool to test your apps locally | Configure the App Tester |
Receipt Verification Service (RVS) Cloud Sandbox | Verify the validity of transaction receipts in sandbox mode | RVS for IAP Apps |
Last updated: Sep 30, 2025