# Android In-App Purchase (IAP)

> Android In-App Purchase (IAP) is a feature provided by Android that allows app owners to sell digital content within their apps. This can include things like subscriptions, premium features.

## How to setup In App Purchase?

### Create In-App Purchase Products

There are 4 types of in-app purchases.

* **Consumable:** These are items that can be used up or expire over time and can be bought multiple times (e.g. in-game currency, items, or other virtual goods).
* **Non-Consumable:** These are permanent items that can only be purchased once (e.g. unlocking a full version of an app or purchasing a permanent game character).
* **Auto-renewable subscriptions:** This type of in-app purchase allows a user to subscribe to a service or content within an app on a recurring basis.
* **Non-renewable subscriptions:** This type of in-app purchase allows a user to subscribe to a service or content within an app for a specific duration of time.

#### Consumable & Non-Consumable
Android doesn't differentiate between consumable & non-consumable products. You need to manage from your side if user can purchase one product single time or multiple times.

**1.)** Go to Google Play Developer Console -> Select Your App -> Monetize -> In-app product.

![](https://help.twinr.dev/assets/iap-gp-consumable.png)

**2.)** Click on **Create Product** button to create a product. Enter all the info and create a product.

**3.)** Once you create it, Activate button will gets displayed with all the information you filled-up. Click on **Activate** to activate the product. This is required to test IAP.

![](https://help.twinr.dev/assets/iap-ps-activate.png)

#### Subscriptions
Google provides very easy way to create Auto-Renewable and Non-Renewable subscriptions. Follow below steps.

**1.)** Go to Google Play Developer Console -> Select Your App -> Monetize -> Subscriptions

![](https://help.twinr.dev/assets/iap-ps-sub.png)

**2.)** Click on **Create Subscription** button to create a product. Enter all the info and create a product.

![](https://help.twinr.dev/assets/iap-ps-create-sub.png)

**3.)** Once you create it, it will ask you to complete below tasks.

![](<../../.gitbook/assets/Screenshot 2023-01-25 at 10.20.43 PM.png>)

* **Add subscription benefits:** In this section you will need to enter all the subscription benefits, description and other info.
* **Add a base plan:** First of all select your plan type.&#x20;
  * **Auto-renewing:**  Select this option if you want to create auto-renewable subscription.
  * **Pre-paid:** Select this option if you want to create non-renewable subscriptions
* **Add offers:** Use this option if you want to enable offer for your subscription such as free trial. This steps is optional.
* **Activate:** At last you need to activate your subscription to make it available for testing and prod users when you go live.

### Create Licence User Accounts to Test IAP

**1.)** Go to PlayStore Console -> Setup -> Licence Testing

![](https://help.twinr.dev/assets/iap-ps-sandbox.png)

**2.)** Enter comma separated email addresses under **Add licence testers** field and hit Enter.

**3.)** Select **RESPOND\_NORMALLY** under **Licence response** dropdown.

**4.)** Now, you need to prepare an APK and upload it under internal tester. To do that, go to PlayStore Console -> Select Your App -> Testing -> Internal testing.

![](https://help.twinr.dev/assets/iap-ps-internal-testing.png)

**5.)** Click **Create a new release** button and upload your APK in there. Publish that release for review.

**6.)** Next step is to join the testers program. To do so, click on Testers tab and then copy **Join on the web** URL. Open this URL in your browser and join the testers program.

![](https://help.twinr.dev/assets/iap-ps-testers.png)

**7.)** Now, you are ready to test IAP in your application. Install APK file in your mobile and test everything.

Source: https://help.twinr.dev/monetisation/in-app-purchase-iap/android-in-app-purchase-iap
