API Reference
Interfaces used in Adapty
Interfaces
AdaptyProduct
An information about a product
Name | Type | Description |
---|---|---|
vendorProductId | string | Unique identifier of a product from App Store Connect or Google Play Console |
localizedTitle | string | Title of a product for a user's locale |
localizedDescription | string | Description of a product for a user's locale |
localizedPrice | string | Formatted price of a product for a user's locale |
localizedSubscriptionPeriod | string | undefined | For iOS: Formatted subscription period of a product for a user's locale. No value for Android devices |
price | number | Price of a product in a user's local currency |
currencyCode | string | The ISO 4217 currency code for a user's locale (USD, EUR) |
currencySymbol | string | Currency symbol for a user's locale ($, €) |
regionCode | string | undefined | For iOS: The ISO 3166 ALPHA-2 region code of the user's localization (US, DE). No value for Android devices |
subscriptionPeriod | AdaptyProductSubscriptionPeriod | undefined | Duration of subscription products |
freeTrialPeriod | AdaptyProductSubscriptionPeriod | For Android: Duration of a trial period. No value for iOS |
subscriptionGroupIdentifier | string | undefined | For iOS: An identifier of a subscription group from App Store Connect to which the subscription belongs. No value for Android devices |
introductoryOfferEligibility | boolean | User's eligibility for your introductory offer. Check this property before displaying info about introductory offers (i.e. free trials) |
promotionalOfferEligibility | boolean | User's eligibility for the promotional offers. Check this property before displaying info about promotional offers |
promotionalOfferId | string | undefined | For iOS: An identifier of a promotional offer, provided by Adapty for this specific user. No value for Android devices |
introductoryDiscount | AdaptyProductDiscount | An information about introductory price and duration for a product |
discounts | AdaptyProductDiscount[] | undefined | For iOS: An array of discount offers available for a product. No values for Android devices |
paywallABTestName | string | undefined | Parent A/B test name |
paywallName | string | undefined | Parent paywall name |
isFamilyShareable | boolean | undefined | For iOS 14+: Indicates whether a product is available for a family sharing in App Store Connect. No value for Android devices |
AdaptyProductSubscriptionPeriod
Name | Type | Description |
---|---|---|
unit | number | A unit of time that a subscription period is specified in. The possible values are: day , week , month and year |
numberOfUnits | number | A number of period units |
AdaptyProductDiscount
Name | Type | Description |
---|---|---|
identifier | string | undefined | Unique identifier of a discount offer for a product |
price | number | Discount price of a product in a local currency |
numberOfPeriods | number | A number of periods this product discount is available |
paymentMode | 'free_trial' | 'pay_as_you_go' | 'pay_up_front' | undefined | For iOS: A payment mode for this product discount. No value for Android devices |
localizedPrice | string | A formatted price of a discount for a user's locale |
localizedSubscriptionPeriod | string | undefined | For iOS: A formatted subscription period of a discount for a user's locale. No value for Android devices |
localizedNumberOfPeriods | string | undefined | For iOS: A formatted number of periods of a discount for a user's locale |
subscriptionPeriod | AdaptyProductSubscriptionPeriod | An information about period for a product discount |
AdaptyPaywall
An information about a paywall including products.
Name | Type | Description |
---|---|---|
developerId | string | An identifier of a paywall, configured in Adapty Dashboard |
variationId | string | An identifier of a variation, used to attribute purchases to this paywall |
revision | number | Current revision (version) of a paywall. Every change within a paywall creates a new revision |
isPromo | boolean | True if this paywall is a part of a promo campaign |
customPayload | string | A custom JSON string configured in Adapty Dashboard for this paywall |
products | AdaptyProduct[] | Array of related products |
abTestName | string | undefined | Parent A/B test name |
name | string | Paywall name |
AdaptyPromo
Information about a promo offer for a user.
Name | Type | Description |
---|---|---|
promoType | string | A type of a promo offer |
variationId | string | An identifier of a variation, used to attribute purchases to this promo |
expiresAt | string | ISO 8601 datetime formatted string, when this promo offer expires |
paywall | AdaptyPaywall | Related paywall |
AdaptyPurchaserInfo
An information about a user's subscription status and purchase history.
Name | Type | Description |
---|---|---|
customerUserId | string | An identifier of a user in your system |
accessLevels | Record<string, AdaptyPaidAccessLevelsInfo > | null | The keys are access level identifiers configured by you in Adapty Dashboard. The values are Can be null if the customer has no access levels |
subscriptions | Record<string, AdaptySubscriptionInfo > | null | The keys are product ids from a store. The values are information about subscriptions. Can be null if the customer has no subscriptions |
nonSubscriptions | Record<string, AdaptyNonSubscriptionsInfo > | null | The 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.
Name | Type | Description |
---|---|---|
id | string | Unique identifier of the access level configured by you in Adapty Dashboard |
isActive | boolean | True if this access level is active. Generally, you can check this property to determine wether a user has an access to premium features |
vendorProductId | string | An identifier of a product in a store that unlocked this access level |
vendorTransactionId | string | A transaction id of a purchase in a store that unlocked this access level |
vendorOriginalTransactionId | string | An 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 |
activatedAt | string | Time when this access level was activated. ISO 8601 datetime |
startsAt | string | Time when this access level has started (could be in the future). ISO 8601 datetime |
renewedAt | string | Time when the access level was renewed. ISO 8601 datetime |
expiresAt | string | null | Time when the access level will expire (could be in the past and could be null for lifetime access). ISO 8601 datetime |
isLifetime | boolean | True if this access level is active for a lifetime (no expiration date) |
willRenew | boolean | True if this auto-renewable subscription is set to renew |
isInGracePeriod | boolean | True if this auto-renewable subscription is in the grace period |
unsubscribedAt | string | 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 datetime |
billingIssueDetectedAt | string | Time 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 |
isRefund | boolean | True 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.
Name | Type | Description |
---|---|---|
isActive | boolean | True if the subscription is active |
vendorProductId | string | An identifier of a product in a store that unlocked this subscription |
vendorTransactionId | string | A transaction id of a purchase in a store that unlocked this subscription |
vendorOriginalTransactionId | string | An 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 |
activatedAt | string | Time when the subscription was activated. ISO 8601 datetime |
startsAt | string | Time when the subscription has started (could be in the future). ISO 8601 datetime |
renewedAt | string | Time when the subscription was renewed. ISO 8601 datetime |
expiresAt | string | Time when the subscription will expire (could be in the past and could be null for a lifetime access). ISO 8601 datetime |
isLifetime | boolean | True if the subscription is active for a lifetime (no expiration date) |
willRenew | boolean | True if the auto-renewable subscription is set to renew |
isInGracePeriod | boolean | Whether the auto-renewable subscription is in a grace period |
unsubscribedAt | string | null | Time 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 |
billingIssueDetectedAt | string | null | Time 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 |
isRefund | bool | True 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 |
isSandbox | bool | True if the product was purchased in a sandbox environment |
AdaptyNonSubscriptionsInfo
Information about the user's non-subscription purchases.
Name | Type | Description |
---|---|---|
purchaseId | string | An 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) |
vendorProductId | string | An identifier of the product in a store |
vendorTransactionId | string | Transaction id in a store |
store | 'app_store' | 'play_store' | 'adapty' | A store of the purchase |
purchasedAt | string | Time when the product was purchased. ISO 8601 datetime |
isRefund | boolean | True if the purchase was refunded |
isOneTime | boolean | True if the product should only be processed once |
isSandbox | boolean | True if the product was purchased in a sandbox environment |
Updated over 1 year ago