Quickstart on Web
Get started in 30 minutes.
Get an API key and product ID(s)
If you want to quickly try out the Corrily API, you can use the following demo API key and product IDs:
- API key:
b82fd0fa-2a1b-4226-b6c0-22884ae97f84
- Product IDs:
monthly
annual
See Setup to learn how to create your own API key and product ID(s).
Notify Corrily of payment gateway events
You don’t need to integrate Corrily with your payment gateway(s) right now. You’ll need to do this before deploying Corrily to production, however.
As explained in Price optimization overview, Corrily needs to be notified of subscription and charge events. The easiest way is through OAuth and just requires 2 clicks. After access is granted, your payment gateway automatically notifies Corrily of subscription and charge events. Otherwise you can manually notify Corrily.
If you’re using Stripe and would like to get your Corrily integration started now, click the Connect with Stripe button to grant Corrily read-only access to your Stripe subscription and charge events.
Calculate a price
Run the following code samples to try out Corrily’s calculate price REST API endpoint. This is the endpoint that you call if you want to localize or optimize your prices; it handles both use cases. See Calculate price response for an explanation of the response object’s fields. The first time that you call the endpoint, it calculates a price for the user ID and IP address you specified. On subsequent calls (assuming that you pass in the same user ID and IP address as before) Corrily returns the same price data from the first call.
Note that the demo API key (api_key
) and product IDs (products
) are hardcoded into the code samples below.
An easy way to run the JavaScript code samples
A tip for anyone who is not familiar with frontend programming but would still like to try out the JavaScript code samples below: your browser’s console is essentially a REPL.
Another easy way to try out the API
Go to the calculate price reference page, enter the required fields, then click Try It.
Create a price based on the client’s IP address
In this first code sample, the get_ip_from_request
field instructs Corrily to infer the user’s location from their IP address.
Create a price based on a country code
In this next example, the country
field instructs Corrily to return a price in the specified country’s currency.
Next steps
- Set up your own API key and product ID(s)
- Read the Price optimization overview to understand how Corrily’s price optimization works
- Read the Pricing page integration guide to learn how to integrate Corrily’s API into your pricing page
- Read the Payment gateway integration guide to learn how to send custom prices to your payment gateway and notify Corrily of subscription and charge events
- Try out the sample app and browse its source code
- Note: the sample app manually notifies Corrily of subscription and charge events which requires more code than the recommended OAuth approach