Skip to main content

API objects

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".

Access level

Info about customer’s access level.

Access levels let you control what your app's users can do in your mobile app without hardcoding specific product IDs. Each product defines how long the user gets a certain access level. So, whenever a user makes a purchase, Adapty grants access to the app for a specific period (for subscriptions) or forever (for lifetime purchases). Alternatively, you can grant specific access for a specified time to a user via server-side API.

You can do the following action via Adapty server-side API:

ParameterTypeRequired in requestNullable in requestDescription
access_level_idStringID for the Paid Access Level set up in the Adapty Dashboard.
storeStringStore where the product was bought. Options: app_store, play_store, stripe, or the name of your custom store.
store_product_idStringID of the product in the app store (like App Store, Google Play, Stripe) that unlocked this access level.
store_base_plan_idStringBase plan ID in Google Play or price ID in Stripe.
store_transaction_idStringTransaction ID in the app store (App Store, Google Play, Stripe, etc.).
store_original_transaction_idString

For subscriptions, this ID links the original transaction in the chain of renewals. Later transactions are linked as renewals.

If there’s no renewal, store_original_transaction_id matches store_transaction_id.

offerDictionaryDictionary where keys are offer IDs set by the developer in Adapty Dashboard. Values are Offer objects. Can be null if the customer has no access levels.
environmentStringEnvironment for the transaction that granted access. Options: Sandbox, Production.
starts_atISO 8601 dateThe date time when the access level becomes active. Could be in the future.
purchased_atISO 8601 dateThe datetime of the most recent purchase for the access level.
originally_purchased_atISO 8601 dateFor subscriptions, this is the date and time of the very first (original) purchase in the chain, tied to store_original_transaction_id.
expires_atISO 8601 dateThe datetime when the access level expires. Might be in the past, or null for lifetime access.
renewal_cancelled_atISO 8601 dateThe datetime when auto-renewal was turned off for a subscription. The subscription can still be active; it just won’t auto-renew. Set to null if the user reactivates the subscription.
billing_issue_detected_atISO 8601 dateThe datetime when a billing issue was found (like a failed card charge). The subscription might still be active. This is cleared if the payment goes through later.
is_in_grace_periodBooleanShows whether the subscription is in a grace period (only for auto-renewable subscriptions).
cancellation_reasonStringReason for cancellation, with options like: voluntarily_cancelled, billing_error, price_increase, product_was_not_available, refund, upgraded, unknown.

Installation Meta

Information about installation of the app on a specific device.

You can do the following action via Adapty server-side API:

ParameterTypeRequired in requestNullable in requestDescription
device_idStringThe device identifier is generated on the client side.
deviceStringThe end-user-visible device model name.
localeStringThe locale used by the end user.
osStringThe operating system used by the end user.
platformStringThe device platform used by the end user.
timezoneStringThe timezone of the end user.
user_agentStringDetails about the end user environment: device, operating system, and browser information of the end user interacting with your application.
idfaStringThe Identifier for Advertisers, assigned by Apple to a user's device.
idfvStringThe Identifier for Vendors (IDFV) is a code assigned to all apps by one developer and is shared across all apps by that developer on your device.
advertising_idStringThe Advertising ID is a unique identifier offered by the Android Operating System that advertisers might use to uniquely identify you.
android_idStringOn Android 8.0 (API level 26) and higher versions of the platform, a 64-bit number (expressed as a hexadecimal string), unique to each combination of app-signing key, user, and device. For more details, see Android developer documentation.
android_app_set_idStringAn AppSetId - unique, per-device, per developer-account user-resettable ID for non-monetizing advertising use cases.

Non Subscription

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

You can do the following action via Adapty server-side API:

ParameterTypeRequired in requestNullable in requestDescription
purchase_idStringIdentifier of the purchase in Adapty. You can use it to ensure that you’ve already processed this purchase, for example tracking one-time products.
storeStringStore where the product was purchased. Possible values are: app_store, play_store, stripe, name of your custom store.
store_product_idStringIdentifier of the product in the app store (App Store/Google Play/Stripe, etc.) that unlocked this access level.
store_base_plan_idStringBase plan ID in the Google Play Store or price ID in Stripe.
store_transaction_idStringThe ID of the transaction in the app store (App Store/Google Play/Stripe, etc.).
store_original_transaction_idString

In case of prolonged subscriptions, a chain of subscriptions is generated. The original transaction i the very first transaction in this chain and the chain is linked by it. Other transactions in the chain are prolongations.


If no prolongation, store_original_transaction_id will coincide with store_transaction_id.

purchased_atISO 8601 dateThe datetime when the access level was purchased the latest time.
environmentStringEnvironment of the transaction that provided the access level. Possible values: Sandbox, Production.
is_refundBooleanIndicates if the product has been refunded.
is_consumableBooleanIndicates whether the product is consumable.

One-Time Purchase

ParameterTypeRequired in requestNullable in requestDescription
purchase_typeStringThe type of product purchased. Possible value: one_time_purchase.
storeStringStore where the product was bought. Possible values: app_store, play_store, stripe, or the Store ID of your custom store.
environmentStringTransaction environment that provided the access level. Options: Sandbox, Production.
store_product_idStringThe product ID in the app store (App Store, Google Play, Stripe, etc.) that unlocked this access level.
store_transaction_idStringTransaction ID in the app store (App Store, Google Play, Stripe, etc.).
store_original_transaction_idString

For recurring subscriptions, this is the original transaction ID that links the chain of renewals. The original transaction is the first in the chain; later transactions are extensions of it.

If no extensions, store_original_transaction_id matches store_transaction_id.

