Skip to main content

Flutter SDK Models

Interfaces

AdaptyOnboarding

Information about an onboarding.

NameTypeDescription
idstringAn identifier of an onboarding, configured in Adapty Dashboard
placementAdaptyPlacementA placement, configured in Adapty Dashboard
hasViewConfigurationbooleanIf true, it is possible to fetch the view object and use it with AdaptyUI library
namestringName of the onboarding flow
remoteConfigAdaptyRemoteConfig (optional)A remote config configured in Adapty Dashboard for this onboarding
variationIdstringAn identifier of a variation, used to attribute purchases to this onboarding

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
localizedDescriptionstringA description of the product
localizedTitlestringThe name of the product
priceAdaptyPrice (optional)The cost of the product in the local currency
subscriptionAdaptyProductSubscription (optional)Detailed information about subscription (intro, offers, etc.)
iosobject (optional)iOS-specific properties
ios.isFamilyShareablebooleanBoolean value that indicates whether the product is available for family sharing in App Store Connect. Will be false for iOS version below 14.0 and macOS version below 11.0. iOS Only.
ios.regionCodestring (optional)The region code of the locale used to format the price of the product. ISO 3166 ALPHA-2 (US, DE). iOS Only.

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

AdaptyProductSubscription

NameTypeDescription
subscriptionPeriodAdaptyProductSubscriptionPeriodThe period details for products that are subscriptions. Will be null for iOS version below 11.2 and macOS version below 10.14.4.
localizedSubscriptionPeriodstring (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
iosobject (optional)iOS-specific properties
ios.groupIdentifierstring (optional)An identifier of the subscription group to which the subscription belongs. Will be null for iOS version below 12.0 and macOS version below 10.14. iOS Only.
androidobject (optional)Android-specific properties
android.basePlanIdstringThe identifier of the base plan. Android Only.
android.renewalTypestring (optional)The renewal type. Possible values: 'prepaid', 'autorenewable'. Android Only.

AdaptyProductSubscriptionPeriod

NameTypeDescription
numberOfUnitsnumberA number of period units
unitProductPeriodA 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
subscriptionPeriodAdaptyProductSubscriptionPeriodAn information about period for a product discount
paymentModeOfferTypeA payment mode for this product discount. Possible values: free_trial, pay_as_you_go, pay_up_front

AdaptyPaywall

An information about a paywall.

NameTypeDescription
placementAdaptyPlacementA placement, configured in Adapty Dashboard
hasViewConfigurationbooleanIf true, it is possible to fetch the view object and use it with AdaptyUI library
namestringA paywall name
remoteConfigAdaptyRemoteConfig (optional)A remote config configured in Adapty Dashboard for this paywall
variationIdstringAn identifier of a variation, used to attribute purchases to this paywall
instanceIdentitystringUnique identifier of the paywall configuration

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

AdaptyRemoteConfig

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
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
activatedAtDateTimeThe time when the access level was activated
renewedAtDateTime (optional)The time when the access level was renewed
expiresAtDateTime (optional)The time when the access level will expire (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
unsubscribedAtDateTime (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
billingIssueDetectedAtDateTime (optional)The time when billing issue was detected. Subscription can still be active. Will be set to null if the charge will be made
startsAtDateTime (optional)The time when this access level has started (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
activatedAtDateTimeThe time when the subscription was activated
renewedAtDateTime (optional)The time when the subscription was renewed
expiresAtDateTime (optional)The time when the subscription will expire (could be in the past and could be null for lifetime access)
startsAtDateTime (optional)The time when the subscription has started (could be in the future)
unsubscribedAtDateTime (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
billingIssueDetectedAtDateTime (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
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
purchasedAtDateTimeThe time when the product was purchased
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

ProductPeriod

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

OfferType

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

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