> ## Documentation Index
> Fetch the complete documentation index at: https://docs.corrily.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Paywall

> Fetch Corrily Paywall content including Paywall design config, Plans to display, currency & price for each Plan by providing country, IP/user_id and other characteristics.

## Body Params

<ParamField body="user_id" type="string">
  Optional. If you know user's id, you can pass it to stick the response to that user.
</ParamField>

<ParamField body="country" type="string">
  A two-letter (Alpha-2) [ISO 3166 country
  code](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes#Current_ISO_3166_country_codes).
  Example: `US`
</ParamField>

<ParamField body="paywall_id" type="string">
  Optional. If you want to apply a specific paywall, you can pass it's id.
</ParamField>

<ParamField body="coupons" type="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"}`
</ParamField>

<ParamField body="override_currency" type="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.
</ParamField>

<ParamField body="features" type="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](../users/02_user-features). Example: `{"platform": "ios"}`
</ParamField>

<ParamField body="run_experiment" type="boolean">
  If set to false, will make sure no experiment is run.
</ParamField>

<ParamField body="currency" type="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.
</ParamField>

## Usage

Paywall API is used by Corrily SDK libraries (e.g. [@corrily/react-sdk](/basics/00_introduction)) 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](/api-reference/calculate-price) 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

<ResponseField name="success" type="boolean">
  Whether or not the request completed successfully.
</ResponseField>

<ResponseField name="pricing_page" type="object">
  <Expandable title="pricing_page">
    <ResponseField name="id" type="integer">
      Id of the paywall
    </ResponseField>

    <ResponseField name="is_default" type="boolean">
      Is it a default paywall or not
    </ResponseField>

    <ResponseField name="buttons_caption" type="string">
      Default buttons' caption
    </ResponseField>

    <ResponseField name="buttons_color" type="string">
      Default buttons' color
    </ResponseField>

    <ResponseField name="background_color" type="string">
      Background color
    </ResponseField>

    <ResponseField name="collapse_features" type="boolean">
      Should similar features in products be collapsed or not
    </ResponseField>

    <ResponseField name="show_product_description" type="boolean">
      Show product description
    </ResponseField>

    <ResponseField name="header" type="string">
      Header text abore the paywall
    </ResponseField>

    <ResponseField name="description" type="string">
      Text between title and paywall
    </ResponseField>

    <ResponseField name="show_header" type="boolean">
      Show header with description or not
    </ResponseField>

    <ResponseField name="show_annual_discount_percentage" type="boolean">
      Show annual discount percentage number near a monthly/annual switcher
    </ResponseField>

    <ResponseField name="show_feature_comparison_table" type="boolean">
      Show feature comparison table below a paywall
    </ResponseField>

    <ResponseField name="feature_comparison_table_text" type="string">
      Text on the button for showing feature comparison table
    </ResponseField>

    <ResponseField name="features_badges" type="object">
      An object, where:
      key - feature api id
      value - badge title
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="products" type="object[]">
  <Expandable title="product">
    <ResponseField name="id" type="integer">
      Id of the product
    </ResponseField>

    <ResponseField name="api_id" type="string">
      Text unique id between organization's products
    </ResponseField>

    <ResponseField name="name" type="string">
      Name of the product
    </ResponseField>

    <ResponseField name="interval" type="enum">
      "month" or "year"
    </ResponseField>

    <ResponseField name="interval_count" type="integer">
      The period between payments
    </ResponseField>

    <ResponseField name="cents" type="boolean">
      Optional
    </ResponseField>

    <ResponseField name="recurrent_horizon" type="string">
      Optional
    </ResponseField>

    <ResponseField name="group" type="integer">
      Optional
    </ResponseField>

    <ResponseField name="price" type="string">
      Optional
    </ResponseField>

    <ResponseField name="price_usd" type="string">
      Optional
    </ResponseField>

    <ResponseField name="trial" type="object">
      Optional

      <Expandable title="trial">
        <ResponseField name="id" type="integer">
          Id of the trial
        </ResponseField>

        <ResponseField name="trial_days" type="integer">
          Number of days provided by a trial
        </ResponseField>

        <ResponseField name="trial_type" type="string">
          Type of the trial
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="product_metadata" type="object">
      Optional

      <Expandable title="product_metadata">
        <ResponseField name="description" type="string">
          Description override for a product in a paywall
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="features" type="object[]">
      Optional

      <Expandable title="feature">
        <ResponseField name="id" type="integer">
          Id of the feature
        </ResponseField>

        <ResponseField name="api_id" type="string">
          Text id of the feature
        </ResponseField>

        <ResponseField name="type" type="enum">
          Feature type: "numeric", "boolean"
        </ResponseField>

        <ResponseField name="name" type="string">
          Feature's name
        </ResponseField>

        <ResponseField name="value" type="integer">
          Optional. Value exists only for numeric features
        </ResponseField>

        <ResponseField name="value_id" type="integer">
          Id of the feature value
        </ResponseField>

        <ResponseField name="unit" type="string">
          Title for the unit
          Optional
        </ResponseField>

        <ResponseField name="description" type="string">
          Feature description
        </ResponseField>

        <ResponseField name="status" type="string">
          Feature status: "draft", "active"
        </ResponseField>

        <ResponseField name="feature_group" type="object">
          Feature status: "draft", "active"

          <Expandable title="feature_group">
            <ResponseField name="id" type="integer">
              Feature group id
            </ResponseField>

            <ResponseField name="name" type="string">
              Feature group name
            </ResponseField>
          </Expandable>
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="overrides" type="object">
      Optional. Object with additional override info for a product

      <ResponseField name="button_caption" type="string">
        Optional. Override for a button caption of the product
      </ResponseField>

      <ResponseField name="button_color" type="string">
        Optional. Override for a button color of the product
      </ResponseField>

      <ResponseField name="description" type="string">
        Optional. Override for a description of the product
      </ResponseField>

      <ResponseField name="badge" type="string">
        Optional. Override for a badge of the product
      </ResponseField>

      <ResponseField name="card_color" type="string">
        Optional. Override for a color of the product card
      </ResponseField>

      <ResponseField name="button_url" type="string">
        Optional. Url for a redirect on click the product's button
      </ResponseField>

      <ResponseField name="price_is_hidden" type="string">
        Optional. Flag: is product's price hidden, or not
      </ResponseField>

      <ResponseField name="price_override_text" type="string">
        Optional. Override for a product's price
      </ResponseField>
    </ResponseField>
  </Expandable>
</ResponseField>
