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

API Reference

Interfaces used in Adapty

Interfaces

AdaptyProduct

An information about a product

NameTypeDescription
vendorProductIdstringUnique identifier of a product from App Store Connect or Google Play Console
localizedTitlestringTitle of a product for a user's locale
localizedDescriptionstringDescription of a product for a user's locale
localizedPricestringFormatted price of a product for a user's locale
localizedSubscriptionPeriodstring | undefinedFor iOS: Formatted subscription period of a product for a user's locale. No value for Android devices
pricenumberPrice of a product in a user's local currency
currencyCodestringThe ISO 4217 currency code for a user's locale (USD, EUR)
currencySymbolstringCurrency symbol for a user's locale ($, €)
regionCodestring | undefinedFor iOS: The ISO 3166 ALPHA-2 region code of the user's localization (US, DE). No value for Android devices
subscriptionPeriodAdaptyProductSubscriptionPeriod | undefinedDuration of subscription products
freeTrialPeriodAdaptyProductSubscriptionPeriod For Android: Duration of a trial period. No value for iOS
subscriptionGroupIdentifierstring | undefinedFor iOS: An identifier of a subscription group from App Store Connect to which the subscription belongs. No value for Android devices
introductoryOfferEligibilitybooleanUser's eligibility for your introductory offer. Check this property before displaying info about introductory offers (i.e. free trials)
promotionalOfferEligibilitybooleanUser's eligibility for the promotional offers. Check this property before displaying info about promotional offers
promotionalOfferIdstring | undefinedFor iOS: An identifier of a promotional offer, provided by Adapty for this specific user. No value for Android devices
introductoryDiscountAdaptyProductDiscountAn information about introductory price and duration for a product
discountsAdaptyProductDiscount[] | undefinedFor iOS: An array of discount offers available for a product. No values for Android devices
paywallABTestNamestring | undefinedParent A/B test name
paywallNamestring | undefinedParent paywall name
isFamilyShareableboolean | undefinedFor iOS 14+: Indicates whether a product is available for a family sharing in App Store Connect. No value for Android devices

AdaptyProductSubscriptionPeriod

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

AdaptyProductDiscount

NameTypeDescription
identifierstring | undefinedUnique identifier of a discount offer for a product
pricenumberDiscount price of a product in a local currency
numberOfPeriodsnumberA number of periods this product discount is available
paymentMode'free_trial' | 'pay_as_you_go' | 'pay_up_front' | undefinedFor iOS: A payment mode for this product discount. No value for Android devices
localizedPricestringA formatted price of a discount for a user's locale
localizedSubscriptionPeriodstring | undefinedFor iOS: A formatted subscription period of a discount for a user's locale. No value for Android devices
localizedNumberOfPeriodsstring | undefinedFor iOS: A formatted number of periods of a discount for a user's locale
subscriptionPeriodAdaptyProductSubscriptionPeriod An information about period for a product discount

AdaptyPaywall

An information about a paywall including products.

NameTypeDescription
developerIdstringAn identifier of a paywall, configured in Adapty Dashboard
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
isPromobooleanTrue if this paywall is a part of a promo campaign
customPayloadstringA custom JSON string configured in Adapty Dashboard for this paywall
productsAdaptyProduct[]Array of related products
abTestNamestring | undefinedParent A/B test name
namestringPaywall name

AdaptyPromo

Information about a promo offer for a user.

NameTypeDescription
promoTypestringA type of a promo offer
variationIdstringAn identifier of a variation, used to attribute purchases to this promo
expiresAtstringISO 8601 datetime formatted string, when this promo offer expires
paywallAdaptyPaywallRelated paywall

AdaptyPurchaserInfo

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

NameTypeDescription
customerUserIdstringAn identifier of a user in your system
accessLevelsRecord<string, AdaptyPaidAccessLevelsInfo > | nullThe keys are access level identifiers configured by you in Adapty Dashboard. The values are Can be null if the customer has no access levels
subscriptionsRecord<string, AdaptySubscriptionInfo> | nullThe keys are product ids from a store. The values are information about subscriptions. Can be null if the customer has no subscriptions
nonSubscriptionsRecord<string, AdaptyNonSubscriptionsInfo> | nullThe keys are product ids from the store. The values are arrays of information about consumables. Can be null if the customer has no purchases.

AdaptyPaidAccessLevelsInfo

Information about the user's access level.

