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:

ParametreTürZorunluNull OlabilirAçıklama
access_level_idStringEvetHayırAdapty Kontrol Paneli’nde ayarlanan Ücretli Access Level için ID.
storeStringEvetHayırÜrünün satın alındığı mağaza. Seçenekler: app_store, play_store, stripe veya özel mağazanızın adı.
store_product_idStringEvetHayırBu access level’ı açan ürünün uygulama mağazasındaki (App Store, Google Play, Stripe gibi) ID’si.
store_base_plan_idStringEvetEvetGoogle Play’deki base plan ID veya Stripe’taki fiyat ID’si.
store_transaction_idStringEvetHayırUygulama mağazasındaki (App Store, Google Play, Stripe vb.) işlem ID’si.
store_original_transaction_idStringEvetHayır

Abonelikler için bu ID, yenileme zincirindeki orijinal işlemi bağlar. Sonraki işlemler yenileme olarak ilişkilendirilir.

Yenileme yoksa store_original_transaction_id, store_transaction_id ile aynıdır.

offerObjectEvetHayırOffer nesnesi. Müşterinin access level’ı yoksa null olabilir.
environmentStringHayırHayırErişim izni veren işlemin ortamı. Seçenekler: Sandbox, Production.
starts_atISO 8601 dateEvetEvetAccess level’ın aktif hale geldiği tarih ve saat. Gelecekte bir tarih olabilir.
purchased_atISO 8601 dateEvetHayırAccess level için en son satın alma işleminin tarih ve saati.
originally_purchased_atISO 8601 dateEvetHayırAbonelikler için store_original_transaction_id ile ilişkili zincirdeki ilk (orijinal) satın almanın tarih ve saati.
expires_atISO 8601 dateEvetEvetAccess level’ın sona erdiği tarih ve saat. Geçmişte bir tarih olabilir ya da süresiz erişim için null olabilir.
renewal_cancelled_atISO 8601 dateEvetEvetBir abonelik için otomatik yenilemenin kapatıldığı tarih ve saat. Abonelik hâlâ aktif olabilir; yalnızca otomatik olarak yenilenmez. Kullanıcı aboneliği yeniden etkinleştirirse null olarak ayarlanır.
billing_issue_detected_atISO 8601 dateEvetEvetBir ödeme sorununun tespit edildiği tarih ve saat (örneğin başarısız kart ödemesi). Abonelik hâlâ aktif olabilir. Ödeme daha sonra gerçekleşirse bu alan temizlenir.
is_in_grace_periodBooleanEvetHayırAboneliğin ek sürede olup olmadığını gösterir (yalnızca otomatik yenilenen abonelikler için).
cancellation_reasonStringEvetEvetİptal nedeni. Seçenekler: voluntarily_cancelled, billing_error, price_increase, product_was_not_available, refund, upgraded, unknown.

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

ParametreTürZorunluNull OlabilirAçıklama
purchase_typeStringEvetHayırSatın alınan ürünün türü. Olası değer: one_time_purchase.
storeStringEvetHayırÜrünün satın alındığı mağaza. Olası değerler: app_store, play_store, stripe veya özel mağazanızın Store ID’si.
environmentStringHayırHayırAccess level’ı sağlayan işlem ortamı. Seçenekler: Sandbox, Production. Varsayılan olarak Production kullanılır.
store_product_idStringEvetHayırBu access level’ı açan ürünün uygulama mağazasındaki (App Store, Google Play, Stripe vb.) ürün ID’si.
store_transaction_idStringEvetHayırUygulama mağazasındaki (App Store, Google Play, Stripe vb.) işlem ID’si.
store_original_transaction_idStringEvetHayır

Yinelenen abonelikler için, yenileme zincirini birbirine bağlayan orijinal işlem ID’si. Orijinal işlem zincirdeki ilk işlemdir; sonraki işlemler yenilemelerdir.

Yenileme yoksa store_original_transaction_id, store_transaction_id ile aynıdır.

offerObjectHayırEvetSatın alma için kullanılan teklif; bir Offer nesnesi olarak.
is_family_sharedBooleanHayırHayırÜrünün App Store Connect’te aile paylaşımını destekleyip desteklemediğini gösteren Boolean değer. Yalnızca iOS. iOS 14.0 altı ve macOS 11.0 altında her zaman false’tur. Varsayılan olarak false kullanılır.
priceObjectEvetHayırTek seferlik satın almanın fiyatı; bir Price nesnesi olarak. Sıfır maliyetli ilk abonelik satın alımı ücretsiz deneme, sıfır maliyetli yenileme ise ücretsiz yenilemedir.
purchased_atISO 8601 dateEvetHayırAccess level’ın en son satın alındığı tarih ve saat.
refunded_atISO 8601 dateHayırHayırİade edilmişse, iadenin tarih ve saatini gösterir.
cancellation_reasonStringHayırHayırOlası iptal nedenleri: voluntarily_cancelled, billing_error, price_increase, product_was_not_available, refund, cancelled_by_developer, new_subscription, unknown.
variation_idStringHayırHayırSatın almaları yapıldıkları belirli paywall’a kadar izlemek için kullanılan varyasyon ID’si.

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:

