Web API objects

Offer object

This object contains details about the applied offer.

{
  "category": "no_offer",
  "type": "free_trial",
  "id": "Offer Name"
}

Properties

NameTypeRequiredDescription
categoryStringYesCategory of the applied offer. Possible values: introductory, promotional, winback.
typeStringYesType of the applied offer. Possible values: free_trial, pay_as_you_go, pay_up_front.
IdStringYesThe Offer name of the applied offer as specified in the Products section of the Adapty Dashboard.

Paywall object

Đối tượng chứa thông tin về một paywall.

Thuộc tính

TênKiểuBắt buộcMô tả
placement_idString:heavy_plus_sign:ID của Placement nơi paywall này được hiển thị. Giá trị này được đặt khi tạo placement trong Adapty Dashboard của bạn.
variation_idString(uuid):heavy_plus_sign:ID biến thể dùng để theo dõi các giao dịch mua liên kết với paywall cụ thể này.
paywall_idString(uuid):heavy_plus_sign:Mã định danh duy nhất của paywall.
ab_test_nameString:heavy_minus_sign:Tên của A/B test cha.
paywall_nameString:heavy_plus_sign:Tên của paywall, như đã được định nghĩa trong Adapty Dashboard của bạn.
productsArray of objects:heavy_plus_sign:Mảng các đối tượng Products chứa thông tin sản phẩm cho paywall.
remote_configJSON:heavy_minus_sign:Đối tượng RemoteConfig ở định dạng JSON chứa toàn bộ remote config của paywall.

Ví dụ

{
  "placement_id": "PaywallPlacementId",
  "variation_id": "00000000-0000-0000-0000-000000000000",
  "paywall_id": "InternalPaywallId",
  "ab_test_name": "Existing Offer | Improved Offer",
  "paywall_name": "Used Paywall",
  "products": [
    {
      "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"
      }
    }
  ],
  "remote_config": {
    "lang": "en",
    "data": "RemoteConfigObject"
  }
}

Products object

This object contains details about a product in Adapty.

Properties

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.

Example

{
  "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 object

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

Properties

NameTypeRequiredDescription
langString:heavy_plus_sign:

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.

dataString:heavy_plus_sign:Serialized 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.