In App Purchase allows you to embed a store directly within your application. You can implement In App Purchase in your iOS application using the Store Kit framework.
Apple allows three types of purchases within the app and Apple terms them as consumables, non-consumables and subscriptions.
Consumables: Products that are “consumed” immediately. This means, if the purchase is made today, and the user wants to purchase it again tomorrow, he will be charged again when he attempts a purchase.
Non-Consumables: Products that are purchased exactly once. Apple automatically takes care of “remembering” those purchases and allows the user to purchase them again for free, just like downloading apps you already purchased.
Subscriptions: Products behave like non-consumables during the subscribed period and like consumables after that. You as a developer have to ensure that anything that is subscribed by the user is available across all of his iTunes synced devices when they are purchased from one device. Hence, do not lock in-app purchases to UDIDs. This might even get your app rejected. The StoreKit, as on date, doesn’t have any built-in mechanism to do it automatically which is why subscriptions are a bit tougher to develop.
To start with, in-app purchases, you need to configure your iTunes Connect account as following three steps
1. First is to create an App ID and enable in-app purchases for that. This App ID shouldn’t have any wild card characters or else, the in-app purchases option will be grayed. It would always recommend to use a different App ID for every application you create.
2. Create provisioning profiles (Development and Distribution) using this App ID.
3. You need to create product references in your iTunes account. Each individual in-app purchase should be uniquely identifiable. Apple recommends using the “reverse DNS notation” for example, com.yourcompany.yourproduct.feature Before creating product ids, you need to associate it with a existing application in AppStore. If your app is not yet live, you can create a dummy, placeholder application, fill in the metadata and check “upload binary later”.
To create a new in-app purchase, open your iTunes connect and choose “Manage In-App purchases”.
4. The fourth and final step is to create test user accounts. After you program the app, you might want to test the app. You can use these accounts to login to the App Store. The purchases will be processed as if it were real but no financial transactions will take place.