API Reference

Calculate price

Calculate a localized or optimized price for your service or product based on the customer's location and other characteristics.

Log in to see full request history

Usage

The first time that you call this endpoint for a given IP address and user ID, Corrily calculates the price. On subsequent calls (with the same IP address and user ID), Corrily returns the original calculated price.

See Calculate price API examples for examples of how this endpoint is commonly used.

Price localization

If you're only using Corrily for price localization (i.e. you are not doing price optimization), this is the endpoint that you call in order to get localized prices.

Price optimization

If you're also doing price optimization, this is the endpoint you call to get optimized prices.

As explained in Price optimization overview, Corrily either returns an experimental price or a control price which will be used to benchmark the experimental prices.

Experimental prices are affected by the following factors:

  • The (potential) customer's location, which is inferred from their IP address
  • Any user characteristics that you have provided
  • The outcomes of previous price experiments
  • The upper and lower bounds that you defined in the Corrily Dashboard

Response

See Calculate price response.

Body Params
string

A User ID. Only required if no ip is provided and get_ip_from_request is false.

products
array of strings
required

The product IDs that you want to calculate prices for. In general, you probably want to include the product IDs for all the product offerings that you intend to show your visitor. The response from Corrily will contain the display price for each product. For example, if you provide ["monthly", "annual"], Corrily returns price data for your monthly and annual products. Product IDs are created by Corrily when you set up your Corrily account. Email support@corrily.com if you don't know yours.

products*
string

An IPv4 or IPv6 address. Corrily uses this as the user ID if no user_id is provided. ip is only required if no user_id is provided and get_ip_from_request is false. Examples: 187.106.3.73 (IPv4), 2804:14d:ac91:8286:efcb:851f:b59f:fffc (IPv6).

boolean

If true, Corrily sources the user's IP from this request. get_ip_from_request therefore only works correctly when the Corrily API request is made from a client device.

string

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

integrations
array of strings

The payment gateways to return integration objects for. Accepted values: stripe, paypal, chargebee

integrations
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.

boolean

Will override any previously saved values for a user and instead return a new price.

boolean

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

Headers
string
required

Your organization's API key.

Language
Click Try It! to start a request and see the response here!