Constructors
new PurchasingService()
new PurchasingService():PurchasingService
Returns
PurchasingService
Methods
getProductData()
static getProductData(productDataRequest): Promise<ProductDataResponse>
Initiates a request to retrieve item data of up to one-hundred SKUs.
Usage Pattern:
- getProductData is typically called during product page launch for getting and displaying IAP product info (like Price) for a set of SKUs.
- Beyond this product page use case, your app may have specific use cases related to IAP Products. For these tailored scenarios, utilize this getProductData API.
Parameters
productDataRequest
ProductDataRequest
Input parameters.
Returns
Promise<ProductDataResponse>
- Response containing the product data and status of the request.
getPurchaseUpdates()
static getPurchaseUpdates(purchaseUpdatesRequest): Promise<PurchaseUpdatesResponse>
Initiates a request to retrieve updates about items the customer has purchased and/or canceled.
Usage Pattern:
- To ensure getting latest purchase updates, Amazon recommends invoking getPurchaseUpdates API in your app’s main screen launch and when App transitions from background to foreground (BG -> FG).
- Beyond this main screen use case, your app may have specific use cases related to purchases. For these tailored scenarios, utilize this getPurchaseUpdates API.
Parameters
purchaseUpdatesRequest
PurchaseUpdatesRequest
Input parameters.
Returns
Promise<PurchaseUpdatesResponse>
- Response containing the receipts data and status of the request.
getUserData()
static getUserData(userDataRequest): Promise<UserDataResponse>
Initiates a request to retrieve the user ID of the currently logged-in user.
Usage Pattern:
- To ensure retrieving the receipts for the current user account, Amazon recommends invoking getUserData API in your app’s main screen launch and when App transitions from background to foreground (BG -> FG).
- Beyond this main screen use case, your app may have specific use cases related to user-id. For these tailored scenarios, utilize this getUserData API.
Parameters
userDataRequest
UserDataRequest
Input parameters.
Returns
Promise<UserDataResponse>
- Response containing the user data and response code.
modifySubscription()
static modifySubscription(modifySubsRequest): Promise<ModifySubscriptionResponse>
Initiates a modifySubscription request for a subscription.
Parameters
modifySubsRequest
ModifySubscriptionRequest
Input parameters for Modify subscription.
Returns
Promise<ModifySubscriptionResponse>
- Response containing the list of receipts data(if succeeded) and status of the request.
notifyFulfillment()
static notifyFulfillment(notifyFulfillmentRequest): Promise<NotifyFulfillmentResponse>
Notifies Amazon about the purchase fulfillment.
Parameters
notifyFulfillmentRequest
NotifyFulfillmentRequest
Input parameters.
Returns
Promise<NotifyFulfillmentResponse>
- Response containing the status of notify fulfillment request.
purchase()
static purchase(purchaseRequest): Promise<PurchaseResponse>
Initiates a purchase-flow for a product.
Parameters
purchaseRequest
PurchaseRequest
Input parameters for purchase.
Returns
Promise<PurchaseResponse>
- Response containing the receipts data and status of the request.
requestUserProfileAccess()
static requestUserProfileAccess(): Promise<UserProfileAccessResponse>
Initiates the request to retrieve an auth code for user profile access
Returns
Promise<UserProfileAccessResponse>
- Response containing the auth code for user profile access and response code.

