Reference documentation on the object that Corrily returns after you call calculate price.
Fields
Field (Data type) | Data type | Description |
---|---|---|
success | Boolean | Whether or not the request completed successfully. |
user_id | String | The user ID that you provided when you called calculate price, or the user's IP address (if you did not provide a user ID). |
country | String | The country that the price data is associated to. If you did not specify a country when calling calculate price, the country value provided here in the response is inferred from the user's IP address. |
currency | String | The currency that the price data is associated to. Tip: check if products.<id>.display.price meets your needs before manually constructing a display price with this field. |
currency_symbol | String | The currency symbol that the price data is associated to. Tip: check if products.<id>.display.price meets your needs before manually constructing a display price with this field. |
products | Object | The price data for each of the products that you specified when you called calculate price. The placeholder <id> below represents your product ID(s). See Setup to learn how to create product IDs. |
products.<id>.price | Float | A float version of your price, in case you want to do some custom formatting of the price. Tip: check if products.<id>.display.price meets your needs before manually constructing a display price with this field. |
products.<id>.price_usd | Float | The current value of products.<id>.price in United States dollars. |
products.<id>.interval | String | The billing interval of this product. Possible values: day , week , month , year , one_time |
products.<id>.interval_count | Integer | |
products.<id>.display | Object | The price data, formatted in various ways for display to your user. |
products.<id>.display.price | String | The price data, formatted in a way that your user will quickly understand. This is usually a combination of currency , currency_symbol , and products.<id>.price . products.<id>.price will use commas or periods as separators if that is the local custom. Example: JP¥2,200 |
products.<id>.display.reference_interval_price | String | The default price for the product. You can set this default price in your Corrily Dashboard. |
products.<id>.display.price_with_baseline_strike | String | If products.<id>.price is an experimental price, this field contains the baseline price striked out, followed by the experimental price. You may want to present this to your user to help them see that they would be paying less than normal customers. Example: $̶3̶4̶ $19 |
products.<id>.display.discount_to_baseline | Float | If products.<id>.price is an experimental price, this field contains the percentage discount of the experimental price compared to the baseline price. For example, if the baseline price is 34 and the experimental price is 19, the discount is about 44%: 1 - (19 ÷ 34)) × 100 |
products.<id>.integrations | Object | The price data, formatted for payment gateway integration. |
products.<id>.integrations.<gateway>.currency | String | The currency that products.<id>.integrations.<gateway>.amount is priced in. If this currency is not the same as the top-level currency value in this response (the "local currency"), it means that the payment gateway does not accept the local currency. |
products.<id>.integrations.<gateway>.amount | Float or Integer | The amount that you should pass to the payment gateway when creating the subscription or charge. Many payment gateways use smallest-unit currency format in which case this value will be an integer. |
products.<id>.integrations.<gateway>.formatted | String | As mentioned in products.<id>.integrations.<gateway>.currency , sometimes a payment gateway doesn't support your user's local currency. If that's the case, then products.<id>.integrations.<gateway>.formatted provides the equivalent price in a currency that the payment gateway does support. This field is similar to products.<id>.display.price in that it will be formatted in a way that your user will quickly understand. |
products.<id>.coupon | Object | Optionally include coupon details if the given request matches any segment for which an active campaign is running |
products.<id>.coupon.id | String | coupon id |
products.<id>.coupon.type | String | indicates if a coupon is percentage discount coupon or absolute amount discount coupon |
products.<id>.coupon.value | Float | The value or percentage or absolute amount of discount for the coupon |
products.<id>.coupon.coupon_source | String | Indicates the source of the coupon if the coupon maps to an external source |
products.<id>.coupon.external_coupon_id | String | Coupon id from the external source if that coupon maps to an external source |
products.<id>.coupon.currency_code | String | Indicates currency code if it is configured for the coupon |
products.<id>.coupon.valid_till | Datetime in YYYY-MM-DD HH:MM:SS format | Indicates the time the coupon is valid for in UTC |
products.<id>.coupon.display | Object | Same as product level display object but indicates the price related values after the coupon is applied |
variants | Object | Price experimentation metadata. If you are not doing price experimentation, you can ignore this object. |
variants.experimented_on | Boolean | Whether or not this response contains experimental prices. |
Example
{
"success": true,
"user_id": "193.37.32.232",
"country": "SG",
"currency": "SGD",
"currency_symbol": "S$",
"products": {
"monthly": {
"price": 27,
"price_usd": 20.059360849328197,
"interval": "month",
"interval_count": 1,
"display": {
"price": "S$ 27",
"reference_interval_price": "S$ 27",
"price_with_baseline_strike": "S$ 27",
"discount_to_baseline": 0
},
"integrations": {
"stripe": {
"currency": "SGD",
"amount": 2700,
"formatted": "S$ 27"
}
}
},
"annual": {
"price": 144,
"price_usd": 106.98325786308372,
"interval": "year",
"interval_count": 1,
"display": {
"price": "S$ 144",
"reference_interval_price": "S$ 12",
"price_with_baseline_strike": "S$ 12",
"discount_to_baseline": 0
},
"integrations": {
"stripe": {
"currency": "SGD",
"amount": 14400,
"formatted": "S$ 144"
}
},
"coupon":{
"id":"coupon_id_392",
"type":"percentage",
"value":10,
"coupon_source":"chargebee",
"external_coupon_id":"chargebee_coupon_392",
"currency_code":"USD",
"valid_till":"2022-02-07 15:49:49",
"display":{
"local_currency_symbol":"€",
"interval_local_price_formatted":"9 €",
"local_price_formatted":"9 €",
"usd_price_formatted":"$11",
"local_price_formatted_with_baseline_strike":"9 €",
"pct_discount_to_baseline":0.0
}
}
}
},
"variants": {
"experimented_on": true
}
}