Last updated 15 hours ago

Price Optimization

Continuously optimizing prices to match demand can boost revenues by 30%. Corrily automates this process through its LivePrice API allowing you to run tests across your prices until optimal ones are found.

Regardless of your business constraints, LivePrice is flexible enough to accommodate different forms of price optimization. Use cases include:

  • Cosmetic localization: begin displaying and charging visitors in their local currency
  • Fixed Market localization: adjust prices across markets using fixed adjustments (such as a country's purchasing power)
  • Optimal Market localization: adjust prices across markets by running price optimization tests

Implement price optimization with Corrily

Corrily makes it easy to run price optimization tests by wrapping itself around your existing prices and adjusting them to discover optimal ones.

Integrating with Corrily simply requires sending to the API a user's identifier and country or ip (if you want the price to be localized to them), as well as a list of product ids and their base prices. An ip address is also exchangeable with user identifiers in case you allow sales to anonymous customers.

For code samples in most languages you can check the API doc.

Call structure

user_id
string

Unique user identifier (required if ip is not specified)

ip
string

User IP address (required if country, user_id, or get_ip_from_request is not specified)

country
string

User two-letter country code (ISO 3166 alpha-2; required if ip is not specified)

ab
boolean

If set to true will enfore the ab flag. (If the ab flag is on the base price in the base currency, usually USD, will be returned.)

dev
boolean

Turn developement mode on/off. When set to false nothing will be stored by Corrily.

get_ip_from_request
boolean

For front-end calls, allows you to get the IP of the user from their request.

required
Array of objects (Product)

A list of product objects

Response structure

flag
string

An "AB" flag is returned if Corrily just returns the base price, if empty "", Corrily returns the locally-adjusted amount denominated in the local currency.

price
required
number

Price

price_monthly
number

Monthly price

local_price
required
number

Local price (in the user's local currency)

local_price_monthly
number

Local monthly price (in the user's local currency)

local_currency
required
string

Local currency code (ISO 4217)

local_currency_symbol
required
string

Local currency symbol (e.g. $, £, ...)

local_price_formatted
required
string

The local price, numerically formatted and with the symbol added (e.g. £500.00)

local_price_formatted_monthly
string

The local monthly price, numerically formatted and with the symbol added (e.g. £500.00)

stripe_amount
boolean

Amount in Stripe's format.

stripe_amount_monthly
boolean

Amount monthly in Stripe's format.

succeeded
required
boolean

Whether price prediction succeeded

Display prices

You first need to call the API to grab the price to display the user.

Example, unidentified user:

import requests

item_prices = {"a": 12., "b": 20.} # Assuming this is a dict of your items with prices in $
ip_user = "83.205.82.236"

api_url = "https://app.corrily.com/v1/prices/get"
payload = {
    "ip": "185.35.50.4",
    "products": [{"product_id": item_id} for item_id, item_price in item_prices.items()]
}

headers = {
  "Content-Type": "application/json",
  "X-API-KEY": "YOUR_API_KEY_HERE"
}
response = requests.post(url, json=payload, headers=headers)

data = response.json()

# local_price_formatted contains the product, formatted locally.
# Therefore, '$15' would become '13€', or '¥1,600'
prices_to_display = {product_id: product["local_price_formatted"] for product_id, product in data["products"].items()}

For an identified user, the payload would change to the following:

payload = {
    "user_id": user_id,
    "country": "gb",
    "products": [{"product_id": item_id} for item_id, item_price in item_prices.items()]
}

We can help!

If you have any issue with the integration, you can contact us directly at stripe@corrily.com. We can help you get set up easily and send you code snippets.

Copyright © Corrily 2020. All right reserved.