---
description: Capacitor plugin for in-app purchases and subscriptions without third-party SDKs. Native StoreKit 2 and Google Play Billing on iOS and Android.
title: Capacitor Purchases Plugin for Android & iOS - Capawesome
image: https://capawesome.io/docs/assets/images/social/plugins/purchases.png
---

[ Skip to content](#capawesome-teamcapacitor-purchases) 

[ 🎉 Introducing **Capawesome Platform** — one platform for Live Updates, Native Builds, App Store Publishing, and Insider SDKs.](https://capawesome.io) 

* [  Formbricks ](/docs/plugins/formbricks/)
* [  Geocoder ](/docs/plugins/geocoder/)
* [  Google Sign-In ](/docs/plugins/google-sign-in/)
* [  libSQL ](/docs/plugins/libsql/)
* [  Live Update ](/docs/plugins/live-update/)
* [  Managed Configurations ](/docs/plugins/managed-configurations/)
* [  Media Session ](/docs/plugins/media-session/)
* [  ML Kit ](/docs/plugins/mlkit/)
* [  NFC ](/docs/plugins/nfc/)
* [  OAuth ](/docs/plugins/oauth/)
* [  Pedometer ](/docs/plugins/pedometer/)
* [  Photo Editor ](/docs/plugins/photo-editor/)
* [  PostHog ](/docs/plugins/posthog/)
* [  Printer ](/docs/plugins/printer/)
* Purchases [  Purchases ](/docs/plugins/purchases/)
* [  iOS ](#ios)
* [  Configuration ](#configuration)
* [  Usage ](#usage)
* [  API ](#api)
* [  Enums ](#enums)
* [  Testing ](#testing)
* [  Changelog ](#changelog)
* [  Breaking Changes ](#breaking-changes)
* [  License ](#license)
* [  Third-Party Notices ](#third-party-notices)
* [  RealtimeKit ](/docs/plugins/realtimekit/)
* [  Screen Orientation ](/docs/plugins/screen-orientation/)
* [  Screenshot ](/docs/plugins/screenshot/)
* [  Secure Preferences ](/docs/plugins/secure-preferences/)
* [  Speech Recognition ](/docs/plugins/speech-recognition/)
* [  Speech Synthesis ](/docs/plugins/speech-synthesis/)
* [  Share Target ](/docs/plugins/share-target/)
* [  Square Mobile Payments ](/docs/plugins/square-mobile-payments/)
* [  SQLite ](/docs/plugins/sqlite/)
* [  Superwall ](/docs/plugins/superwall/)
* [  Torch ](/docs/plugins/torch/)
* [  Wifi ](/docs/plugins/wifi/)
* [  Zip ](/docs/plugins/zip/)
* [  Cloud ](/docs/cloud/)
* [  Live Updates ](/docs/cloud/live-updates/)
* Advanced
* Integrations
* [  Native Builds ](/docs/cloud/native-builds/)
* [  Configuration ](/docs/cloud/native-builds/configuration/)
* [  Environments ](/docs/cloud/native-builds/environments/)
* Guides
* [  Sample Projects ](/docs/cloud/native-builds/sample-projects/)
* [  Troubleshooting ](/docs/cloud/native-builds/troubleshooting/)
* [  Automations ](/docs/cloud/automations/)
* [  Assist ](/docs/cloud/assist/)
* Account
* Organizations
* [  Organization and User Management ](/docs/cloud/organizations/memberships/)
* [  Single Sign-On (SSO) ](/docs/cloud/organizations/sso/)
* [  Teams ](/docs/cloud/organizations/teams/)
* [  Two-Factor Authentication ](/docs/cloud/organizations/two-factor-authentication/)
* [  Integrations ](/docs/cloud/integrations/)
* [  License Keys ](/docs/cloud/license-keys/)
* [  Webhooks ](/docs/cloud/webhooks/)
* [  Pricing ](https://capawesome.io/pricing/)
* [  FAQ ](/docs/cloud/faq/)
* [  Support ](/docs/cloud/support/)
* [  Contributing ](/docs/contributing/)
* [  LLMs ](/docs/llms/)
* [  Insiders ](/docs/insiders/)
* [  License ](https://capawesome.io/legal/eula/)
* [  Support ](/docs/insiders/support/)
* [  FAQ ](/docs/insiders/faq/)
* [  Blog ](/blog/)
* Categories

* [  iOS ](#ios)
* [  Configuration ](#configuration)
* [  Usage ](#usage)
* [  API ](#api)
* [  Enums ](#enums)
* [  Testing ](#testing)
* [  Changelog ](#changelog)
* [  Breaking Changes ](#breaking-changes)
* [  License ](#license)
* [  Third-Party Notices ](#third-party-notices)

# @capawesome-team/capacitor-purchases[¶](#capawesome-teamcapacitor-purchases "Permanent link")

Capacitor plugin to support in-app purchases.

## Features[¶](#features "Permanent link")

We are proud to offer one of the most complete and feature-rich Capacitor plugins for in-app purchases. Here are some of the key features:

* 🖥️ **Cross-platform**: Supports Android and iOS.
* 🛍️ **Product Types**: Supports subscriptions, consumables, and non-consumable in-app products.
* 🗂️ **Product Retrieval**: Fetch multiple products in a single call for efficient loading.
* 🎁 **Intro Offer Eligibility**: Check if introductory offers are available for subscription products.
* 📅 **Billing Plans**: Supports monthly-with-12-month-commitment subscriptions on iOS (26.4+).
* 🔒 **Server Validation**: Provides verification tokens (iOS JWS, Android purchase tokens) for server-side validation.
* 🔗 **Third-Party Validation**: Includes transaction properties for third-party validation.
* 📋 **Transaction Management**: Track current, unfinished, and historical transactions.
* 🔄 **Purchase Restoration**: Easily sync and restore purchases across devices.
* 🚀 **Modern APIs**: Uses StoreKit 2 and Google Play Billing Library 8.0.
* 🚨 **Error Codes**: Provides detailed error codes for better error handling.
* 📦 **CocoaPods & SPM**: Supports CocoaPods and Swift Package Manager for iOS.
* 🔁 **Up-to-date**: Always supports the latest Capacitor version.
* ⭐️ **Support**: Priority support from the Capawesome Team.
* ✨ **Handcrafted**: Built from the ground up with care and expertise, not forked or AI-generated.

Missing a feature? Just [open an issue](https://github.com/capawesome-team/capacitor-plugins/issues) and we'll add it for you!

## Newsletter[¶](#newsletter "Permanent link")

Stay up to date with the latest news and updates about the Capawesome, Capacitor, and Ionic ecosystem by subscribing to our [Capawesome Newsletter](https://cloud.capawesome.io/newsletter/).

## Compatibility[¶](#compatibility "Permanent link")

| Plugin Version | Capacitor Version | Status         |
| -------------- | ----------------- | -------------- |
| 0.3.x          | \>=8.x.x          | Active support |

## Guides[¶](#guides "Permanent link")

* [Tips for Setting Up In-App Purchases with Capacitor](https://capawesome.io/blog/tips-for-setting-up-in-app-purchases-with-capacitor/)

## Installation[¶](#installation "Permanent link")

This plugin is only available to [Capawesome Insiders](https://capawesome.io/insiders/). First, make sure you have the Capawesome npm registry set up. You can do this by running the following commands:

`[](#%5F%5Fcodelineno-0-1)npm config set @capawesome-team:registry https://npm.registry.capawesome.io
[](#%5F%5Fcodelineno-0-2)npm config set //npm.registry.capawesome.io/:_authToken <YOUR_LICENSE_KEY>
`

**Attention**: Replace `<YOUR_LICENSE_KEY>` with the license key you received from Polar. If you don't have a license key yet, you can get one by becoming a [Capawesome Insider](https://capawesome.io/insiders/).

Next, you can use our **AI-Assisted Setup** to install the plugin. Add the [Capawesome Skills](https://github.com/capawesome-team/skills) to your AI tool using the following command:

`[](#%5F%5Fcodelineno-1-1)npx skills add capawesome-team/skills --skill capacitor-plugins
`

Then use the following prompt:

`` [](#%5F%5Fcodelineno-2-1)Use the `capacitor-plugins` skill from `capawesome-team/skills` to install the `@capawesome-team/capacitor-purchases` plugin in my project.
 ``

If you prefer **Manual Setup**, install the plugin by running the following commands and follow the platform-specific instructions below:

`[](#%5F%5Fcodelineno-3-1)npm install @capawesome-team/capacitor-purchases
[](#%5F%5Fcodelineno-3-2)npx cap sync
`

### Android[¶](#android "Permanent link")

#### Variables[¶](#variables "Permanent link")

This plugin will use the following project variables (defined in your app's `variables.gradle` file):

* `$googlePlayBillingVersion` version of `com.android.billingclient:billing` (default: `8.2.0`)

### iOS[¶](#ios "Permanent link")

#### Capabilities[¶](#capabilities "Permanent link")

Ensure `In-App Purchase` capabilities have been enabled in your application in Xcode. See [Add a capability to a target](https://help.apple.com/xcode/mac/current/#/dev88ff319e7) for more information.

## Configuration[¶](#configuration "Permanent link")

No configuration required for this plugin.

## Usage[¶](#usage "Permanent link")

`[](#%5F%5Fcodelineno-4-1)import { Purchases } from '@capawesome-team/capacitor-purchases';
[](#%5F%5Fcodelineno-4-2)
[](#%5F%5Fcodelineno-4-3)const purchaseProduct = async (productId: string) => {
[](#%5F%5Fcodelineno-4-4)  const { transaction } = await Purchases.purchaseProduct({ productId });
[](#%5F%5Fcodelineno-4-5)  // Deliver the purchased content or enable the service here
[](#%5F%5Fcodelineno-4-6)  // ...
[](#%5F%5Fcodelineno-4-7)  // Finish the transaction
[](#%5F%5Fcodelineno-4-8)  await Purchases.finishTransaction({ transactionId: transaction.id });
[](#%5F%5Fcodelineno-4-9)};
[](#%5F%5Fcodelineno-4-10)
[](#%5F%5Fcodelineno-4-11)const restorePurchases = async () => {
[](#%5F%5Fcodelineno-4-12)  await Purchases.syncTransactions();
[](#%5F%5Fcodelineno-4-13)  const { transactions } = await Purchases.getCurrentTransactions();
[](#%5F%5Fcodelineno-4-14)  for (const transaction of transactions) {
[](#%5F%5Fcodelineno-4-15)    // Deliver the purchased content or enable the service here
[](#%5F%5Fcodelineno-4-16)    // ...
[](#%5F%5Fcodelineno-4-17)  }
[](#%5F%5Fcodelineno-4-18)};
`

## API[¶](#api "Permanent link")

* [finishTransaction(...)](#finishtransaction)
* [getAllTransactions()](#getalltransactions)
* [getCurrentTransactions()](#getcurrenttransactions)
* [getProductById(...)](#getproductbyid)
* [getProductsByIds(...)](#getproductsbyids)
* [getUnfinishedTransactions()](#getunfinishedtransactions)
* [isAvailable()](#isavailable)
* [isIntroOfferAvailableForProduct(...)](#isintroofferavailableforproduct)
* [purchaseProduct(...)](#purchaseproduct)
* [syncTransactions()](#synctransactions)
* [Interfaces](#interfaces)
* [Enums](#enums)

### finishTransaction(...)[¶](#finishtransaction "Permanent link")

`[](#%5F%5Fcodelineno-5-1)finishTransaction(options: FinishTransactionOptions) => Promise<void>
`

Finish a transaction.

Indicates to the App Store that the app delivered the purchased content or enabled the service to finish the transaction.

Only available on Android and iOS (15.0+).

| Param       | Type                                                  |
| ----------- | ----------------------------------------------------- |
| **options** | [FinishTransactionOptions](#finishtransactionoptions) |

**Since:** 0.1.0

---

### getAllTransactions()[¶](#getalltransactions "Permanent link")

`[](#%5F%5Fcodelineno-6-1)getAllTransactions() => Promise<GetAllTransactionsResult>
`

Returns transaction details for all transactions made by the user within your app.

Only available on iOS (15.0+).

**Returns:** `Promise<[GetAllTransactionsResult](#getalltransactionsresult)>`

**Since:** 0.1.0

---

### getCurrentTransactions()[¶](#getcurrenttransactions "Permanent link")

`[](#%5F%5Fcodelineno-7-1)getCurrentTransactions() => Promise<GetCurrentTransactionsResult>
`

Returns transaction details for currently owned items bought within your app.

Only active subscriptions and non-consumed one-time purchases are returned.

Only available on Android and iOS (15.0+).

**Returns:** `Promise<[GetCurrentTransactionsResult](#getcurrenttransactionsresult)>`

**Since:** 0.1.0

---

### getProductById(...)[¶](#getproductbyid "Permanent link")

`[](#%5F%5Fcodelineno-8-1)getProductById(options: GetProductByIdOptions) => Promise<GetProductByIdResult>
`

Get product details by product ID.

Only available on Android and iOS (15.0+).

| Param       | Type                                            |
| ----------- | ----------------------------------------------- |
| **options** | [GetProductByIdOptions](#getproductbyidoptions) |

**Returns:** `Promise<[GetProductByIdResult](#getproductbyidresult)>`

**Since:** 0.3.1

---

### getProductsByIds(...)[¶](#getproductsbyids "Permanent link")

`[](#%5F%5Fcodelineno-9-1)getProductsByIds(options: GetProductsByIdsOptions) => Promise<GetProductsByIdsResult>
`

Get product details for multiple products by their IDs.

Only available on Android and iOS (15.0+).

| Param       | Type                                                |
| ----------- | --------------------------------------------------- |
| **options** | [GetProductsByIdsOptions](#getproductsbyidsoptions) |

**Returns:** `Promise<[GetProductsByIdsResult](#getproductsbyidsresult)>`

**Since:** 0.3.3

---

### getUnfinishedTransactions()[¶](#getunfinishedtransactions "Permanent link")

`[](#%5F%5Fcodelineno-10-1)getUnfinishedTransactions() => Promise<GetUnfinishedTransactionsResult>
`

Returns transaction details for all transactions that are not yet finished.

Check for unfinished transactions at least once every app launch to ensure that all transactions are processed correctly.

Only available on Android and iOS (15.0+).

**Returns:** `Promise<[GetUnfinishedTransactionsResult](#getunfinishedtransactionsresult)>`

**Since:** 0.1.0

---

### isAvailable()[¶](#isavailable "Permanent link")

`[](#%5F%5Fcodelineno-11-1)isAvailable() => Promise<IsAvailableResult>
`

Check if in-app purchases are supported on the device.

**Returns:** `Promise<[IsAvailableResult](#isavailableresult)>`

**Since:** 0.1.0

---

### isIntroOfferAvailableForProduct(...)[¶](#isintroofferavailableforproduct "Permanent link")

`[](#%5F%5Fcodelineno-12-1)isIntroOfferAvailableForProduct(options: IsIntroOfferAvailableForProductOptions) => Promise<IsIntroOfferAvailableForProductResult>
`

Check if an introductory offer is available for a product.

On **iOS**, this uses StoreKit 2's `isEligibleForIntroOffer` to check if the customer has already used an introductory offer for any subscription within the same subscription group.

On **Android**, this checks if the product has any introductory pricing phases available. Google Play automatically filters offers based on eligibility when querying products, so if an intro offer is present, the user can purchase it.

Only available on Android and iOS.

| Param       | Type                                                                              |
| ----------- | --------------------------------------------------------------------------------- |
| **options** | [IsIntroOfferAvailableForProductOptions](#isintroofferavailableforproductoptions) |

**Returns:** `Promise<[IsIntroOfferAvailableForProductResult](#isintroofferavailableforproductresult)>`

**Since:** 0.3.2

---

### purchaseProduct(...)[¶](#purchaseproduct "Permanent link")

`[](#%5F%5Fcodelineno-13-1)purchaseProduct(options: PurchaseProductOptions) => Promise<PurchaseProductResult>
`

Purchase a product by its ID.

Make sure to call `finishTransaction(...)` after the purchase is complete and the content has been delivered or the service has been enabled.

Only available on Android and iOS (15.0+).

| Param       | Type                                              |
| ----------- | ------------------------------------------------- |
| **options** | [PurchaseProductOptions](#purchaseproductoptions) |

**Returns:** `Promise<[PurchaseProductResult](#purchaseproductresult)>`

**Since:** 0.1.0

---

### syncTransactions()[¶](#synctransactions "Permanent link")

`[](#%5F%5Fcodelineno-14-1)syncTransactions() => Promise<void>
`

Sync transactions with the App Store.

This method is used to ensure that all transactions are up-to-date and methods like `getCurrentTransactions` return the latest transactions.

On **iOS**, calling this method will display a system dialog to the user asking them to authenticate with their App Store credentials. Call this method only in response to an explicit user action.

On **Android**, this method silently queries and refreshes purchases from Google Play without user interaction.

Only available on Android and iOS (15.0+).

**Since:** 0.1.0

---

### Interfaces[¶](#interfaces "Permanent link")

#### FinishTransactionOptions[¶](#finishtransactionoptions "Permanent link")

| Prop              | Type   | Description                          | Since |
| ----------------- | ------ | ------------------------------------ | ----- |
| **transactionId** | string | The ID of the transaction to finish. | 0.1.0 |

#### GetAllTransactionsResult[¶](#getalltransactionsresult "Permanent link")

| Prop             | Type            | Description                    | Since |
| ---------------- | --------------- | ------------------------------ | ----- |
| **transactions** | Transaction\[\] | The transactions for the user. | 0.1.0 |

#### Transaction[¶](#transaction "Permanent link")

| Prop                   | Type                                                    | Description                                                                                                                                                                                                                       | Since |
| ---------------------- | ------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
| **id**                 | string                                                  | The unique identifier for the transaction.                                                                                                                                                                                        | 0.1.0 |
| **verificationResult** | string                                                  | The JWS (JSON Web Signature) representation of the transaction verification result. Pass this to your server to validate the purchase. If the transaction could not be verified, this will not be present. Only available on iOS. | 0.1.0 |
| **token**              | string                                                  | A unique identifier that represents the user and the product ID for the in-app product they purchased. Pass this to your server to validate the purchase. Only available on Android.                                              | 0.2.1 |
| **productId**          | string                                                  | The product identifier associated with the transaction.                                                                                                                                                                           | 0.3.2 |
| **originalJson**       | string                                                  | The original JSON purchase data. Pass this to your server to validate the purchase. Only available on Android.                                                                                                                    | 0.3.2 |
| **signature**          | string                                                  | The RSA signature for purchase verification. Pass this to your server to validate the purchase. Only available on Android.                                                                                                        | 0.3.2 |
| **planType**           | [BillingPlanType](#billingplantype)                     | The billing plan type the user committed to when this transaction was made. Only available on iOS (26.4+).                                                                                                                        | 0.3.8 |
| **commitmentInfo**     | [TransactionCommitmentInfo](#transactioncommitmentinfo) | The commitment details for transactions made under a billing plan that includes a commitment (e.g. monthly with 12-month commitment). Only available on iOS (26.4+).                                                              | 0.3.8 |

#### TransactionCommitmentInfo[¶](#transactioncommitmentinfo "Permanent link")

The commitment details for a transaction.

| Prop                    | Type   | Description                                                             | Since |
| ----------------------- | ------ | ----------------------------------------------------------------------- | ----- |
| **billingPeriodNumber** | number | The 1-based number of the current billing period within the commitment. | 0.3.8 |
| **totalBillingPeriods** | number | The total number of billing periods in the commitment.                  | 0.3.8 |
| **expirationDate**      | string | The date the commitment expires, as an ISO 8601 string.                 | 0.3.8 |
| **price**               | number | The price charged for this billing period, as a decimal number.         | 0.3.8 |

#### GetCurrentTransactionsResult[¶](#getcurrenttransactionsresult "Permanent link")

| Prop             | Type            | Description                            | Since |
| ---------------- | --------------- | -------------------------------------- | ----- |
| **transactions** | Transaction\[\] | The current transactions for the user. | 0.1.0 |

#### GetProductByIdResult[¶](#getproductbyidresult "Permanent link")

| Prop        | Type                | Description          | Since |
| ----------- | ------------------- | -------------------- | ----- |
| **product** | [Product](#product) | The product details. | 0.3.1 |

#### Product[¶](#product "Permanent link")

Represents an in-app product available for purchase.

| Prop             | Type                        | Description                                                                                                                                                                                                                                    | Since |
| ---------------- | --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
| **id**           | string                      | The unique product identifier.                                                                                                                                                                                                                 | 0.3.1 |
| **displayName**  | string                      | The localized display name of the product. On Android, this uses ProductDetails.getName(). On iOS, this uses [Product.displayName](#product).                                                                                                  | 0.3.1 |
| **description**  | string                      | The localized description of the product.                                                                                                                                                                                                      | 0.3.1 |
| **displayPrice** | string                      | The localized price string, formatted for display.                                                                                                                                                                                             | 0.3.1 |
| **price**        | number                      | The price as a decimal number. On Android, this is calculated from priceAmountMicros / 1,000,000\. On iOS, this uses [Product.price](#product) as a decimal.                                                                                   | 0.3.1 |
| **currencyCode** | string                      | The ISO 4217 currency code. On Android, this uses priceCurrencyCode. On iOS, this uses priceFormatStyle.currencyCode.                                                                                                                          | 0.3.1 |
| **type**         | [ProductType](#producttype) | The type of product.                                                                                                                                                                                                                           | 0.3.1 |
| **pricingTerms** | PricingTerms\[\]            | The pricing terms available for the product, one entry per billing plan. Only present for auto-renewable subscriptions that are configured with multiple billing plans (e.g. monthly with 12-month commitment). Only available on iOS (26.4+). | 0.3.8 |

#### PricingTerms[¶](#pricingterms "Permanent link")

The pricing terms for a billing plan of an auto-renewable subscription.

| Prop               | Type                                                      | Description                                                                  | Since |
| ------------------ | --------------------------------------------------------- | ---------------------------------------------------------------------------- | ----- |
| **planType**       | [BillingPlanType](#billingplantype)                       | The plan type the pricing terms apply to.                                    | 0.3.8 |
| **price**          | number                                                    | The price billed per billing period, as a decimal number.                    | 0.3.8 |
| **displayPrice**   | string                                                    | The localized price string billed per billing period, formatted for display. | 0.3.8 |
| **period**         | [SubscriptionPeriod](#subscriptionperiod)                 | The duration of one billing period.                                          | 0.3.8 |
| **commitmentInfo** | [PricingTermsCommitmentInfo](#pricingtermscommitmentinfo) | The total commitment details that apply to this billing plan.                | 0.3.8 |

#### SubscriptionPeriod[¶](#subscriptionperiod "Permanent link")

A length of time for a subscription period.

| Prop      | Type                                              | Description                        | Since |
| --------- | ------------------------------------------------- | ---------------------------------- | ----- |
| **value** | number                                            | The number of units in the period. | 0.3.8 |
| **unit**  | [SubscriptionPeriodUnit](#subscriptionperiodunit) | The unit of time for the period.   | 0.3.8 |

#### PricingTermsCommitmentInfo[¶](#pricingtermscommitmentinfo "Permanent link")

The total commitment details of a billing plan.

| Prop             | Type                                      | Description                                                        | Since |
| ---------------- | ----------------------------------------- | ------------------------------------------------------------------ | ----- |
| **price**        | number                                    | The total committed price, as a decimal number.                    | 0.3.8 |
| **displayPrice** | string                                    | The localized total committed price string, formatted for display. | 0.3.8 |
| **period**       | [SubscriptionPeriod](#subscriptionperiod) | The total commitment duration.                                     | 0.3.8 |

#### GetProductByIdOptions[¶](#getproductbyidoptions "Permanent link")

| Prop                | Type                                | Description                                                                                                                                                                                              | Since |
| ------------------- | ----------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
| **productCategory** | [ProductCategory](#productcategory) | The category of product to fetch. If not specified, the plugin will query both categories. Only available on Android.                                                                                    | 0.3.3 |
| **productId**       | string                              | The product ID of the product to retrieve. On Android, this is the [Product](#product) ID configured in Google Play Console. On iOS, this is the [Product](#product) ID configured in App Store Connect. | 0.3.1 |

#### GetProductsByIdsResult[¶](#getproductsbyidsresult "Permanent link")

| Prop         | Type        | Description                                                                                                                                                                        | Since |
| ------------ | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
| **products** | Product\[\] | The product details for the requested products. Note: If some products are not found, they will not be included in the array. The array may contain fewer products than requested. | 0.3.3 |

#### GetProductsByIdsOptions[¶](#getproductsbyidsoptions "Permanent link")

| Prop                | Type                                | Description                                                                                                                                                                                                      | Since |
| ------------------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
| **productCategory** | [ProductCategory](#productcategory) | The category of products to fetch. If not specified, the plugin will query both categories. Only available on Android.                                                                                           | 0.3.3 |
| **productIds**      | string\[\]                          | The product IDs of the products to retrieve. On Android, these are the [Product](#product) IDs configured in Google Play Console. On iOS, these are the [Product](#product) IDs configured in App Store Connect. | 0.3.3 |

#### GetUnfinishedTransactionsResult[¶](#getunfinishedtransactionsresult "Permanent link")

| Prop             | Type            | Description                               | Since |
| ---------------- | --------------- | ----------------------------------------- | ----- |
| **transactions** | Transaction\[\] | The unfinished transactions for the user. | 0.1.0 |

#### IsAvailableResult[¶](#isavailableresult "Permanent link")

| Prop            | Type    | Description                                                     | Since |
| --------------- | ------- | --------------------------------------------------------------- | ----- |
| **isAvailable** | boolean | Indicates whether in-app purchases are available on the device. | 0.1.0 |

#### IsIntroOfferAvailableForProductResult[¶](#isintroofferavailableforproductresult "Permanent link")

| Prop                      | Type    | Description                                                 | Since |
| ------------------------- | ------- | ----------------------------------------------------------- | ----- |
| **isIntroOfferAvailable** | boolean | Whether an introductory offer is available for the product. | 0.3.2 |

#### IsIntroOfferAvailableForProductOptions[¶](#isintroofferavailableforproductoptions "Permanent link")

| Prop          | Type   | Description                                  | Since |
| ------------- | ------ | -------------------------------------------- | ----- |
| **productId** | string | The product ID of the subscription to check. | 0.3.2 |

#### PurchaseProductResult[¶](#purchaseproductresult "Permanent link")

| Prop            | Type                        | Description                                                   | Since |
| --------------- | --------------------------- | ------------------------------------------------------------- | ----- |
| **transaction** | [Transaction](#transaction) | The transaction that was created as a result of the purchase. | 0.1.0 |

#### PurchaseProductOptions[¶](#purchaseproductoptions "Permanent link")

| Prop           | Type                                | Description                                                                                                                                                                                                      | Since |
| -------------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
| **basePlanId** | string                              | The base plan ID of the subscription to purchase. Only available on Android.                                                                                                                                     | 0.3.5 |
| **offerId**    | string                              | The offer ID of the subscription offer to purchase. Only available on Android.                                                                                                                                   | 0.3.5 |
| **planType**   | [BillingPlanType](#billingplantype) | The billing plan type to purchase for a monthly-with-12-month-commitment auto-renewable subscription. Only available on iOS (26.4+).                                                                             | 0.3.8 |
| **productId**  | string                              | The product ID of the product to purchase. On **Android**, this is the [Product](#product) ID configured in Google Play Console. On **iOS**, this is the [Product](#product) ID configured in App Store Connect. | 0.1.0 |

### Enums[¶](#enums "Permanent link")

#### BillingPlanType[¶](#billingplantype "Permanent link")

| Members     | Value       | Description                                                                     | Since |
| ----------- | ----------- | ------------------------------------------------------------------------------- | ----- |
| **Monthly** | 'MONTHLY'   | The subscription is billed once per renewal period.                             | 0.3.8 |
| **UpFront** | 'UP\_FRONT' | The subscription is paid in full upfront at the start of the commitment period. | 0.3.8 |

#### ProductType[¶](#producttype "Permanent link")

| Members                       | Value                           | Description                                                                                                                                                          | Since |
| ----------------------------- | ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
| **Consumable**                | 'CONSUMABLE'                    | A consumable in-app product. On Android, this is [ProductType](#producttype).INAPP. On iOS, this is [Product](#product).[ProductType](#producttype).consumable.      | 0.3.1 |
| **NonConsumable**             | 'NON\_CONSUMABLE'               | A non-consumable in-app product. On iOS, this is [Product](#product).[ProductType](#producttype).nonConsumable. Only available on iOS.                               | 0.3.1 |
| **AutoRenewableSubscription** | 'AUTO\_RENEWABLE\_SUBSCRIPTION' | An auto-renewable subscription. On Android, this is [ProductType](#producttype).SUBS. On iOS, this is [Product](#product).[ProductType](#producttype).autoRenewable. | 0.3.1 |
| **NonRenewableSubscription**  | 'NON\_RENEWABLE\_SUBSCRIPTION'  | A non-renewing subscription. On iOS, this is [Product](#product).[ProductType](#producttype).nonRenewable. Only available on iOS.                                    | 0.3.1 |

#### SubscriptionPeriodUnit[¶](#subscriptionperiodunit "Permanent link")

| Members     | Value     | Description                                                | Since |
| ----------- | --------- | ---------------------------------------------------------- | ----- |
| **Day**     | 'DAY'     | 0.3.8                                                      |       |
| **Week**    | 'WEEK'    | 0.3.8                                                      |       |
| **Month**   | 'MONTH'   | 0.3.8                                                      |       |
| **Year**    | 'YEAR'    | 0.3.8                                                      |       |
| **Unknown** | 'UNKNOWN' | The unit of time is not recognized by this plugin version. | 0.3.8 |

#### ProductCategory[¶](#productcategory "Permanent link")

| Members          | Value          | Description                                                                                                                             | Since |
| ---------------- | -------------- | --------------------------------------------------------------------------------------------------------------------------------------- | ----- |
| **InApp**        | 'IN\_APP'      | In-app products (consumables and non-consumables). On Android, this maps to BillingClient.<a href="#producttype">ProductType</a>.INAPP. | 0.3.3 |
| **Subscription** | 'SUBSCRIPTION' | Subscription products. On Android, this maps to BillingClient.<a href="#producttype">ProductType</a>.SUBS.                              | 0.3.3 |

## Testing[¶](#testing "Permanent link")

### Android[¶](#android%5F1 "Permanent link")

To test in-app purchases on Android, you need to:

1. Upload your app to the Google Play Console (internal testing track is sufficient)
2. Add test accounts in Google Play Console under **Settings** → **License Testing**
3. Install the app from Google Play (not via direct APK installation)
4. Use test product IDs or enable license testing for your account

See [Test Google Play Billing](https://developer.android.com/google/play/billing/test) for more details.

### iOS[¶](#ios%5F1 "Permanent link")

To test in-app purchases on iOS, you can use:

1. **Sandbox Testing**: Create sandbox test accounts in App Store Connect and test on physical devices or simulators
2. **StoreKit Testing in Xcode**: Configure a StoreKit configuration file for local testing without server connectivity (requires iOS 14+)

Sandbox accounts can be created in App Store Connect under **Users and Access** → **Sandbox**.

See [Testing In-App Purchases](https://developer.apple.com/documentation/storekit/in-app%5Fpurchase/testing%5Fin-app%5Fpurchases) for more details.

## Changelog[¶](#changelog "Permanent link")

See [CHANGELOG.md](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/purchases/CHANGELOG.md).

## Breaking Changes[¶](#breaking-changes "Permanent link")

See [BREAKING.md](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/purchases/BREAKING.md).

## License[¶](#license "Permanent link")

See [LICENSE](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/purchases/LICENSE).

## Third-Party Notices[¶](#third-party-notices "Permanent link")

This plugin depends on the **Google Play Billing Library**(`com.android.billingclient:billing`), governed by the [Android Software Development Kit License Agreement](https://developer.android.com/studio/terms). The library is not bundled in this plugin; it is fetched at build time from Google's Maven repository by your application's build system. By building an Android application that uses this plugin, you accept the Android SDK License Agreement and the [Google Play Developer Program Policies](https://play.google.com/about/developer-content-policy/), and you are responsible for ensuring your app complies with both. This plugin is intended for use in applications distributed via the Google Play Store on compatible Android devices. "Google Play", "Google Play Billing", and "Google Play Store" are used as descriptive identifiers only — no affiliation with or endorsement by Google is claimed or implied.

May 17, 2026 

 Back to top 