Implement in-app purchases for Kotlin Multiplatform
Integrate in-app purchases on iOS and Android using Adapty’s Kotlin Multiplatform (KMP) SDK. Handle receipts, track subscription status, and remove the need to build a backend. All the power in a single integration.
Adapty.activate(AdaptyConfig.Builder("YOUR_PUBLIC_SDK_KEY").build())
// Make a purchase, Adapty handles the rest
Adapty.makePurchase(product)
.onSuccess { purchaseResult ->
if (purchaseResult is AdaptyPurchaseResult.Success)
// successful purchase
}
.onError { error ->
// handle the error
}
You don’t need to build a backend for Kotlin Multiplatform in-app purchases
Adapty’s SDK takes care of everything that usually lives on the server: receipt validation, subscription status, renewals, trials, and refunds. You just connect it once and get a working Kotlin Multiplatform in-app purchases setup.
Schedule a demoWhy choose Adapty SDK?
Track subscription status across platforms
You’ll always know if the user has an active subscription across iOS and Android.
Validate receipts on the backend
No need to build your own validation as Adapty takes care of it.
Handle all kinds of subscription states
Free trials, upgrades, promo offers, family sharing, renewals, and more.
Scale on a enterprise-grade core
We ship updates often, keep the SDK stable, and run on >99.99% SLA.
Configuring platforms
Installing Adapty SDK
await adapty.activate(
'PUBLIC_SDK_KEY',
{
customerUserId: 'YOUR_USER_ID',
}
);
'PUBLIC_SDK_KEY',
{
customerUserId: 'YOUR_USER_ID',
}
);
Processing purchasing events
Easy integration for Kotlin Multiplatform
Set up the Adapty SDK in a couple of hours and start working with in-app purchases on iOS and Android. Need help? Check out our full Kotlin Multiplatform IAP tutorial.
Use 5 SDK methods to handle Kotlin Multiplatform IAP
import com.adapty.kmp.Adapty
import com.adapty.kmp.models.AdaptyPurchaseResult
Adapty.makePurchase(product = product).onSuccess { purchaseResult ->
when (purchaseResult) {
is AdaptyPurchaseResult.Success -> {
val profile = purchaseResult.profile
if (profile.accessLevels["YOUR_ACCESS_LEVEL"]?.isActive == true) {
// Grant access to the paid features
}
}
is AdaptyPurchaseResult.UserCanceled -> {
// Handle the case where the user canceled the purchase
}
is AdaptyPurchaseResult.Pending -> {
// Handle deferred purchases (e.g., the user will pay offline with cash)
}
}
}.onError { error ->
// Handle the error
}import com.adapty.kmp.Adapty
Adapty.restorePurchases().onSuccess { profile ->
if (profile.accessLevels["YOUR_ACCESS_LEVEL"]?.isActive == true) {
// successful access restore
}
}.onError { error ->
// handle the error
}
import com.adapty.kmp.Adapty
Adapty.identify("YOUR_USER_ID") // Unique for each user
.onSuccess {
// successful identify
}
.onError { error ->
// handle the error
}
import com.adapty.kmp.Adapty
import com.adapty.kmp.models.AdaptyProfile
import com.adapty.kmp.models.AdaptyProfileParameters
val builder = AdaptyProfileParameters.Builder()
.withEmail("[email protected]")
.withPhoneNumber("+18888888888")
.withFirstName("John")
.withLastName("Appleseed")
.withGender(AdaptyProfile.Gender.FEMALE)
.withBirthday(AdaptyProfile.Date(1970, 1, 3))
Adapty.updateProfile(builder.build())
.onSuccess {
// profile updated successfully
}
.onError { error ->
// handle the error
}
import com.adapty.kmp.models.AdaptyProfileParameters
val builder = AdaptyProfileParameters.Builder()
// You can set your own custom attributes:
builder.withCustomAttribute("key1", "value1")
// To remove existing key, use .withRemovedCustomAttribute() method:
builder.withRemovedCustomAttribute("key2")
Adapty powers apps at every stage from indie to top publishers
Everything you need to grow your app — already in the Kotlin Multiplatform SDK

Increase subscription revenue without app releases
Manage, target, localize and personalize paywalls without leaving your browser.
Increase app revenueCut refund rate by 40%
Stop losing revenue on refunds – Adapty automatically shares user activity data with Apple for refund requests and reduces it.
Set up Refund Saver

Know your subscription numbers at any moment
Measure your in-app economy from trials to refunds with a ready-to-go, real-time subscription BI.
See subscription BINo-code paywall builder
Build beautiful native paywalls for iOS, Android, React Native, Flutter, FlutterFlow, KMP and Capacitor without a dev team.
Create paywalls within minutes







