Skip to main content

Kotlin Multiplatform SDK Models

Models

AdaptyOnboardingScreenParameters

Parameters for logging onboarding screen events.

NameTypeDescription
onboardingNamestring (optional)Name of the onboarding flow
onboardingScreenNamestring (optional)Name of the onboarding screen
onboardingScreenOrdernumberOrder of the onboarding screen (minimum: 1)

AdaptyPaywallProduct

An information about a product.

NameTypeDescription
vendorProductIdstringUnique identifier of a product from App Store Connect or Google Play Console
adaptyProductIdstringUnique identifier of the product in Adapty
paywallVariationIdstringSame as variationId property of the parent AdaptyPaywall
paywallABTestNamestringSame as abTestName property of the parent AdaptyPaywall
paywallNamestringSame as name property of the parent AdaptyPaywall
paywallProductIndexnumberThe index of the product in the paywall
audienceNamestring (optional)Name of the audience this product belongs to
localizedDescriptionstringA description of the product
localizedTitlestringThe name of the product
isFamilyShareablebooleanBoolean value that indicates whether the product is available for family sharing in App Store Connect. iOS Only.
regionCodestring (optional)The region code of the locale used to format the price of the product. ISO 3166 ALPHA-2 (US, DE). iOS Only.
priceAdaptyPriceThe cost of the product in the local currency
subscriptionAdaptyPaywallProductSubscription (optional)Detailed information about subscription (intro, offers, etc.)
payloadDatastring (optional)Additional data associated with the product

AdaptyPrice

NameTypeDescription
amountnumberPrice as number
currencyCodestring (optional)The currency code of the locale used to format the price of the product. The ISO 4217 (USD, EUR)
currencySymbolstring (optional)The currency symbol of the locale used to format the price of the product. ($, €)
localizedStringstring (optional)A price's language is determined by the preferred language set on the device. On Android, the formatted price from Google Play as is

AdaptyPaywallProductSubscription

NameTypeDescription
groupIdentifierstring (optional)An identifier of the subscription group to which the subscription belongs. iOS Only.
periodAdaptySubscriptionPeriodThe period details for products that are subscriptions
localizedPeriodstring (optional)The period's language is determined by the preferred language set on the device
offerAdaptySubscriptionOffer (optional)A subscription offer if available for the auto-renewable subscription
renewalTypeAdaptyRenewalTypeThe renewal type. Android Only.
basePlanIdstring (optional)The identifier of the base plan. Android Only.

AdaptySubscriptionPeriod

NameTypeDescription
numberOfUnitsnumberA number of period units
unitAdaptyPeriodUnitA unit of time that a subscription period is specified in. The possible values are: day, week, month, year

AdaptySubscriptionOffer

NameTypeDescription
identifierstringUnique identifier of a discount offer for a product
phasesarray of AdaptySubscriptionPhaseA list of discount phases available for this offer

AdaptySubscriptionPhase

NameTypeDescription
localizedNumberOfPeriodsstring (optional)A formatted number of periods of a discount for a user's locale
localizedSubscriptionPeriodstring (optional)A formatted subscription period of a discount for a user's locale
numberOfPeriodsnumberA number of periods this product discount is available
priceAdaptyPriceDiscount price of a product in a local currency
subscriptionPeriodAdaptySubscriptionPeriodAn information about period for a product discount
paymentModeAdaptySubscriptionOfferPaymentModeA payment mode for this product discount. Possible values: free_trial, pay_as_you_go, pay_up_front

AdaptyPaywall

An information about a paywall.

NameTypeDescription
placementIdstringID of a placement configured in Adapty Dashboard
instanceIdentitystringUnique identifier of the paywall configuration
namestringA paywall name
audienceNamestringA name of an audience to which the paywall belongs
abTestNamestringParent A/B test name
variationIdstringAn identifier of a variation, used to attribute purchases to this paywall
revisionnumberCurrent revision (version) of a paywall. Every change within a paywall creates a new revision
hasViewConfigurationbooleanIf true, it is possible to fetch the view object and use it with AdaptyUI library
remoteConfigAdaptyPaywallRemoteConfig (optional)A remote config configured in Adapty Dashboard for this paywall
payloadDatastring (optional)Additional data associated with the paywall