offerObjectThe offer used for the purchase as an Offer object.
is_family_sharedBooleanA Boolean value indicating whether the product supports family sharing in App Store Connect. iOS only. Always false for iOS below 14.0 and macOS below 11.0.
priceObjectPrice of the subscription or purchase as a Price object. An initial subscription purchase with zero cost is a free trial; a renewal with zero cost is a free renewal.
purchased_atISO 8601 dateThe datetime when the access level was last purchased.
refunded_atISO 8601 dateIf refunded, shows the datetime of the refund.
cancellation_reasonStringPossible reasons for cancellation: voluntarily_cancelled, billing_error, price_increase, product_was_not_available, refund, cancelled_by_developer, new_subscription_replace, upgraded, unknown, adapty_revoked.
variation_idStringThe variation ID used to trace purchases to the specific paywall they were made from.

Offer

Information on the applied offer. The Offer object is a part of the Subscription, and Access level objects.

You can do the following actions with offers via Adapty server-side API:

ParameterTypeRequired in requestNullable in requestDescription
offer_categoryStringThe category of the applied offer. Options are: introductory, promotional, offer_code, win_back.
offer_typeStringThe type of active offer. Options are: free_trial, pay_as_you_go, pay_up_front, and unknown. If this isn’t null, it means the offer was applied in the current subscription period.
offer_idStringThe ID of the applied offer.

Price

Information about the cost of your product in local currency. The Price object is a part of the Subscription and Purchase objects.

You can do the following actions with product price via Adapty server-side API:

ParameterTypeRequired in requestNullable in requestDescription
countryStringThe country where the price applies.
currencyStringThe currency used for the price.
valueFloatThe product's cost in the local currency.

Profile

Info about the customer and their subscription

You can do the following actions with user profiles via Adapty server-side API:

ParameterTypeNullableDescription
app_idStringThe internal ID of your app. You can see in the the Adapty Dashboard: App Settings -> General tab.
profile_idUUIDAdapty profile ID. You can see it in the Adapty ID field on the Adapty Dashboard -> Profiles -> specific profile page.
customer_user_idStringThe ID of your user in your system. You can see it in the Customer user ID field on the Adapty Dashboard -> Profiles -> specific profile page. It will work only if you identify the users in your mobile app code via Adapty SDK.
total_revenue_usdFloatA float value representing the total revenue in USD earned in the profile.
segment_hashStringInternal parameter.
timestampIntegerResponse time in milliseconds, needs for resolve a race condition.
custom_attributesDictionary

A maximum of 30 custom attributes to the profile are allowed to be set. If you provide the custom_attributes dictionary, you must provide at least one attribute key.

Key: The key must be a string with no more than 30 characters. Only letters, numbers, dashes, points, and underscores allowed

Value: The attribute value must be no more than 30 characters. Only strings and floats are allowed as values, booleans will be converted to floats. Send an empty value or null to delete the attribute.

access_levelsDictionaryProfile Paid Access Level objects. Dictionary where the keys are paid access level identifiers configured by a developer in the Adapty Dashboard. Values are Access level objects. Can be null if the customer has no access levels.
subscriptionsDictionaryDictionary where the keys are vendor product IDs. Values are Subscription objects. Can be null if the customer has no subscriptions.
non_subscriptionsDictionaryDictionary where the keys are vendor product ids. Values are an array of Non-Subscription objects. Can be null if the customer has no purchases.

Subscription

Info about your end user subscription. You can do the following action via Adapty server-side API:

ParameterTypeRequired in requestNullable in requestDescription
purchase_typeStringThe type of product purchased. Possible value: subscription.
storeStringStore where the product was bought. Options include app_store, play_store, stripe, or the name of your custom store.
environmentStringEnvironment where the transaction took place. Options are Sandbox or Production.
store_product_idStringID of the product in the app store (like App Store, Google Play, Stripe) that unlocked this access level.
store_base_plan_idStringBase plan ID in Google Play or price ID in Stripe.
store_transaction_idStringTransaction ID in the app store (App Store, Google Play, Stripe, etc.).
store_original_transaction_idString

For subscriptions, this ID links to the first transaction in a renewal chain. Each renewal is connected to this original transaction.


If there’s no renewal, store_original_transaction_id matches store_transaction_id.

offerObjectThe offer used in the purchase, provided as an Offer object.
is_family_sharedBooleanA Boolean value indicating whether the product supports family sharing in App Store Connect. iOS only. Always false for iOS below 14.0 and macOS below 11.0.
priceObjectPrice of the subscription as a Price object. An initial subscription purchase with zero cost is a free trial; a renewal with zero cost is a free renewal.
purchased_atISO 8601 dateThe datetime of the most recent access level purchase.
refunded_atISO 8601 dateIf refunded, shows the datetime of the refund.
cancellation_reasonStringPossible reasons for cancellation include: voluntarily_cancelled, billing_error, price_increase, product_was_not_available, refund, upgraded, or unknown.
variation_idStringThe variation ID used to trace purchases to the specific paywall they were made from.
originally_purchased_atISO 8601 dateFor subscription chains, this is the purchase date of the original transaction, linked by store_original_transaction_id.
expires_atISO 8601 dateThe datetime when the access level expires. It may be in the past and may be null for lifetime access.
renew_status
renew_cancelled_atISO 8601 dateThe datetime when auto-renewal was canceled. The subscription can still be active; it just won’t renew automatically. Set to null if the user reactivates.
billing_issue_detected_atISO 8601 dateThe datetime when a billing issue was detected (e.g., a failed card charge). Subscription might still be active. This is cleared if the payment goes through.
is_in_grace_periodBooleanIndicates if the auto-renewable subscription is currently in a grace period.
grace_period_expires_atBooleanIndicates if the auto-renewable subscription is currently in a grace period.