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:

パラメーター必須Null 許容説明
access_level_idStringYesNoAdapty ダッシュボードで設定されたアクセスレベルの ID。
storeStringYesNoプロダクトが購入されたストア。選択肢: app_storeplay_storestripe、またはカスタムストアの名前。
store_product_idStringYesNoこのアクセスレベルを解放した、アプリストア(App Store、Google Play、Stripe など)内のプロダクト ID。
store_base_plan_idStringYesYesGoogle Play のベースプラン ID、または Stripe の価格 ID
store_transaction_idStringYesNoアプリストア(App Store、Google Play、Stripe など)でのトランザクション ID。
store_original_transaction_idStringYesNo

サブスクリプションの場合、このIDは更新チェーン内の最初のトランザクションを紐付けます。それ以降のトランザクションは更新として関連付けられます。

更新がない場合、store_original_transaction_id は store_transaction_id と一致します。

offerObjectYesNoオファーオブジェクト。顧客がアクセスレベルを持っていない場合は null になることがあります。
environmentStringNoNoアクセスを付与したトランザクションの環境。選択肢: SandboxProduction
starts_atISO 8601 dateYesYesアクセスレベルが有効になる日時。将来の日時になる場合があります。
purchased_atISO 8601 dateYesNoアクセスレベルに対する最新の購入日時。
originally_purchased_atISO 8601 dateYesNoサブスクリプションの場合、チェーン内の最初(オリジナル)の購入日時。store_original_transaction_id に紐付きます。
expires_atISO 8601 dateYesYesアクセスレベルが期限切れになる日時。過去の日時になる場合や、永続アクセスの場合は null になります。
renewal_cancelled_atISO 8601 dateYesYesサブスクリプションの自動更新がオフにされた日時。サブスクリプション自体はまだ有効な場合があり、自動更新されないだけです。ユーザーがサブスクリプションを再有効化した場合は null に設定されます。
billing_issue_detected_atISO 8601 dateYesYes請求の問題(カードへの課金失敗など)が検出された日時。サブスクリプションはまだ有効な場合があります。その後の支払いが成功した場合はクリアされます。
is_in_grace_periodBooleanYesNoサブスクリプションがグレース期間中かどうかを示します(自動更新サブスクリプションのみ)。
cancellation_reasonStringYesYesキャンセルの理由。選択肢: voluntarily_cancelledbilling_errorprice_increaseproduct_was_not_availablerefundupgradedunknown

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

パラメーター必須Null許容説明
purchase_typeStringYesNo購入したプロダクトの種類。使用可能な値: one_time_purchase
storeStringYesNoプロダクトが購入されたストア。使用可能な値: app_storeplay_storestripe、またはカスタムストアのストアID。
environmentStringNoNoアクセスレベルを付与したトランザクションの環境。オプション: SandboxProduction。デフォルトは Production
store_product_idStringYesNoこのアクセスレベルをアンロックしたアプリストア(App Store、Google Play、Stripeなど)内のプロダクトID。
store_transaction_idStringYesNoアプリストア(App Store、Google Play、Stripeなど)内のトランザクションID。
store_original_transaction_idStringYesNo

自動更新サブスクリプションの場合、更新チェーンを紐付ける元のトランザクションID。元のトランザクションがチェーンの最初であり、以降のトランザクションは更新分です。

更新がない場合、store_original_transaction_idstore_transaction_id と一致します。

offerObjectNoYes購入に使用されたオファー(Offer オブジェクト)。
is_family_sharedBooleanNoNoApp Store Connect でプロダクトがファミリー共有をサポートしているかどうかを示すブール値。iOS のみ。iOS 14.0 未満および macOS 11.0 未満では常に false。デフォルトは false
priceObjectYesNo買い切り購入の価格(Price オブジェクト)。コストがゼロの初回サブスクリプション購入は無料トライアル、コストがゼロの更新は無料更新です。
purchased_atISO 8601 dateYesNoアクセスレベルが最後に購入された日時。
refunded_atISO 8601 dateNoNo返金された場合、返金日時を表示します。
cancellation_reasonStringNoNoキャンセルの理由として使用可能な値: voluntarily_cancelledbilling_errorprice_increaseproduct_was_not_availablerefundcancelled_by_developernew_subscriptionunknown
variation_idStringNoNo購入がどのペイウォールから行われたかを追跡するために使用するバリエーションID。

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:

