Lemonsqueezy

Learn how to use Lemonsqueezy with Supersaas

Setting up Lemonsqueezy

  1. Make sure to have a Stripe account before you start. You can create a free account here.
  2. Create a new stripe store/account and get your API keys from the dashboard - https://app.lemonsqueezy.com/settings/api
  3. Head back to your editor and add the following keys to your .env file
.env
LEMONSQUEEZY_API_KEY=123123
LEMONSQUEEZY_STORE_ID=324234
LEMONSQUEEZY_WEBHOOK_SECRET=456456456456

Create products

You need to create products in Lemonsqueezy before you can use them in with supersaas.

Lemonsqueezy products

  1. Head over to https://app.lemonsqueezy.com/products and create a new product.
  2. Enter the name of the product, set the price, and add a description.
  3. Set the "Repeat payment every" option to monthly or yearly (or whatever you prefer).
  4. If you want to provide a Yearly plan, then create two variants for the product. One for the yearly plan and one for the monthly plan.

Lemonsqueezy product details

Webhook

A Lemonsqueezy webhook will be triggered when a payment is made. We will need to set up a webhook in stripe to handle payment subscriptions. So let's create a webhook endpoint in Lemonsqueezy dashboard https://app.lemonsqueezy.com/settings/webhooks.

  1. Head over to https://app.lemonsqueezy.com/settings/webhooks and create a new webhook.
  2. Set the URL to your https://your-domain.com/api/payment/webhook/lemonsqueezy
  3. Choose the below events
    • subscription_created
    • subscription_updated
    • subscription_cancelled
    • subscription_expired
    • subscription_resumed
  4. Enter a webhook secret (32 characters) and click on save.
  5. Click on save.