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
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.
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.
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, theget_ip_from_request
field instructs Corrily to infer the user’s location from their IP address.
JavaScript
Create a price based on a country code
In this next example, thecountry
field instructs Corrily to return a price in the specified country’s currency.
JavaScript
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