This guide walks you through how we created the Corrily sample app in Node.js. The sample app demonstrates how to:

  • Use Corrily’s Calculate price API to present optimal prices to visitors based on their location
  • Charge custom subscription prices in Stripe Checkout
  • Notify Corrily of subscription and invoice events so that it can determine if the prices that it’s presenting to your users are optimal

Here’s a live demo of the sample app and the full source code. The recipe at the bottom of this page provides a step-by-step walkthrough of how the sample app’s code works.

Set up your Stripe account

Here is how we set up our Stripe account when creating the demo:

  1. Sign up for a Stripe account.
  2. Log in to the Stripe Dashboard.
  3. Open the Products page of the Stripe Dashboard.
  4. Click Add product.
  5. Enter Corrily for the product’s Name.
  6. Under Price information set Price to 10.
  7. Keep the default values for the rest of the fields (Pricing model: Standard pricing, Recurring, Billing period: Monthly, Usage is metered: disabled).
  8. Scroll to the bottom of the page and click Add another price.
  9. Set Price to 100 (USD).
  10. Set Billing period to Yearly.
  11. Leave the rest of the values the same as before.
  12. Click Save product. Stripe takes you to the Overview page for your new product.
  13. Under the Details section note your product ID. It should look similar to this: prod_XXXXXXXXXX
  14. Under the Pricing section note your API ID values. You should have one for your monthly pricing option and another one for your yearly pricing option. They should look like this: price_XXXXXXXXXX

Set up your Corrily account

See Setup.