POST
/
v1
/
paywall
curl --request POST \
  --url https://client.corrily.com/v1/paywall \
  --header 'Content-Type: application/json' \
  --header 'X-Api-Key: <api-key>' \
  --data '{
  "user_id": "<string>",
  "country": "<string>",
  "paywall_id": "<string>",
  "coupons": {},
  "override_currency": true,
  "features": {},
  "run_experiment": true,
  "currency": "<string>"
}'
{
  "success": true,
  "pricing_page": {
    "id": 123,
    "is_default": true,
    "buttons_caption": "<string>",
    "buttons_color": "<string>",
    "background_color": "<string>",
    "collapse_features": true,
    "show_product_description": true,
    "header": "<string>",
    "description": "<string>",
    "show_header": true,
    "show_annual_discount_percentage": true,
    "show_feature_comparison_table": true,
    "feature_comparison_table_text": "<string>",
    "features_badges": {}
  },
  "products": [
    {
      "id": 123,
      "api_id": "<string>",
      "name": "<string>",
      "interval": {},
      "interval_count": 123,
      "cents": true,
      "recurrent_horizon": "<string>",
      "group": 123,
      "price": "<string>",
      "price_usd": "<string>",
      "trial": {
        "id": 123,
        "trial_days": 123,
        "trial_type": "<string>"
      },
      "product_metadata": {
        "description": "<string>"
      },
      "features": [
        {
          "id": 123,
          "api_id": "<string>",
          "type": {},
          "name": "<string>",
          "value": 123,
          "value_id": 123,
          "unit": "<string>",
          "description": "<string>",
          "status": "<string>",
          "feature_group": {
            "id": 123,
            "name": "<string>"
          }
        }
      ],
      "overrides": {
        "button_caption": "<string>",
        "button_color": "<string>",
        "description": "<string>",
        "badge": "<string>",
        "card_color": "<string>",
        "button_url": "<string>",
        "price_is_hidden": "<string>",
        "price_override_text": "<string>"
      }
    }
  ]
}

Body Params

user_id
string

Optional. If you know user’s id, you can pass it to stick the response to that user.

country
string

A two-letter (Alpha-2) ISO 3166 country code. Example: US

paywall_id
string

Optional. If you want to apply a specific paywall, you can pass it’s id.

coupons
object

Optional product id to coupon id mapping to explicitly specify the coupon to be applied in the pricing. Coupons feature needs to be enabled for this. example {"product_id_1": "coupon_id_1"}. Multiple coupons can be applied by a comma-delimited string, for example: {"product_id_1": "coupon_id_1,coupon_id2"}

override_currency
boolean

Will override the currency of any previously saved price and instead return the price in the currency provided. If set to true, a currency param must be passed. Unlike override the price amount will not be recomputed.

features
object

An object containing key-value pairs of arbitrary strings that represent features of this user which may affect their optimal price. See User features. Example: {"platform": "ios"}

run_experiment
boolean

If set to false, will make sure no experiment is run.

currency
string

A currency you wish the price to be tied to. Currencies do not need to match the passed country. For example, it is possible to return a price in EUR for someone based in the Unites Sates. Note that the country-adjusted price will be returned, regardless of the currency set.

Usage

Paywall API is used by Corrily SDK libraries (e.g. @corrily/react-sdk) to fetch Paywall data. This data is enough to render the complete Paywalls on customer’s website or mobile app. Response includes Paywall design configuration, set of Products to display, and price & currency for each Product. The response depends on the user context (country, audience, characteristics) along with currently running experiments.

  • design configuration - contains texts, colorus & layout config for visual customization
  • products - set of products to show on Paywall. It comes from a Package, directly liked to a Paywall, or from a Packaging Segmentation config.
  • prices - the same data, as the /v1/prices API endpoint response. Similarly to /v1/prices logic, once User see a Paywall, he’ll be permanently sticked to the same design, set of plans and prices unless the "override": true parameter will be sent in the API request.

Response

success
boolean

Whether or not the request completed successfully.

pricing_page
object
products
object[]