Skip to main content

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

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:

ParameterTypeRequiredNullableDescription
access_level_idStringYesNoID for the Paid Access Level set up in the Adapty Dashboard.
storeStringYesNoStore where the product was bought. Options: app_store, play_store, stripe, or the name of your custom store.
store_product_idStringYesNoID of the product in the app store (like App Store, Google Play, Stripe) that unlocked this access level.
store_base_plan_idStringYesYesBase plan ID in Google Play or price ID in Stripe.
store_transaction_idStringYesNoTransaction ID in the app store (App Store, Google Play, Stripe, etc.).
store_original_transaction_idStringYesNo

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.

offerObjectYesNoThe Offer object. Can be null if the customer has no access levels.
environmentStringNoNoEnvironment for the transaction that granted access. Options: Sandbox, Production.
starts_atISO 8601 dateYesYesThe date time when the access level becomes active. Could be in the future.
purchased_atISO 8601 dateYesNoThe datetime of the most recent purchase for the access level.
originally_purchased_atISO 8601 dateYesNoFor 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 dateYesYesThe datetime when the access level expires. Might be in the past, or null for lifetime access.
renewal_cancelled_atISO 8601 dateYesYesThe 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 dateYesYesThe 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_periodBooleanYesNoShows whether the subscription is in a grace period (only for auto-renewable subscriptions).
cancellation_reasonStringYesYesReason for cancellation, with options like: voluntarily_cancelled, billing_error, price_increase, product_was_not_available, refund, upgraded, unknown.
note

Although the SDK includes the is_active parameter to check if a subscription is active, the server-side API does not provide this parameter. However, you can determine subscription status at any time by checking whether the current date falls between the starts_at and expires_at parameters.


Installation Meta

Information about installation of the app on a specific device.

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

ParameterTypeRequiredNullableDescription
device_idStringYesNoThe device identifier is generated on the client side.
deviceStringNoYesThe end-user-visible device model name.
localeStringNoYesThe locale used by the end user.
osStringNoYesThe operating system used by the end user.
platformStringNoYesThe device platform used by the end user.
timezoneStringNoYesThe timezone of the end user.
user_agentStringNoYesDetails about the end user environment: device, operating system, and browser information of the end user interacting with your application.
idfaStringNoYesThe Identifier for Advertisers, assigned by Apple to a user's device.
idfvStringNoYesThe 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_idStringNoYesThe Advertising ID is a unique identifier offered by the Android Operating System that advertisers might use to uniquely identify you.
android_idStringNoYesOn 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_idStringNoYesAn 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:

ParameterTypeRequiredNullableDescription
purchase_idStringYesNoIdentifier of the purchase in Adapty. You can use it to ensure that you've already processed this purchase, for example tracking one-time products.
storeStringYesNoStore where the product was purchased. Possible values are: app_store, play_store, stripe, name of your custom store.
store_product_idStringYesNoIdentifier of the product in the app store (App Store/Google Play/Stripe, etc.) that unlocked this access level.
store_base_plan_idStringYesYesBase plan ID in the Google Play Store or price ID in Stripe.
store_transaction_idStringYesNoThe ID of the transaction in the app store (App Store/Google Play/Stripe, etc.).
store_original_transaction_idStringYesNo

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 dateYesNoThe datetime when the access level was purchased the latest time.
environmentStringNoNoEnvironment of the transaction that provided the access level. Possible values: Sandbox, Production.
is_refundBooleanYesNoIndicates if the product has been refunded.
is_consumableBooleanYesNoIndicates whether the product is consumable.

One-Time Purchase

ParameterTypeRequiredNullableDescription
purchase_typeStringYesNoThe type of product purchased. Possible value: one_time_purchase.
storeStringYesNoStore where the product was bought. Possible values: app_store, play_store, stripe, or the Store ID of your custom store.
environmentStringNoNoTransaction environment that provided the access level. Options: Sandbox, Production. Production is used by default.
store_product_idStringYesNoThe product ID in the app store (App Store, Google Play, Stripe, etc.) that unlocked this access level.
store_transaction_idStringYesNoTransaction ID in the app store (App Store, Google Play, Stripe, etc.).
store_original_transaction_idStringYesNo

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

If there's no renewal, store_original_transaction_id matches store_transaction_id.

offerObjectNoYesThe offer used for the purchase as an Offer object.
is_family_sharedBooleanNoNoA 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. false is used by default.
priceObjectYesNoPrice of the one-time 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 dateYesNoThe datetime when the access level was last purchased.
refunded_atISO 8601 dateNoNoIf refunded, shows the datetime of the refund.
cancellation_reasonStringNoNoPossible reasons for cancellation: voluntarily_cancelled, billing_error, price_increase, product_was_not_available, refund, cancelled_by_developer, new_subscription, unknown.
variation_idStringNoNoThe 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:

ParameterTypeRequiredNullableDescription
categoryStringYesNoThe category of the applied offer. Options are: introductory, promotional, offer_code, win_back.
typeStringYesNoThe 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.
idStringNoYesThe 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:

ParameterTypeRequiredNullableDescription
countryStringYesNoThe country where the price applies.
currencyStringYesNoThe currency used for the price.
valueFloatYesNoThe 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_attributesArray

A maximum of 30 custom attributes to the profile are allowed to be set. If you provide the custom_attributes array, 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_levelsArrayArray of Access level objects. Can be null if the customer has no access levels.
subscriptionsArrayArray of Subscription objects. Can be null if the customer has no subscriptions.
non_subscriptionsArrayArray of Non-Subscription objects. Can be null if the customer has no purchases.

Product

This object contains details about a product in Adapty.