パラメータNull許容説明
app_idString:heavy_minus_sign:アプリの内部IDです。Adapty ダッシュボードの App Settings -> General tab で確認できます。
profile_idUUID:heavy_minus_sign:Adapty プロファイルID。Adapty ダッシュボードの Adapty ID フィールド -> Profiles -> 各プロファイルページで確認できます。
customer_user_idString:heavy_plus_sign:お使いのシステムにおけるユーザーIDです。Adapty ダッシュボードの Customer user ID フィールド -> Profiles -> 各プロファイルページで確認できます。モバイルアプリのコードで Adapty SDK を使ってユーザーを識別している場合にのみ機能します。
total_revenue_usdFloat:heavy_minus_sign:そのプロファイルで獲得した USD 建て総収益を表す浮動小数点数の値です。
segment_hashString:heavy_minus_sign:内部パラメータです。
timestampInteger:heavy_minus_sign:レスポンス時間(ミリ秒)。競合状態の解決に使用します。
custom_attributesArray:heavy_minus_sign:

プロファイルに設定できるカスタム属性は最大30件です。custom_attributes 配列を指定する場合は、少なくとも1つの属性キーを含める必要があります。

キー: 30文字以内の文字列である必要があります。使用できるのは英字、数字、ダッシュ、ピリオド、アンダースコアのみです。

値: 属性値は30文字以内である必要があります。値として使用できるのは文字列と浮動小数点数のみです。ブール値は浮動小数点数に変換されます。属性を削除するには空の値または null を送信してください。

access_levelsArray:heavy_plus_sign:アクセスレベル オブジェクトの配列です。ユーザーがアクセスレベルを持たない場合は null になることがあります。
subscriptionsArray:heavy_plus_sign:サブスクリプション オブジェクトの配列です。ユーザーがサブスクリプションを持たない場合は null になることがあります。
non_subscriptionsArray:heavy_plus_sign:Non-Subscription オブジェクトの配列です。ユーザーが購入履歴を持たない場合は null になることがあります。

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_idStringYes

The product ID in app stores.

If access was granted without a real store transaction, vendor_product_id will be one of:

  • adapty_server_side_product — granted via the server-side API.
  • adapty_dashboard_productgranted manually in the Adapty Dashboard.
  • adapty_promotion — legacy.
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:

パラメータ必須Null許容説明
purchase_typeStringYesNo購入したプロダクトの種別。指定可能な値: subscription
storeStringYesNoプロダクトを購入したストア。app_storeplay_storestripe、またはカスタムストアのストアIDを指定します。
environmentStringNoNoトランザクションが発生した環境。Sandbox または Production を指定します。デフォルトは Production です。
store_product_idStringYesNoこのアクセスレベルをアンロックしたアプリストア(App Store、Google Play、Stripeなど)上のプロダクトID。
store_transaction_idStringYesNoアプリストア(App Store、Google Play、Stripeなど)上のトランザクションID。
store_original_transaction_idStringYesNo

サブスクリプションの場合、このIDは更新チェーン内の最初のトランザクションに紐づきます。各更新はこのオリジナルトランザクションと連結されます。

更新がない場合、store_original_transaction_idstore_transaction_id と同じ値になります。

offerObjectNoYes購入に使用されたオファー。Offer オブジェクトとして指定します。
is_family_sharedBooleanNoNoApp Store Connectでプロダクトがファミリー共有をサポートしているかどうかを示すBoolean値。iOSのみ対応。iOS 14.0未満およびmacOS 11.0未満では常に false。デフォルトは false です。
priceObjectYesNoサブスクリプションまたは購入の価格。Price オブジェクトとして指定します。コストがゼロの初回サブスクリプション購入は無料トライアル、コストがゼロの更新は無料更新となります。
purchased_atISO 8601 dateYesNo直近のアクセスレベル購入日時。
refunded_atISO 8601 dateNoNoサブスクリプションが返金された日時(該当する場合)。
cancellation_reasonStringNoNoキャンセル理由として指定可能な値: voluntarily_cancelledbilling_errorprice_increaseproduct_was_not_availablerefundupgraded、または unknown
variation_idStringNoNo購入がどのペイウォールから行われたかを追跡するためのバリエーションID。
originally_purchased_atISO 8601 dateYesNoサブスクリプションチェーンの場合、store_original_transaction_id に紐づくオリジナルトランザクションの購入日時。
expires_atISO 8601 dateYesNoアクセスレベルの有効期限日時。過去の日時になることもあり、永続アクセスの場合は null になります。
renew_statusBooleanYesNoサブスクリプションの自動更新が有効かどうかを示します。
renew_status_changed_atISO 8601 dateNoNo自動更新が有効化または無効化された日時。
billing_issue_detected_atISO 8601 dateNoNo請求上の問題(カード決済の失敗など)が検出された日時。サブスクリプション自体はまだ有効な場合があります。決済が完了するとクリアされます。
grace_period_expires_atISO 8601 dateNoNoサブスクリプションが現在グレース期間中の場合、その終了日時。

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.