Android SDK Models

The models that are used in Adapty Android SDK

ProductModel

Information about the product.

NameTypeDescription
vendorProductIdstrUnique identifier of the product from Google Play.
localizedTitlestrThe title of the product for the user's localization.
localizedDescriptionstrThe description of the product for the user's localization.
localizedPricestrThe formatted price of the product for the user's localization.
localizedSubscriptionPeriodstrThe formatted subscription period of the product for the user's localization.
localizedFreeTrialPeriodstrThe formatted free trial period of the product for the user's localization.
pricedecimalThe price of the product in the user's local currency.
currencyCodestrThe ISO 4217 currency code for the user's localization (USD, EUR).
currencySymbolstrThe currency symbol for the user's localization.
subscriptionPeriodA ProductSubscriptionPeriodModel object. Duration of subscription products.
introductoryOfferEligibilityboolUser's eligibility for the introductory offer. Check this property before displaying info about introductory offers, for example, free trials.
freeTrialPeriodA ProductSubscriptionPeriodModel object. The duration of the trial period.
introductoryDiscountA ProductDiscountModel object, containing introductory price information for the product.
skuDetailsSkuDetails assigned to this product.
paywallABTestNamestrParent A/B test name
paywallNamestrParent paywall name

ProductSubscriptionPeriodModel

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

ProductDiscountModel

NameTypeDescription
pricedecimalThe discount price of the product in the user's local currency.
numberOfPeriodsintAn integer that indicates the number of periods the product discount is available.
localizedPricestrThe formatted price of the discount for the user's localization.
localizedSubscriptionPeriodstrThe formatted subscription period of the discount for the user's localization.
subscriptionPeriodA ProductSubscriptionPeriodModel object that defines the period for the product discount.

PaywallModel

Information about the paywall including products.

NameTypeDescription
developerIdstrThe identifier of the paywall, configured in Adapty Dashboard.
variationIdstr (uuid)The identifier of the variation, used to attribute purchases to the paywall.
revisionintThe current revision (version) of the paywall. Every change within the paywall creates a new revision.
isPromoboolWhether this paywall is a part of the Promo Campaign.
customPayloadmapThe custom JSON formatted data configured in Adapty Dashboard.
customPayloadStringstrThe custom JSON formatted string configured in Adapty Dashboard.
productsA list of ProductModel objects related to this paywall.
abTestNamestrParent A/B test name
namestrPaywall name

PromoModel

Information about the promo offer for the user.

NameTypeDescription
promoTypestrThe type of the promo offer.
variationIdstr (uuid)The identifier of the variation, used to attribute purchases to the promo.
expiresAtISO 8601 datetimeThe time when the current promo offer will expire.
paywallA PaywallModel object.

PurchaserInfoModel

Information about the user's subscription status and purchase history.

NameTypeDescription
customerUserIdstrAn identifier of the user in your system
accessLevelsmapThe keys are access level identifiers configured by you in Adapty Dashboard. The values are AccessLevelInfoModel objects. Can be null if the customer has no access levels.
subscriptionsmapThe keys are product ids from the store. The values are SubscriptionInfoModel objects. Can be null if the customer has no subscriptions.
nonSubscriptionsmapThe keys are product ids from the store. The values are list[] of NonSubscriptionInfoModel objects. Can be null if the customer has no purchases.

AccessLevelInfoModel

Information about the user's access level.

NameTypeDescription
idstrUnique identifier of the access level configured by you in Adapty Dashboard.
isActiveboolWhether the access level is active. Generally, you have to check just this property to determine if the user has access to premium features.
vendorProductIdstrThe identifier of the product that unlocked this access level.
vendorTransactionIdstrTransaction id of the purchase that unlocked this access level.
vendorOriginalTransactionIdstrOriginal transaction id of the purchase that unlocked this access level. For auto-renewable subscription, this will be the id of the first transaction in the subscription.
storestrThe store of the purchase that unlocked this access level. The possible values are: app_store, play_store , adapty.
activatedAtISO 8601 datetimeThe time when the access level was activated.
startsAtISO 8601 datetimeThe time when the access level has started (could be in the future).
renewedAtISO 8601 datetimeThe time when the access level was renewed.
expiresAtISO 8601 datetimeThe time when the access level will expire (could be in the past and could be null for lifetime access).
isLifetimeboolWhether 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.
willRenewboolWhether the auto-renewable subscription is set to renew.
isInGracePeriodboolWhether the auto-renewable subscription is in the grace period.
unsubscribedAtISO 8601 datetimeThe 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.
billingIssueDetectedAtISO 8601 datetimeThe time when billing issue was detected (Google was not able to charge the card). Subscription can still be active. Will be set to null if the charge will be made.
cancellationReasonstrThe reason why the subscription was cancelled. Possible values are: voluntarily_cancelled, billing_error, refund, price_increase, product_was_not_available, unknown.
isRefundboolWhether the purchase was refunded.
activeIntroductoryOfferTypestrThe 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.
activePromotionalOfferTypestrThe 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.

SubscriptionInfoModel

Information about the user's subscription.

NameTypeDescription
isActiveboolWhether the subscription is active.
vendorProductIdstrThe identifier of the product in the store.
vendorTransactionIdstrTransaction id from the store.
vendorOriginalTransactionIdstrOriginal transaction id from the store. For an auto-renewable subscription, this will be the id of the first transaction in the subscription.
storestrThe store of the purchase. The possible values are: app_store, play_store , adapty.
activatedAtISO 8601 datetimeThe time when the subscription was activated.
startsAtISO 8601 datetimeThe time when the subscription has started (could be in the future).
renewedAtISO 8601 datetimeThe time when the subscription was renewed.
expiresAtISO 8601 datetimeThe time when the subscription will expire (could be in the past and could be null for lifetime access).
isLifetimeboolWhether 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.
willRenewboolWhether the auto-renewable subscription is set to renew.
isInGracePeriodboolWhether the auto-renewable subscription is in the grace period.
unsubscribedAtISO 8601 datetimeThe 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.
billingIssueDetectedAtISO 8601 datetimeThe time when billing issue was detected (Google was not able to charge the card). Subscription can still be active. Will be set to null if the charge will be made.
cancellationReasonstrThe reason why the subscription was cancelled. Possible values are: voluntarily_cancelled, billing_error, refund, price_increase, product_was_not_available, unknown.
isRefundboolWhether the purchase was refunded.
activeIntroductoryOfferTypestrThe 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.
activePromotionalOfferTypestrThe 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.
isSandboxboolWhether the product was purchased in the sandbox environment.

NonSubscriptionInfoModel

Information about the user's non-subscription purchases.

NameTypeDescription
purchaseIdstrThe 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).
vendorProductIdstrThe identifier of the product in the store.
vendorTransactionIdstrTransaction id from the store.
storestrThe store of the purchase. The possible values are: app_store, play_store , adapty.
purchasedAtISO 8601 datetimeThe time when the product was purchased.
is_refundboolWhether the purchase was refunded.
isOneTimeboolWhether the product should only be processed once. If true, the purchase will be returned by Adapty API one time only.
isSandboxboolWhether the product was purchased in the sandbox environment.

SubscriptionUpdateParamModel

Parameters to change one subscription to another.

NameTypeDescription
oldSubVendorProductIdstrThe identifier of current subscription in Play Market that needs to be replaced.
prorationModeenumEnum that corresponds to BillingFlowParams.ProrationMode values.

Did this page help you?