# iOS In-App Purchase (IAP)

## <mark style="color:green;">How to setup In App Purchase?</mark>

### Setup IAP agreements on your AppStore account.

* Login to your [AppStoreConnect](https://appstoreconnect.apple.com/) account.
* Go to [Agreements, Tax and Bankings](https://appstoreconnect.apple.com/agreements/#/) menu.

&#x20;<img src="https://3731994945-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlBy5z08zL1UoCwNqmg%2Fuploads%2F3AQTqkMm6ZJIA1vsGiTA%2Fappstore-agreement.png?alt=media&#x26;token=3e16902e-738f-4edb-9f5c-2671fabf9699" alt="" data-size="original">

* Fill-up both Free and Paid agreements. Also fill up tax forms, banking information and Legal entity information.

![](https://3731994945-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlBy5z08zL1UoCwNqmg%2Fuploads%2FYv3QwunGOxkonQq42WIc%2Fagreements-info.png?alt=media\&token=7ba38742-af27-466c-aec1-7af66b85d47c)

### 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.

Check below 👇🏻 how you can create different type of products on AppStore.

{% tabs %}
{% tab title="Consumable & Non-Consumable" %}
**1.)** Go to AppStoreConnect -> Your Application and click on In-App Purchases menu.

<figure><img src="https://3731994945-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlBy5z08zL1UoCwNqmg%2Fuploads%2F3VhFkLTKH1LLX83rVp8A%2Fappstore-iap-consumable.png?alt=media&#x26;token=5335c3ca-6ae5-4295-a1db-80ef960b37ac" alt=""><figcaption></figcaption></figure>

**2.)** Click on + icon to create a product.

**3.)** Select appropriate type from the **Create an In-App Purchase** popup.

<figure><img src="https://3731994945-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlBy5z08zL1UoCwNqmg%2Fuploads%2FrWiqLFBqYqW0tLZW8BBp%2Fcreate-iap-consumable.png?alt=media&#x26;token=c23cf107-7812-4a18-a288-5389b3618fa5" alt=""><figcaption></figcaption></figure>

**4.)** Fill-up all the necessary information of the product such as pricing. For the testing purpose only pricing is required, you can fill-up other information when you are ready to go live.

<figure><img src="https://3731994945-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlBy5z08zL1UoCwNqmg%2Fuploads%2FlNg2y0bQu6tJ22Zvn2jA%2Fiap-pricing-consumable.png?alt=media&#x26;token=7fb34b12-c9fc-4e3e-aeb0-c37ee28c3cbd" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Auto-Renewable Subscriptions" %}
**1.)** Go to AppStoreConnect -> Your Application and click on **Subscriptions** menu.

<figure><img src="https://3731994945-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlBy5z08zL1UoCwNqmg%2Fuploads%2FaR8k23cgeF8BJgk4RH5I%2Fiap-subscriptions.png?alt=media&#x26;token=eb9eac0d-3dda-4ee6-abde-c0765ff2ddcb" alt=""><figcaption></figcaption></figure>

**2.)** Click on + button to create Subscription Group under **Auto-Renewable Subscriptions**.

<figure><img src="https://3731994945-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlBy5z08zL1UoCwNqmg%2Fuploads%2F3ptyXCFPGwbt9pvFrjpb%2Fiap-create-subscription-group.png?alt=media&#x26;token=8c168f66-8c34-4cd7-98c2-0d091c7bf737" alt=""><figcaption></figcaption></figure>

**3.)** Go to your newly created subscription group.

**4.)** Click on + button near Subscription to create a new subscription product.

**5.)** Fill-up all the necessary information for that product. For the testing purpose only duration and pricing are required, you can fill-up other information when you are ready to go live.

&#x20;

<figure><img src="https://3731994945-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlBy5z08zL1UoCwNqmg%2Fuploads%2F7ESl4esCTahSM8dX9bEk%2Fiap-subscription-info.png?alt=media&#x26;token=6a9425de-ccda-414f-843b-5773bfeef3bf" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Non-Renewing Subscriptions" %}
**1.)** Go to AppStoreConnect -> Your Application and click on **Subscriptions** menu.

<figure><img src="https://3731994945-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlBy5z08zL1UoCwNqmg%2Fuploads%2Fwlz48dUlTtiPXZeWck9S%2Fappstore-iap-consumable.png?alt=media&#x26;token=34e9aabf-a55c-44bc-828d-978e4b5050e0" alt=""><figcaption></figcaption></figure>

**2.)** Click on **Manage** button under Non-Renewing Subscription section.

<figure><img src="https://3731994945-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlBy5z08zL1UoCwNqmg%2Fuploads%2FMzNTRdhaXkqNUxjYad2v%2Fiap-non-sub-manage.png?alt=media&#x26;token=aabcf633-458f-4116-86ff-5f5935c32bed" alt=""><figcaption></figcaption></figure>

**3.)** Click on **+** button to create Non-Renewing Subscription.

<figure><img src="https://3731994945-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlBy5z08zL1UoCwNqmg%2Fuploads%2FxzKzbZhvuC1lnsCTuLVk%2Fipa-create-non-sub.gif?alt=media&#x26;token=81eb2303-c955-4957-8f55-3ed472a410bc" alt=""><figcaption></figcaption></figure>

**4.)** Fill-up all the necessary information for that product. For the testing purpose only pricing is required, you can fill-up other information when you are ready to go live.

<figure><img src="https://3731994945-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlBy5z08zL1UoCwNqmg%2Fuploads%2FSeTJwLHTo0jkXsu3cBmg%2Fiap-non-renew-info.png?alt=media&#x26;token=e6e31e8d-f3ae-456c-af13-5cb7242a97c4" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

### Create Sandbox User Account to Test IAP

You will need to create Sandbox User if you want to test IAP in your app. Apple only allows Sandbox users to test IAPs. Follow below steps to create sandox account.

**1.)** Go to AppStoreConnect -> Users and Access -> Sandbox Testers

<figure><img src="https://3731994945-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlBy5z08zL1UoCwNqmg%2Fuploads%2FEoW32SnIE6BtfQE9xgyK%2Fiap-sandbox-ios.png?alt=media&#x26;token=056c343d-77f3-4226-a3b4-8a17caebe3be" alt=""><figcaption></figcaption></figure>

**2.)** Click on + button create a Sandbox account.

**3.)** Now in your iPhone, go to Settings -> App Store -> SANDBOX ACCOUNT. Login with your Sandbox account there. Logout if its shows any other account.

![](https://3731994945-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlBy5z08zL1UoCwNqmg%2Fuploads%2FVgnac96OZ8A7Xnf8JEwc%2FIMG_850CC9E3E9D9-1.jpeg?alt=media\&token=de793b35-1c45-4785-9230-b17d70f9fb18)