ParametreTürBoş olabilirAçıklama
app_idString:heavy_minus_sign:Uygulamanızın dahili ID’si. Adapty Kontrol Paneli’nde görüntüleyebilirsiniz: App Settings -> General tab.
profile_idUUID:heavy_minus_sign:Adapty profil ID’si. Adapty Kontrol Paneli -> Profiles -> ilgili profil sayfasındaki Adapty ID alanında görüntüleyebilirsiniz.
customer_user_idString:heavy_plus_sign:Kullanıcınızın kendi sisteminizdeki ID’si. Adapty Kontrol Paneli -> Profiles -> ilgili profil sayfasındaki Customer user ID alanında görüntüleyebilirsiniz. Bu alan yalnızca Adapty SDK aracılığıyla mobil uygulama kodunuzda kullanıcıları tanımladığınızda çalışır.
total_revenue_usdFloat:heavy_minus_sign:Profilde elde edilen toplam USD cinsinden geliri temsil eden float değer.
segment_hashString:heavy_minus_sign:Dahili parametre.
timestampInteger:heavy_minus_sign:Milisaniye cinsinden yanıt süresi; yarış koşulunu çözmek için gereklidir.
custom_attributesArray:heavy_minus_sign:

Profile en fazla 30 özel attribute eklenebilir. custom_attributes dizisi sağlıyorsanız en az bir attribute anahtarı belirtmeniz gerekir.

Anahtar: Anahtar, en fazla 30 karakterden oluşan bir string olmalıdır. Yalnızca harf, rakam, tire, nokta ve alt çizgiye izin verilir.

Değer: Attribute değeri en fazla 30 karakter olmalıdır. Değer olarak yalnızca string ve float kullanılabilir; boolean değerler float’a dönüştürülür. Attribute’u silmek için boş değer veya null gönderin.

access_levelsArray:heavy_plus_sign:Access level nesnelerinden oluşan dizi. Müşterinin hiç access level’ı yoksa null olabilir.
subscriptionsArray:heavy_plus_sign:Subscription nesnelerinden oluşan dizi. Müşterinin hiç aboneliği yoksa null olabilir.
non_subscriptionsArray:heavy_plus_sign:Non-Subscription nesnelerinden oluşan dizi. Müşterinin hiç satın alımı yoksa null olabilir.

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:

ParametreTürZorunluNull OlabilirAçıklama
purchase_typeStringEvetHayırSatın alınan ürünün türü. Olası değer: subscription.
storeStringEvetHayırÜrünün satın alındığı mağaza. Seçenekler: app_store, play_store, stripe veya özel mağazanızın Store ID’si.
environmentStringHayırHayırİşlemin gerçekleştiği ortam. Sandbox veya Production olabilir. Varsayılan olarak Production kullanılır.
store_product_idStringEvetHayırBu access level’ı açan ürünün uygulama mağazasındaki (App Store, Google Play, Stripe vb.) ID’si.
store_transaction_idStringEvetHayırUygulama mağazasındaki (App Store, Google Play, Stripe vb.) işlem ID’si.
store_original_transaction_idStringEvetHayır

Abonelikler için bu ID, yenileme zincirindeki ilk işleme bağlantı sağlar. Her yenileme bu orijinal işleme bağlıdır.

Yenileme yoksa store_original_transaction_id, store_transaction_id ile aynıdır.

offerObjectHayırEvetSatın almada kullanılan teklif; Offer nesnesi olarak sağlanır.
is_family_sharedBooleanHayırHayırÜrünün App Store Connect’te aile paylaşımını destekleyip desteklemediğini gösteren Boolean değer. Yalnızca iOS. iOS 14.0 altı ve macOS 11.0 altında her zaman false döner. Varsayılan değer false’tur.
priceObjectEvetHayırAboneliğin veya satın almanın fiyatı; Price nesnesi olarak belirtilir. Sıfır maliyetli ilk abonelik satın alımı ücretsiz deneme, sıfır maliyetli yenileme ise ücretsiz yenileme anlamına gelir.
purchased_atISO 8601 dateEvetHayırEn son access level satın alımının tarihi ve saati.
refunded_atISO 8601 dateHayırHayırAboneliğin iade edildiği tarih ve saat (varsa).
cancellation_reasonStringHayırHayırOlası iptal nedenleri: voluntarily_cancelled, billing_error, price_increase, product_was_not_available, refund, upgraded veya unknown.
variation_idStringHayırHayırSatın alımları yapıldıkları belirli paywall’a izlemek için kullanılan varyasyon ID’si.
originally_purchased_atISO 8601 dateEvetHayırAbonelik zincirlerinde, store_original_transaction_id ile bağlantılı orijinal işlemin satın alma tarihi.
expires_atISO 8601 dateEvetHayırAccess level’ın sona ereceği tarih ve saat. Geçmişte bir tarih olabilir; süresiz erişim için null döner.
renew_statusBooleanEvetHayırAbonelik için otomatik yenilemenin etkin olup olmadığını gösterir.
renew_status_changed_atISO 8601 dateHayırHayırOtomatik yenilemenin etkinleştirildiği veya devre dışı bırakıldığı tarih ve saat.
billing_issue_detected_atISO 8601 dateHayırHayırBir ödeme sorununun (örn. başarısız kart işlemi) tespit edildiği tarih ve saat. Abonelik hâlâ aktif olabilir. Ödeme başarılı olursa bu alan temizlenir.
grace_period_expires_atISO 8601 dateHayırHayırAbonelik şu anda ek süre içindeyse bu sürenin sona ereceği tarih ve saat.

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.