NameTypeRequiredDescription
titleStringNoProduct name from the Products section in the Adapty Dashboard.
is_consumableBooleanYesIndicates whether the product is consumable.
adapty_product_idUUIDNoInternal product ID as used in Adapty.
vendor_product_idStringYesThe product ID in app stores.
introductory_offer_eligibilityBooleanNoSpecifies if the user is eligible for an iOS introductory offer.
promotional_offer_eligibilityBooleanNoSpecifies if the user is eligible for a promotional offer.
base_plan_idStringNoBase plan ID for Google Play or price ID for Stripe.
offerJSONNoAn Offer object as a JSON.
{
"title": "Monthly Subscription w/o Trial",
"is_consumable": true,
"adapty_product_id": "InternalProductId",
"vendor_product_id": "onemonth_no_trial",
"introductory_offer_eligibility": false,
"promotional_offer_eligibility": true,
"base_plan_id": "B1",
"offer": {
"category": "promotional",
"type": "pay_up_front",
"id": "StoreOfferId"
}
}

RemoteConfig

This object contains information about a remote config for a paywall.

{
"lang": "en",
"data": "{\"bodyItems\":[{\"spacerValue\":{\"height\":20,\"style\":{\"type\":\"emptySpace\"}},\"type\":\"spacer\"},{\"mediaValue\":{\"ratio\":\"1:1\",\"source\":{\"fileType\":\"image\",\"reference\":{\"en\":\"bundle/images/new1.png\"}},\"widthStyle\":\"full\"},\"type\":\"media\"},{\"titleValue\":{\"alignment\":\"center\",\"subtitleConfig\":{\"fontSize\":17,\"text\":\"\",\"color\":\"#FFFFFF\"},\"titleConfig\":{\"fontSize\":22,\"text\":\"\"}},\"type\":\"title\"},{\"productListValue\":{\"items\":[{\"productId\":\"exampleapp.oneWeek\",\"promoText\":\"paywall.promo-1.title\",\"backgroundColor\":\"#0B867D\"},{\"discountRate\":80,\"productId\":\"exampleapp.oneYear\",\"promoText\":\"paywall.promo-2.title\",\"backgroundColor\":\"#0B867D\"}],\"layout\":\"vertical\"},\"type\":\"productList\"}],\"defaultProductId\":\"exampleapp.oneWeek\",\"footer\":{\"singleProductValue\":{\"customTitles\":{\"exampleapp.oneWeek\":\"Subscribe\",\"exampleapp.oneYear\":\"Subscribe\"},\"productId\":\"exampleapp.oneWeek\"},\"type\":\"singleProduct\"},\"id\":\"exampleapp\",\"isFullScreen\":true,\"settings\":{\"backgroundColor\":\"#000000\",\"closeButtonAlignment\":\"left\",\"closeButtonIconStyle\":\"light\",\"colorScheme\":{\"accent\":\"#007566\",\"background\":\"#001B0D\",\"label\":\"#FFFFFF\",\"primary\":\"#10C6B6\",\"secondaryLabel\":\"#FFFFFF\",\"seperator\":\"#FFFFFF\"},\"isFullScreen\":true,\"shouldShowAlertOnClose\":false,\"showCloseButtonAfter\":1,\"triggerPurchaseWithAlert\":false,\"triggerPurchaseWithProductChange\":false}}"
}

NameTypeRequiredDescription
langStringYes

Locale code for the paywall localization. It uses language and region subtags separated by a hyphen (-).

Examples: en for English, pt-br for Brazilian Portuguese.

Refer to Localizations and locale codes for more details.

dataStringYesSerialized JSON string representing the remote config of your paywall. You can find it in the Remote Config tab of a specific paywall in the Adapty Dashboard.

Subscription

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

ParameterTypeRequiredNullableDescription
purchase_typeStringYesNoThe type of product purchased. Possible value: subscription.
storeStringYesNoStore where the product was bought. Options include app_store, play_store, stripe, or the Store ID of your custom store.
environmentStringNoNoEnvironment where the transaction took place. Options are Sandbox or Production. Production is used by default.
store_product_idStringYesNoID of the product in the app store (App Store, Google Play, Stripe, etc.) that unlocked this access level.
store_transaction_idStringYesNoTransaction ID in the app store (App Store, Google Play, Stripe, etc.).
store_original_transaction_idStringYesNo

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.

offerObjectNoYesThe offer used in the purchase, provided as an Offer object.
is_family_sharedBooleanNoNoA 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. false is used by default.
priceObjectYesNoPrice 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 dateYesNoThe datetime of the most recent access level purchase.
refunded_atISO 8601 dateNoNoThe datetime when the subscription was refunded, if applicable.
cancellation_reasonStringNoNoPossible reasons for cancellation include: voluntarily_cancelled, billing_error, price_increase, product_was_not_available, refund, upgraded, or unknown.
variation_idStringNoNoThe variation ID used to trace purchases to the specific paywall they were made from.
originally_purchased_atISO 8601 dateYesNoFor subscription chains, this is the purchase date of the original transaction, linked by store_original_transaction_id.
expires_atISO 8601 dateYesNoThe datetime when the access level expires. It may be in the past and null for lifetime access.
renew_statusBooleanYesNoIndicates if auto-renewal is enabled for the subscription.
renew_status_changed_atISO 8601 dateNoNoThe datetime when auto-renewal was either enabled or disabled.
billing_issue_detected_atISO 8601 dateNoNoThe datetime when a billing issue was detected (e.g., a failed card charge). The subscription might still be active. This is cleared if the payment goes through.
grace_period_expires_atISO 8601 dateNoNoThe datetime when the grace period will end if the subscription is currently in one.
note

Although the SDK includes the is_active parameter to check if a subscription is active, the server-side API does not provide this parameter. However, you can determine subscription status at any time by checking whether the current date falls between the starts_at and expires_at parameters of the Access Level object.