/** * Represents the type of product. Can be consumable, entitlement, or subscription content. */ export declare enum ProductType { /** * Can be purchased multiple times by a customer and is available only on the device from which it is purchased. */ CONSUMABLE = 1, /** * Can be purchased only one time by a customer and is available on all compatible devices registered to the * customer account. */ ENTITLED = 2, /** * It is bound by a period of time and is available on all eligible devices registered to the customer account. */ SUBSCRIPTION = 3 } /** * Contains data about Amazon Coins that may be rewarded to customers after they purchase the associated Product. */ export interface CoinsReward { /** * Provides the number of Amazon Coins that a customer may be rewarded after purchasing the associated Product. */ amount: number; } /** * Data model for Price */ export interface Price { /** * Locale formatted price string including currency symbol and value. */ priceStr: string; /** * ISO 4217 currency code */ priceCurrencyCode: string; /** * Price value in micros. 1,000,000 micros is equal to 1 unit of currency value. * Example: If the price is $2, then the valueInMicros would be 2,000,000. *
Note: If you want to convert the micros value to actual currency value, type cast the * micros value to a decimal precision datatype and then divide it by 1M. */ valueInMicros: bigint; } /** * Represents a promotion plan such as "Introductory promotion with $3.00 weekly for 3 terms", * where, the {@link Promotion} object contains a list of such promotion plans */ export interface PromotionPlan { /** * Represents the promotion period associated with the current instance of PromotionPlan. * Examples of promotion periods include weekly, monthly, annually, etc. */ period: string; /** * Represents the localized price of this promotion. */ price: Price; /** * Represents the number of cycles with the promotion period of this promotion. * Example : "3 cycles of weekly Introductory promotion" would mean * 3 iterations of this promotion for a total of 3 weeks of duration. */ priceCycles: bigint; } /** * Represents a promotion configured for a {@link Product} */ export interface Promotion { /** * Represents the type of promotion associated with the current instance. */ type: string; /** * Represents the list of promotion plans associated with the promotion type. */ plans: PromotionPlan[]; } /** * Represents an in-app product, such as consumable, entitlement, or subscription content. Retrieve * product data by using {@link PurchasingService.getProductData} API. */ export interface Product { /** * Number of Amazon Coins that a customer may be rewarded after purchasing the associated Product. */ coinsReward: CoinsReward; /** * Localized description of the product. */ description: string; /** * Price of the product. */ price: Price; /** * Type of product. */ productType: ProductType; /** * Stock-keeping unit (SKU) of the product. */ sku: string; /** * Url of the product's small icon. */ smallIconUrl: string; /** * Localized title of the product. */ title: string; /** * Returns the subscription period configured in the Amazon Developer Portal. * The subscription period, if not null, contains the * duration of the subscription associated with the product. * It will be null for non-subscriptions. */ subscriptionPeriod?: string; /** * Returns the free trial period configured in the Amazon Developer Portal. * The free trial period, if not null, contains the duration of the * free trial associated with the current product. * It may be null. */ freeTrialPeriod?: string; /** * Represents a list of promotions configured in the Amazon Developer Portal. * This List, if not empty, contains the data about all the promotions associated with the current product. * It will be empty if promotions are unavailable. */ promotions: Promotion[]; } /** * Represents the purchase of consumable, entitlement, or subscription content, as well as the renewal * of a subscription. */ export interface Receipt { /** * Cancel date for the purchase, or null if it is not canceled. */ cancelDate: Date; /** * If the customer modified/updated the subscription, he can opt for immediate change or change in the * next billing cycle. In case its the next billing cycle, we term it deferred. *
Deferred date for modified subscription, or null if it is not deferred update. */ deferredDate: Date; /** * If the customer modified/updated the subscription in the upcoming billing cycle, this field denotes the * SKU to be modified to. Would be null if its not deferred update. */ deferredSku: string; /** * Type of product. */ productType: ProductType; /** * Purchase date for the purchase. */ purchaseDate: Date; /** * Receipt ID which is a unique identifier of a purchase. */ receiptId: string; /** * SKU of the purchase. */ sku: string; /** * Term SKU of the purchase. */ termSku: string; /** * Checks cancellation or expiration of the receipt. */ isCancelled: boolean; /** * Checks if update is deferred. */ isDeferred: boolean; } /** * Supported LWA Consent status. * * @deprecated since version 2.4.0, use {@link UserProfileAccessConsentStatus} */ export declare enum LwaConsentStatus { /** * Either IAP SDK is not aware of data access consent status (or) fetchLwaConsentStatus flag was not set in the getUserData request. */ UNAVAILABLE = 1, /** * User has provided consent to access data. */ CONSENTED = 2 } /** * Supported Consent status for user profile access. */ export declare enum UserProfileAccessConsentStatus { /** * Either IAP SDK is not aware of data access consent status (or) fetchUserProfileAccessConsentStatus flag was not set in the getUserData request. */ UNAVAILABLE = 1, /** * User has provided consent to access data. */ CONSENTED = 2 } /** * Represents the user information of the customer that is used for in-app purchases. */ export interface UserData { /** * Two character Alpha-2 code of ISO_3166-1 denoting the marketplace of the user. */ marketplace: string; /** * Returns the user ID. */ userId: string; /** * The LWA data share consent status of the user. * * @deprecated since version 2.4.0, use {@link userProfileAccessConsentStatus} */ lwaConsentStatus: LwaConsentStatus; /** * The profile share consent status of the user. */ userProfileAccessConsentStatus: UserProfileAccessConsentStatus; /** * Two character Alpha-2 code of ISO_3166-1 denoting the country code of the user. */ countryCode: string; } /** * Represents the id of any in-app purchasing request. */ export interface RequestId { /** * Encoded string form of the RequestId. */ requestIdStr: string; } /** * Input parameters for purchase request. */ export interface PurchaseRequest { /** * SKU to purchase. */ sku: string; } /** * Input parameters for Modify Subscription request. */ export interface ModifySubscriptionRequest { /** * Vendor SKU for which to initiate subscription modification. */ sku: string; /** * Subscription proration mode. */ prorationMode: ProrationMode; } /** * Input parameters for purchase updates retrieval request. */ export interface PurchaseUpdatesRequest { /** * Set to true to get a list of all purchases. Set to false to get a list of all purchases made since the * last invocation. */ reset: boolean; } /** * Input parameters for the requests to get product data. */ export interface ProductDataRequest { /** * SKU for which product data has to be retrieved. */ skus: string[]; } /** * Represents the fulfillment result for an in-app purchase. */ export declare enum FulfillmentResult { /** * App successfully fulfilled the purchase. */ FULFILLED = 1, /** * Purchase can never be fulfilled by the app. */ UNAVAILABLE = 2 } /** * Input parameters for fulfillment status notification request. */ export interface NotifyFulfillmentRequest { /** * Receipt ID of the purchase. */ receiptId: string; /** * Result of the fulfillment. */ fulfillmentResult: FulfillmentResult; } /** * Input parameters for User data fetching request. */ export interface UserDataRequest { /** * Set this optional flag to fetch LwaConsentStatus * * @deprecated since version 2.4.0, use {@link fetchUserProfileAccessConsentStatus} */ fetchLwaConsentStatus?: boolean; /** * Set this optional flag to fetch UserProfileAccessConsentStatus */ fetchUserProfileAccessConsentStatus?: boolean; } /** * Represents the response code for a purchase request initiated via {@link PurchasingService.purchase}. */ export declare enum PurchaseResponseCode { /** * Indicates that the purchase was successfully completed. */ SUCCESSFUL = 0, /** * Indicates that the customer already owns the provided SKU. */ ALREADY_PURCHASED = 1, /** * Indicates that the SKU originally provided to the PurchasingService.purchase(String) method is not valid. */ INVALID_SKU = 2, /** * Indicates this call is not supported. */ NOT_SUPPORTED = 3, /** * Indicates that the purchase failed. */ FAILED = 4 } /** * Represents the result of a call to {@link PurchasingService.purchase}. */ export interface PurchaseResponse { /** * A Receipt if purchaseResponseCode is PurchaseResponseCode.SUCCESSFUL, otherwise null. */ receipt: Receipt; /** * The request ID originally returned by {@link PurchasingService.purchase}. */ requestId: RequestId; /** * Status of the purchase request. */ responseCode: PurchaseResponseCode; /** * Returns the user ID and marketplace information of the user associated with the purchase. */ userData: UserData; } /** * Represents the response code for a purchase updates request initiated via {@link PurchasingService.getPurchaseUpdates}. */ export declare enum PurchaseUpdatesResponseCode { /** * Indicates that the request was successful. */ SUCCESSFUL = 1, /** * Indicates this call is not supported. */ NOT_SUPPORTED = 2, /** * Indicates that the request failed and can be retried. */ FAILED = 3 } /** * Represents the result of a call to {@link PurchasingService.getPurchaseUpdates}. */ export interface PurchaseUpdatesResponse { /** * Receipts, or an empty list if request failed, or there are no receipts. */ receiptList: Receipt[]; /** * Returns the response code of the request. */ responseCode: PurchaseUpdatesResponseCode; /** * Returns the user ID and marketplace information of the user associated with the purchase. */ userData: UserData; /** * Returns true if more results are available. */ hasMore: boolean; } /** * Represents the response code for a product data request initiated via {@link PurchasingService.getProductData}. */ export declare enum ProductDataResponseCode { /** * Indicates that the request was successful. */ SUCCESSFUL = 1, /** * Indicates this call is not supported. */ NOT_SUPPORTED = 2, /** * Indicates unsuccessful retrieval of product data. */ FAILED = 3 } /** * Represents the result of a call to {@link PurchasingService.getProductData}. */ export interface ProductDataResponse { /** * Returns product data, keyed by SKU. */ productData: Map; /** * Returns the response code for the product data request. */ responseCode: ProductDataResponseCode; /** * Returns the set of SKUs provided in the original request to {@link PurchasingService.getProductData} * for which product data is not available. */ unavailableSkus: string[]; } /** * Represents the response code of a fulfillment notification request initiated via * {@link PurchasingService.notifyFulfillment}. */ export declare enum NotifyFulfillmentResponseCode { /** * Indicates that the request was successful. */ SUCCESSFUL = 1, /** * Indicates this call is not supported. */ NOT_SUPPORTED = 2, /** * Indicates that the request was unsuccessful. */ FAILED = 3 } /** * Represents the result of a call to {@link PurchasingService.notifyFulfillment}. */ export interface NotifyFulfillmentResponse { /** * Returns the response code for the notify fulfillment request. */ responseCode: NotifyFulfillmentResponseCode; } /** * Represents the response code for a get user data request initiated by {@link PurchasingService.getUserData}. */ export declare enum UserDataResponseCode { /** * Indicates a successful request. */ SUCCESSFUL = 1, /** * Indicates this call is not supported. */ NOT_SUPPORTED = 2, /** * Indicates an unsuccessful request. */ FAILED = 3 } /** * Represents the result of a call to {@link PurchasingService.getUserData}. */ export interface UserDataResponse { /** * Returns the user ID and marketplace information of the user associated with the purchase. */ userData: UserData; /** * Indicates the response code for the getUserData call. */ responseCode: UserDataResponseCode; } /** * Subscription proration modes. */ export declare enum ProrationMode { /** * Subscription upgrade/downgrade will be triggered immediately. Calling {@link PurchasingService.modifySubscription} * with this mode makes Amazon Appstore to charge customer for subscription immediately. */ IMMEDIATE = 0, /** * Subscription upgrade/downgrade will be triggered after current billing cycle. Calling * {@link PurchasingService.modifySubscription} with this mode makes Amazon Appstore to charge customer for * subscription after current billing cycle. */ DEFERRED = 1 } /** * Represents the response code for a modify subscription request initiated by {@link PurchasingService.modifySubscription}. */ export declare enum ModifySubscriptionResponseCode { /** * Indicates that the request was successful. */ SUCCESSFUL = 0, /** * Indicates that the request failed and can be retried. */ FAILED = 1, /** * Indicates that the SKU originally provided to the modifySubscription request is not valid. */ INVALID_SKU = 2, /** * Indicates that the SKU originally provided to the modifySubscription request does not satisfy basic * criteria to perform a modify request. */ INVALID_REQUEST = 3, /** * Indicates this call is not supported. */ NOT_SUPPORTED = 4 } /** * Represents the result of a call to {@link PurchasingService.modifySubscription}. */ export interface ModifySubscriptionResponse { /** * Request ID originally returned by {@link PurchasingService.modifySubscription}. This identifier can be used * to correlate the original request with this response. */ requestId: RequestId; /** * Response code for the modifySubscription request. */ responseCode: ModifySubscriptionResponseCode; /** * User ID and marketplace information of the user associated with the modifySubscription request. */ userData: UserData; /** * A list of {@link Receipt} if subscription request succeeded, otherwise null. */ receipts: Receipt[]; } /** * Represents the response code for a UserProfileAccess request initiated by {@link PurchasingService.requestUserProfileAccess}. */ export declare enum UserProfileAccessResponseCode { /** * Indicates a successful request. */ SUCCESSFUL = 1, /** * Indicates this call is not supported. */ NOT_SUPPORTED = 2, /** * Indicates an unsuccessful request. */ FAILED = 3, /** * Indicates that service was unavailable at the moment. Try again after some time. */ SERVICE_UNAVAILABLE = 4 } /** * Represents the result of a call to {@link PurchasingService.requestUserProfileAccess}. */ export interface UserProfileAccessResponse { /** * Auth code for user profile access. */ userProfileAccessAuthCode: string; /** * Returns the response code for UserProfileAccess request. */ responseCode: UserProfileAccessResponseCode; }