Adapty Developer Hub

Welcome to the AdaptyTeam developer hub. You'll find comprehensive guides and documentation to help you start working with Adapty as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    Discussions

API Objects

Objects that are used in Adapty server-side API

Objects

Adapty API has JSON objects so you can understand a response structure and wrap it into your code.

All datetime values are ISO 8601, for example "2020-01-15T15:10:36.517975+0000".

Profile

Info about the customer and his subscription.

ParamTypeRequiredNullableDescription
profile_idUUIDAdapty profile ID
customer_user_idstrUser ID in developer’s (your) system.
paid_access_levelsdictDictionary where the keys are paid access level identifiers configured by developer in Adapty dashboard. Values are CustomerAccessLevel objects. Can be null if the customer has no access levels
subscriptionsdictDictionary where the keys are vendor product IDs. Values are Subscription objects. Can be null if the customer has no subscriptions
non_subscriptionsdictDictionary where the keys are vendor product ids. Values are an array of Non Subscription objects. Can be null if the customer has no purchases.

CustomerAccessLevel

Info about customer’s access level.

Configure which products unlock premium (paid) features in your app using Adapty dashboard. Then, check in the app for access level available for a user, for example in a way below (in swift)

if (profile.paidAccessLevels["premium"]?.isActive == true) {
    /* Grant user access to paid functions of the app */
}
ParamTypeRequiredNullableDescription
idstrPaid Access Level identifier configured by developer in Adapty dashboard
is_activeboolBoolean indicating whether the paid access level is active
expires_atISO 8601 dateThe datetime when access level will expire. May be in the past and may be null for lifetime access
starts_atISO 8601 dateThe datetime when access level will be active. May be in the future
is_lifetimeboolBoolean indicating whether the paid access level is active for a lifetime (no expiration date). If set to true you shouldn’t use expires_at
vendor_product_idstrIdentifier of the product in vendor system (App Store/Google Play etc.) that unlocked this access level
storestrStore where the product was purchased. Possible values are: app_store, play_store, and adapty
activated_atISO 8601 dateThe datetime when access level was activated. May be in the future
renewed_atISO 8601 dateThe datetime when the access level was renewed
will_renewboolBoolean indicating whether auto-renewable subscription is set to renew
is_in_grace_periodboolBoolean indicating whether auto-renewable subscription is in the grace period
unsubscribed_atISO 8601 dateThe datetime when auto-renewable subscription was cancelled. Subscription can still be active, it means that auto-renewal turned off. It will be set to null if the user reactivates the subscription
billing_issue_detected_atISO 8601 dateThe datetime when billing issue was detected and a vendor was not able to charge the card. Subscription can still be active. Will set to null if the charge was successful
active_introductory_offer_typestrThe type of active introductory offer. Possible values are: free_trial, pay_as_you_go, and pay_up_front. If the value is not null it means that the offer was applied during the current subscription period
active_promotional_offer_typestrThe type of active promotional offer. Possible values are: free_trial, pay_as_you_go, and pay_up_front. If the value is not null it means that the offer was applied during the current subscription period

Subscription

Info about vendor subscription. You don’t have to use this object in most cases, CustomerPaidAccessLevel is the preferred way to work with access to the app. When using this object, you need to implement processing logic for each subscription period (a week, a month, a year, lifetime).

ParamTypeRequiredNullableDescription
is_activeboolBoolean indicating whether the subscription is active
expires_atISO 8601 dateThe datetime when access level will expire. May be in the past and may be null for lifetime access
starts_atISO 8601 dateThe datetime when the subscription will be active. May be in the future for season subscriptions
is_lifetimeboolBoolean indicating whether the subscription is active for a lifetime without no expiration date. If set to true you shouldn’t use expires_at
vendor_product_idstrIdentifier of the product in vendor system (App Store/Google Play etc.)
vendor_transaction_idstrTransaction id in the vendor system
vendor_original_transaction_idstrOriginal transaction id in vendor system. For auto-renewable subscription, this will be the ID of the first transaction in the subscription
storestrStore where the product was purchased. Possible values are: app_store, play_store, and adapty
activated_atISO 8601 dateThe datetime when access level was activated. May be in the future
renewed_atISO 8601 dateThe datetime when the access level was renewed
will_renewboolBoolean indicating whether auto-renewable subscription is set to renew. If a user did not cancel a subscription, will be set to true
is_in_grace_periodboolBoolean indicating whether auto-renewable subscription is in the grace period
unsubscribed_atISO 8601 dateThe datetime when auto-renewable subscription was cancelled. Subscription can still be active, it just means that auto-renewal turned off. Will set to null if the user reactivates subscription
billing_issue_detected_atISO 8601 dateThe datetime when billing issue was detected (vendor was not able to charge the card). Subscription can still be active. Will set to null if the charge was successful.
active_introductory_offer_typestrThe type of active introductory offer. Possible values are: free_trial, pay_as_you_go, and pay_up_front. If the value is not null it means that the offer was applied during the current subscription period
active_promotional_offer_typestrThe type of active promotional offer. Possible values are: free_trial, pay_as_you_go, and pay_up_front. If the value is not null it means that the offer was applied during the current subscription period
is_sandboxboolBoolean indicating whether the product was purchased in sandbox or production environment

Non Subscription

Info about non-subscription purchases. These can be one-time (consumable) products, unlocks (like new map unlock in the game), etc.

ParamTypeRequiredNullableDescription
purchase_idstrIdentifier of the purchase in Adapty. You can use it to ensure that you’ve already processed this purchase, for example tracking one time products
vendor_product_idstrIdentifier of the product in vendor system (App Store/Google Play etc.)
vendor_transaction_idstrTransaction ID in vendor system
vendor_original_transaction_idstrOriginal transaction ID in vendor system. For auto-renewable subscription, this will be the ID of the first transaction in the subscription
storestrStore where the product was purchased. Possible values are app_store, play_store, adapty
purchased_atISO 8601 dateThe datetime when the product was purchased
is_one_timeboolBoolean indicating whether the product should only be processed once. For example, if a user purchased 500 coins in a game. If true, the purchase will be returned by Adapty API one time only
is_sandboxboolBoolean indicating whether the product was purchased in a sandbox or production environment.

Updated about a month ago


API Objects


Objects that are used in Adapty server-side API

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.