NameTypeDescription
idstringUnique identifier of the access level configured by you in Adapty Dashboard
isActivebooleanTrue if this access level is active. Generally, you can check this property to determine wether a user has an access to premium features
vendorProductIdstringAn identifier of a product in a store that unlocked this access level
vendorTransactionIdstringA transaction id of a purchase in a store that unlocked this access level
vendorOriginalTransactionIdstringAn original transaction id of a purchase in a store that unlocked this access level. For auto-renewable subscriptions this would be an id of the first transaction in a subscription
store'app_store' | 'play_store' | 'adapty'A store of the purchase that unlocked this access level
activatedAtstringTime when this access level was activated. ISO 8601 datetime
startsAtstringTime when this access level has started (could be in the future). ISO 8601 datetime
renewedAtstringTime when the access level was renewed. ISO 8601 datetime
expiresAtstring | nullTime when the access level will expire (could be in the past and could be null for lifetime access). ISO 8601 datetime
isLifetimebooleanTrue if this access level is active for a lifetime (no expiration date)
willRenewbooleanTrue if this auto-renewable subscription is set to renew
isInGracePeriodbooleanTrue if this auto-renewable subscription is in the grace period
unsubscribedAtstringTime 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 datetime
billingIssueDetectedAtstringTime when billing issue was detected. Subscription can still be active. Would be set to null if a charge is made. ISO 8601 datetime
cancellationReason'voluntarily_cancelled' | 'billing_error' | 'refund' | 'price_increase' | 'product_was_not_available' | 'unknown'A reason why a subscription was cancelled
isRefundbooleanTrue if this purchase was refunded
activeIntroductoryOfferType'free_trial' | 'pay_as_you_go' | 'pay_up_front'A type of an active introductory offer. If the value is not null, it means that the offer was applied during the current subscription period
activePromotionalOfferType'free_trial' | 'pay_as_you_go' | 'pay_up_front'A type of an active promotional offer. If the value is not null, it means that the offer was applied during the current subscription period

AdaptySubscriptionInfo

Information about the user's subscription.

NameTypeDescription
isActivebooleanTrue if the subscription is active
vendorProductIdstringAn identifier of a product in a store that unlocked this subscription
vendorTransactionIdstringA transaction id of a purchase in a store that unlocked this subscription
vendorOriginalTransactionIdstringAn original transaction id of the purchase in a store that unlocked this subscription. For auto-renewable subscription, this will be an id of the first transaction in this subscription
store'app_store' | 'play_store' | 'adapty'A store of the purchase that unlocked this subscription
activatedAtstringTime when the subscription was activated. ISO 8601 datetime
startsAtstringTime when the subscription has started (could be in the future). ISO 8601 datetime
renewedAtstringTime when the subscription was renewed. ISO 8601 datetime
expiresAtstringTime when the subscription will expire (could be in the past and could be null for a lifetime access). ISO 8601 datetime
isLifetimebooleanTrue if the subscription is active for a lifetime (no expiration date)
willRenewbooleanTrue if the auto-renewable subscription is set to renew
isInGracePeriodbooleanWhether the auto-renewable subscription is in a grace period
unsubscribedAtstring | nullTime when the auto-renewable subscription was cancelled. Subscription can still be active, it means that auto-renewal is turned off. Would be null if a user reactivates the subscription
billingIssueDetectedAtstring | nullTime when a billing issue was detected. Subscription can still be active
cancellationReason'voluntarily_cancelled' | 'billing_error' | 'refund' | 'price_increase' | 'product_was_not_available' | 'unknown'A reason why the subscription was cancelled
isRefundboolTrue if the purchase was refunded
activeIntroductoryOfferType'free_trial' | 'pay_as_you_go' | 'pay_up_front'A type of an active introductory offer. If the value is not null, it means that the offer was applied during the current subscription period
activePromotionalOfferType'free_trial' | 'pay_as_you_go' | 'pay_up_front'A type of an active promotional offer. If the value is not null, it means that the offer was applied during the current subscription period
isSandboxboolTrue if the product was purchased in a sandbox environment

AdaptyNonSubscriptionsInfo

Information about the user's non-subscription purchases.

NameTypeDescription
purchaseIdstringAn 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)
vendorProductIdstringAn identifier of the product in a store
vendorTransactionIdstringTransaction id in a store
store'app_store' | 'play_store' | 'adapty'A store of the purchase
purchasedAtstringTime when the product was purchased. ISO 8601 datetime
isRefundbooleanTrue if the purchase was refunded
isOneTimebooleanTrue if the product should only be processed once
isSandboxbooleanTrue if the product was purchased in a sandbox environment