In-App Purchase (IAP) is an in-app purchase mechanism that allows users to purchase digital goods and services directly within a mobile application. The iOS and Android platforms provide built-in APIs for processing payments without transferring bank card data to the developer. According to Apple StoreKit documentation, IAP processes over 500 billion dollars in transactions annually through the App Store and Google Play.
Key Takeaways
In-App Purchase (IAP) is a technology that allows selling digital goods and services within a mobile application. Payments are processed through the App Store (on iOS) or Google Play (on Android), which charge a commission for processing the transaction. The developer receives the funds minus the store's commission.
Apple charges a commission of 30% (15% for small businesses with revenue up to $1 million). Google Play also charges 30% (15% on the first $1 million of developer revenue). Since 2024, Google has been testing the User Choice Billing program, which allows developers to use alternative payment systems.
IAP is mandatory for selling digital goods in apps according to App Store and Google Play policies. Physical goods, services (ride-hailing, food delivery), and peer-to-peer payments may use third-party payment systems.
App Store and Google Play support three main types of In-App Purchase. Each type is designed for different monetization models. The choice of product type affects purchase restoration logic, subscription management, and behavior upon app reinstallation.
Consumable purchases are items that can be bought multiple times and are consumed during use. Typical examples: in-game currency (coins, gems), extra lives, boosters, consumable power-ups. Consumables are not restored when reinstalling the app — the developer manages each user's balance on their own server.
Non-Consumable purchases are items that are bought once and remain available forever. Examples: full version of the app, premium levels, filter unlocks, ad removal. Non-consumable products can be restored via the Restore Purchases API: after reinstallation, the user can retrieve previously purchased items without paying again.
Auto-Renewable Subscription involves recurring payments for access to content or service for a specified period (week, month, year). The subscription automatically renews until the user cancels it in their account settings. Stores provide server notifications (App Store Server Notifications, Google Play Developer Notifications) about subscription status changes: renewal, expiration, refund.
Setting up In-App Purchase begins in the developer consoles: App Store Connect for iOS and Google Play Console for Android. For each product, you specify a Product ID, name, description, type, and price in US dollars with automatic conversion to regional currencies. After creation, the product undergoes store moderation.
In App Store Connect, IAP products are created in the Features → In-App Purchases section. For each product, you select a type (consumable, non-consumable, auto-renewable subscription, non-renewing subscription) and fill in localized names. For subscriptions, Subscription Groups are additionally configured — groups of interchangeable subscriptions.
In Google Play Console, managed products are configured in the Monetise → Products → In-app products section. Google uses the terms Managed Product (analogous to non-consumable) and Subscription. For consumable purchases on Android, a separate consume flag is used, which resets the product for repurchase.
Moderation of IAP products typically takes 24–48 hours in the App Store and a few hours in Google Play. Price changes are applied immediately without re-moderation. Product IDs cannot be changed after creation — only deleted and recreated.
Receipt validation is a mandatory step in processing In-App Purchase. The client application sends a receipt to your own server, the server verifies it through Apple's API (https://buy.itunes.apple.com) or Google's API (https://androidpublisher.googleapis.com), and only after successful validation does it grant the item to the user.
Without server-side validation, an attacker could spoof the store's response and get the item for free. Client-side validation is insecure because it runs in an environment controlled by the user. Server-side validation ensures the receipt is authentic and the payment was successful. For Apple, verification is done through the verifyReceipt endpoint (production or sandbox), for Google — through the Android Publisher API. Both stores return confirmation in JSON format.
Apple returns purchase data in the receipt: product_id, transaction_id, purchase_date, expiration_date (for subscriptions). Google returns similar fields through the Purchases.products.get or Purchases.subscriptions.get API. The server should store each receipt's transaction_id and reject duplicate requests with the same ID to protect against replay attacks.
Integration of In-App Purchase requires connecting platform libraries: StoreKit 2 on iOS and Billing Library 7+ on Android. The APIs allow you to request a list of products, initiate a purchase, handle the result, and restore previously purchased items.
import StoreKit
func purchaseProduct(productID: String) async throws {
guard let product = try await Product.products(for: [productID]).first else { return }
let result = try await product.purchase()
switch result {
case .success(let verification):
let transaction = try verification.payloadValue
await validateReceipt(transaction)
await transaction.finish()
default:
break
}
}
import com.android.billingclient.api.BillingClient
import com.android.billingclient.api.BillingFlowParams
val billingClient = BillingClient.newBuilder(context)
.setListener { billingResult, purchases ->
if (billingResult.responseCode == BillingClient.BillingResponseCode.OK) {
purchases?.forEach { purchase ->
validateReceipt(purchase)
}
}
}
.build()
val params = BillingFlowParams.newBuilder()
.setProductDetails(productDetails)
.build()
billingClient.launchBillingFlow(activity, params)
const response = await fetch('https://buy.itunes.apple.com/verifyReceipt', {
method: 'POST',
body: JSON.stringify({
'receipt-data': receiptBase64,
'password': 'SHARED_SECRET'
})
})
const data = await response.json()
if (data.status === 0) {
// Receipt confirmed — granting item
await grantProduct(data.receipt.product_id)
}
Monetization through In-App Purchase requires a well-thought-out pricing strategy and UX. Users are more inclined to make their first purchase if offered an attractive starter pack at a low price. Apple and Google recommend showing the product price before the purchase confirmation step.
Subscription onboarding is a critical conversion stage. Show the user the value of the subscription before requesting payment: a free trial period, plan comparison, list of benefits. According to research, a free trial period increases conversion to paying users by 25–40%.
Restore Purchases is mandatory for non-consumable products and subscriptions. The restore button should be accessible in the app settings or on the payment screen. Google and Apple may reject the app if purchase restoration is not implemented for the relevant IAP types.
Grace Period is a deferral period for subscriptions during which the user retains access after a payment failure. iOS and Android support a grace period of up to 30 days. Enabling the grace period reduces churn rate by 10–15%.
A/B Testing of IAP prices is an important monetization practice. App Store Connect supports local pricing (Price Tiers) with the ability to change prices without re-moderation. Google Play Console allows configuring up to 5 base plans with different prices for one subscription product. It is recommended to test at least two price points: current and new. Testing should be conducted over 2–4 weeks on a sample of at least 1000 users per price point.
Store Review and Rejection Management is a mandatory stage of publishing an app with IAP. Apple especially scrutinizes apps with auto-renewable subscriptions: you must provide a test account with an active subscription, show the subscription cancellation screen, and implement Restore Purchases. Google Play is less strict but requires confirmation of digital content rights. It is recommended to add a Review Note describing the IAP logic.
Frequently Asked Questions
In-App Purchase (IAP) is a mechanism for purchasing digital goods within a mobile application. The payment is processed through the App Store or Google Play, which retain a 30% commission (15% for small businesses) and transfer the remainder to the developer.
There are three types of IAP: consumable (depletable — coins, lives), non-consumable (permanent — ad removal, full version), and auto-renewable subscription (recurring — access to content for a period). Non-consumable purchases support restoration.
The primary protection method is server-side receipt validation. The client sends the receipt to your server, and the server verifies it through Apple's or Google's API. Without server-side validation, an attacker could spoof the store's response and get the item for free.
Setting up IAP includes: creating products in App Store Connect or Google Play Console, connecting StoreKit (iOS) or Billing Library (Android), implementing the purchase flow, and server-side receipt verification. Each product undergoes store moderation.
Apple charges 30% (15% for developers with revenue up to $1 million). Google Play also charges 30% (15% on the first $1 million). Since 2024, Google has been testing alternative payment systems through User Choice Billing. The developer may choose a third-party payment provider but must pay Google a service fee of 11–12%.
Summary
We will develop a mobile application turnkey
IT Sectr creates iOS and Android applications for startups and businesses since 2017. We will advise you and propose the best solution.
Read also