AdaptyPlacement

NameTypeDescription
abTestNamestringParent A/B test name
audienceNamestringA name of an audience to which the paywall belongs
idstringID of a placement configured in Adapty Dashboard
revisionnumberCurrent revision (version) of a paywall. Every change within a paywall creates a new revision
isTrackingPurchasesboolean (optional)Whether the placement is tracking purchases
audienceVersionIdstringVersion ID of the audience

AdaptyPaywallRemoteConfig

NameTypeDescription
langstringIdentifier of a paywall locale
dataobjectA custom dictionary configured in Adapty Dashboard for this paywall
dataStringstringA custom JSON string configured in Adapty Dashboard for this paywall

AdaptyProfile

An information about a user's subscription status and purchase history.

NameTypeDescription
profileIdstringAn identifier of the user in Adapty
customerUserIdstring (optional)An identifier of the user in your system
customAttributesobjectPreviously set user custom attributes with the updateProfile method. Can contain string and number values.
accessLevelsobject<string, AdaptyProfile.AccessLevel>The keys are access level identifiers configured by you in Adapty Dashboard. The values are AccessLevel objects. Can be null if the customer has no access levels
subscriptionsobject<string, AdaptyProfile.Subscription>The keys are product ids from App Store Connect. The values are Subscription objects. Can be null if the customer has no subscriptions
nonSubscriptionsobject<string, array of AdaptyProfile.NonSubscription>The keys are product ids from App Store Connect. The values are arrays of NonSubscription objects. Can be null if the customer has no purchases

AdaptyProfile.AccessLevel

Information about the user's access level.

NameTypeDescription
idstringUnique identifier of the access level configured by you in Adapty Dashboard
isActivebooleanWhether the access level is active. Generally, you have to check just this property to determine if the user has access to premium features
vendorProductIdstringThe identifier of the product in the App Store Connect that unlocked this access level
storestringThe store of the purchase that unlocked this access level. The possible values are: app_store, play_store, adapty
activatedAtstringThe time when the access level was activated (ISO 8601 format)
renewedAtstring (optional)The time when the access level was renewed (ISO 8601 format)
expiresAtstring (optional)The time when the access level will expire (ISO 8601 format, could be in the past and could be null for lifetime access)
isLifetimebooleanWhether the access level is active for a lifetime (no expiration date). If set to true you shouldn't check expires_at, or you could just check isActive
activeIntroductoryOfferTypestring (optional)The type of active introductory offer. Possible values are: free_trial, pay_as_you_go, pay_up_front. If the value is not null, it means that the offer was applied during the current subscription period
activePromotionalOfferTypestring (optional)The type of active promotional offer. Possible values are: free_trial, pay_as_you_go, pay_up_front. If the value is not null, it means that the offer was applied during the current subscription period
activePromotionalOfferIdstring (optional)An identifier of active promotional offer
offerIdstring (optional)Offer identifier
willRenewbooleanWhether the auto-renewable subscription is set to renew
isInGracePeriodbooleanWhether the auto-renewable subscription is in the grace period
unsubscribedAtstring (optional)The time when the auto-renewable subscription was cancelled. Subscription can still be active, it just means that auto-renewal turned off. Will be set to null if the user reactivates the subscription (ISO 8601 format)
billingIssueDetectedAtstring (optional)The time when billing issue was detected. Subscription can still be active. Will be set to null if the charge will be made (ISO 8601 format)
startsAtstring (optional)The time when this access level has started (ISO 8601 format, could be in the future)
cancellationReasonstring (optional)The reason why the subscription was cancelled. Possible values are: voluntarily_cancelled, billing_error, refund, price_increase, product_was_not_available, unknown
isRefundbooleanWhether the purchase was refunded

AdaptyProfile.Subscription

Information about the user's subscription.

