Get 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>"
}
'import requests
url = "https://client.corrily.com/v1/paywall"
payload = {
"user_id": "<string>",
"country": "<string>",
"paywall_id": "<string>",
"coupons": {},
"override_currency": True,
"features": {},
"run_experiment": True,
"currency": "<string>"
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
user_id: '<string>',
country: '<string>',
paywall_id: '<string>',
coupons: {},
override_currency: true,
features: {},
run_experiment: true,
currency: '<string>'
})
};
fetch('https://client.corrily.com/v1/paywall', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://client.corrily.com/v1/paywall",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'user_id' => '<string>',
'country' => '<string>',
'paywall_id' => '<string>',
'coupons' => [
],
'override_currency' => true,
'features' => [
],
'run_experiment' => true,
'currency' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://client.corrily.com/v1/paywall"
payload := strings.NewReader("{\n \"user_id\": \"<string>\",\n \"country\": \"<string>\",\n \"paywall_id\": \"<string>\",\n \"coupons\": {},\n \"override_currency\": true,\n \"features\": {},\n \"run_experiment\": true,\n \"currency\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://client.corrily.com/v1/paywall")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"user_id\": \"<string>\",\n \"country\": \"<string>\",\n \"paywall_id\": \"<string>\",\n \"coupons\": {},\n \"override_currency\": true,\n \"features\": {},\n \"run_experiment\": true,\n \"currency\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://client.corrily.com/v1/paywall")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_id\": \"<string>\",\n \"country\": \"<string>\",\n \"paywall_id\": \"<string>\",\n \"coupons\": {},\n \"override_currency\": true,\n \"features\": {},\n \"run_experiment\": true,\n \"currency\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"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>"
}
}
]
}Paywall
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.
POST
/
v1
/
paywall
Get 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>"
}
'import requests
url = "https://client.corrily.com/v1/paywall"
payload = {
"user_id": "<string>",
"country": "<string>",
"paywall_id": "<string>",
"coupons": {},
"override_currency": True,
"features": {},
"run_experiment": True,
"currency": "<string>"
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
user_id: '<string>',
country: '<string>',
paywall_id: '<string>',
coupons: {},
override_currency: true,
features: {},
run_experiment: true,
currency: '<string>'
})
};
fetch('https://client.corrily.com/v1/paywall', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://client.corrily.com/v1/paywall",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'user_id' => '<string>',
'country' => '<string>',
'paywall_id' => '<string>',
'coupons' => [
],
'override_currency' => true,
'features' => [
],
'run_experiment' => true,
'currency' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://client.corrily.com/v1/paywall"
payload := strings.NewReader("{\n \"user_id\": \"<string>\",\n \"country\": \"<string>\",\n \"paywall_id\": \"<string>\",\n \"coupons\": {},\n \"override_currency\": true,\n \"features\": {},\n \"run_experiment\": true,\n \"currency\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://client.corrily.com/v1/paywall")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"user_id\": \"<string>\",\n \"country\": \"<string>\",\n \"paywall_id\": \"<string>\",\n \"coupons\": {},\n \"override_currency\": true,\n \"features\": {},\n \"run_experiment\": true,\n \"currency\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://client.corrily.com/v1/paywall")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_id\": \"<string>\",\n \"country\": \"<string>\",\n \"paywall_id\": \"<string>\",\n \"coupons\": {},\n \"override_currency\": true,\n \"features\": {},\n \"run_experiment\": true,\n \"currency\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"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
string
Optional. If you know user’s id, you can pass it to stick the response to that user.
string
A two-letter (Alpha-2) ISO 3166 country
code.
Example:
USstring
Optional. If you want to apply a specific paywall, you can pass it’s id.
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"}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.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"}boolean
If set to false, will make sure no experiment is run.
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 customizationproducts- 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/pricesAPI endpoint response. Similarly to/v1/priceslogic, once User see a Paywall, he’ll be permanently sticked to the same design, set of plans and prices unless the"override": trueparameter will be sent in the API request.
Response
boolean
Whether or not the request completed successfully.
object
Show pricing_page
Show pricing_page
integer
Id of the paywall
boolean
Is it a default paywall or not
string
Default buttons’ caption
string
Default buttons’ color
string
Background color
boolean
Should similar features in products be collapsed or not
boolean
Show product description
string
Header text abore the paywall
string
Text between title and paywall
boolean
Show header with description or not
boolean
Show annual discount percentage number near a monthly/annual switcher
boolean
Show feature comparison table below a paywall
string
Text on the button for showing feature comparison table
object
An object, where:
key - feature api id
value - badge title
object[]
Show product
Show product
integer
Id of the product
string
Text unique id between organization’s products
string
Name of the product
enum
“month” or “year”
integer
The period between payments
boolean
Optional
string
Optional
integer
Optional
string
Optional
string
Optional
object
object[]
Optional
Show feature
Show feature
integer
Id of the feature
string
Text id of the feature
enum
Feature type: “numeric”, “boolean”
string
Feature’s name
integer
Optional. Value exists only for numeric features
integer
Id of the feature value
string
Title for the unit
Optional
string
Feature description
string
Feature status: “draft”, “active”
object
Optional. Object with additional override info for a product
string
Optional. Override for a button caption of the product
string
Optional. Override for a button color of the product
string
Optional. Override for a description of the product
string
Optional. Override for a badge of the product
string
Optional. Override for a color of the product card
string
Optional. Url for a redirect on click the product’s button
string
Optional. Flag: is product’s price hidden, or not
string
Optional. Override for a product’s price