Hey! These docs are for version 1.0, which is no longer officially supported. Click here for the latest version, 2.0!

iOS SDK Models

The models that are used in Adapty iOS SDK

ProductModel

Information about the product.

NameTypeDescription
vendorProductIdstrUnique identifier of the product from App Store Connect.
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.
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.
regionCodestrThe ISO 3166 ALPHA-2 region code of the user's localization (US, DE).
subscriptionPeriodA ProductSubscriptionPeriodModel object. Duration of subscription products.
subscriptionGroupIdentifierstrThe identifier of the subscription group from App Store Connect to which the subscription belongs.
introductoryOfferEligibilityboolUser's eligibility for the introductory offer. Check this property before displaying info about introductory offers, for example, free trials.
promotionalOfferEligibilityboolUser's eligibility for the promotional offer. Check this property before displaying info about promotional offers.
promotionalOfferIdstrThe identifier of the promotional offer, provided by Adapty for this specific user.
introductoryDiscountA ProductDiscountModel object, containing introductory price information for the product.
discountsAn array of ProductDiscountModel discount offers available for the product.
skProductSKProduct assigned to this product.
paywallABTestNamestrParent A/B test name.
paywallNamestrParent paywall name.
isFamilyShareableboolIndicates whether the product is available for family sharing in App Store Connect.

ProductSubscriptionPeriodModel

NameTypeDescription
unitenumThe 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
identifierstrAn identifier of the discount offer for the product.
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.
paymentModestrThe payment mode for this product discount. The possible values are: free_trial, pay_as_you_go, pay_up_front.
localizedPricestrThe formatted price of the discount for the user's localization.
localizedSubscriptionPeriodstrThe formatted subscription period of the discount for the user's localization.
localizedNumberOfPeriodsstrThe formatted number of periods 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.
revisionstrThe 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.
customPayloaddictThe custom JSON formatted data configured in Adapty Dashboard.
customPayloadStringstrThe custom JSON formatted string configured in Adapty Dashboard.
productsAn array 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.
accessLevelsdictThe 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.
subscriptionsdictThe keys are product ids from the store. The values are SubscriptionInfoModel objects. Can be null if the customer has no subscriptions.
nonSubscriptionsdictThe keys are product ids from the store. The values are array[] 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 in store that unlocked this access level.
vendorTransactionIdstrTransaction id of the purchase in store that unlocked this access level.
vendorOriginalTransactionIdstrOriginal transaction id of the purchase in store 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 expiresAt, 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 (Apple 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. Generally, you have to check just this property to determine if the user has access to premium features.
vendorProductIdstrThe identifier of the product in store that unlocked this subscription.
vendorTransactionIdstrTransaction id of the purchase in store that unlocked this subscription.
vendorOriginalTransactionIdstrOriginal transaction id of the purchase in store that unlocked this subscription. For auto-renewable subscription, this will be the id of the first transaction in the subscription.
storestrThe store of the purchase that unlocked this subscription. 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 expiresAt, 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 (Apple 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 store.
vendorTransactionIdstrTransaction id in store.
storestrThe store of the purchase. The possible values are: app_store, play_store , adapty.
purchasedAtISO 8601 datetimeThe time when the product was purchased.
isRefundboolWhether 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.