NameTypeDescription
storestringThe store of the purchase. The possible values are: app_store, play_store, adapty
vendorProductIdstringThe identifier of the product in the App Store Connect
vendorTransactionIdstringTransaction id from the App Store
vendorOriginalTransactionIdstringOriginal transaction id from the App Store. For auto-renewable subscription, this will be the id of the first transaction in the subscription
isActivebooleanWhether the subscription is active
isLifetimebooleanWhether the subscription is active for a lifetime (no expiration date). If set to true you shouldn't check expires_at, or you could just check isActive
activatedAtstringThe time when the subscription was activated (ISO 8601 format)
renewedAtstring (optional)The time when the subscription was renewed (ISO 8601 format)
expiresAtstring (optional)The time when the subscription will expire (ISO 8601 format, could be in the past and could be null for lifetime access)
startsAtstring (optional)The time when the subscription has started (ISO 8601 format, could be in the future)
unsubscribedAtstring (optional)The time when the auto-renewable subscription was cancelled. Subscription can still be active, it just means that auto-renewal turned off. Will be set to null if a user reactivates the subscription (ISO 8601 format)
billingIssueDetectedAtstring (optional)The time when billing issue was detected (Apple was not able to charge the card). Subscription can still be active. Will be set to null if the charge will be made (ISO 8601 format)
isInGracePeriodbooleanWhether the auto-renewable subscription is in the grace period
isSandboxbooleanWhether the product was purchased in the sandbox environment
isRefundbooleanWhether the purchase was refunded
willRenewbooleanWhether the auto-renewable subscription is set to renew
activeIntroductoryOfferTypestring (optional)The type of active introductory offer. Possible values are: free_trial, pay_as_you_go, pay_up_front. If the value is not null, it means that the offer was applied during the current subscription period
activePromotionalOfferTypestring (optional)The type of active promotional offer. Possible values are: free_trial, pay_as_you_go, pay_up_front. If the value is not null, it means that the offer was applied during the current subscription period
activePromotionalOfferIdstring (optional)An identifier of active promotional offer
offerIdstring (optional)Offer identifier
cancellationReasonstring (optional)The reason why the subscription was cancelled. Possible values are: voluntarily_cancelled, billing_error, refund, price_increase, product_was_not_available, unknown

AdaptyProfile.NonSubscription

Information about the user's non-subscription purchases.

NameTypeDescription
purchaseIdstringThe identifier of the purchase in Adapty. You can use it to ensure that you've already processed this purchase (for example tracking one time products)
storestringThe store of the purchase. The possible values are: app_store, play_store, adapty
vendorProductIdstringThe identifier of the product in the App Store Connect
vendorTransactionIdstring (optional)Transaction id from the App Store
purchasedAtstringThe time when the product was purchased (ISO 8601 format)
isSandboxbooleanWhether the product was purchased in the sandbox environment
isRefundbooleanWhether the purchase was refunded
isConsumablebooleanWhether the product should only be processed once. If true, the purchase will be returned by Adapty API one time only

AdaptyAndroidSubscriptionUpdateParameters

Parameters to change one subscription to another.

NameTypeDescription
oldSubVendorProductIdstringThe product id for current subscription to change
replacementModeAdaptyAndroidSubscriptionUpdateReplacementModeThe proration mode for subscription update

Enums

AdaptyPeriodUnit

  • day - Day period
  • week - Week period
  • month - Month period
  • year - Year period

AdaptySubscriptionOfferPaymentMode

  • free_trial - Free trial
  • pay_as_you_go - Pay as you go
  • pay_up_front - Pay up front

AdaptyRenewalType

  • prepaid - Prepaid subscription
  • autorenewable - Auto-renewable subscription

AdaptyProfile.Gender

  • f - Female
  • m - Male
  • o - Other

AdaptyAndroidSubscriptionUpdateReplacementMode

  • immediate_with_time_proration - Immediate with time proration
  • immediate_and_charge_prorated_price - Immediate and charge prorated price
  • immediate_without_proration - Immediate without proration
  • deferred - Deferred
  • immediate_and_charge_full_price - Immediate and charge full price