Payments Setup

Configure LemonSqueezy for subscriptions and payments.

Payments Setup

PacBoiler uses LemonSqueezy for processing payments and managing subscriptions.

1. Create Store & Products

  1. Log in to LemonSqueezy.
  2. Go to Store > Products.
  3. Create a new product (e.g., "Pro Plan").
    • Set it as a Subscription.
    • Set the price.
  4. Create another product for "Enterprise Plan" if needed.

2. Get API Keys

  1. Go to Settings > API.
  2. Create a new API Key.
  3. Copy the key and paste it into .env.local:
LEMONSQUEEZY_API_KEY=your_api_key
  1. Go to Settings > Stores.
  2. Copy your Store ID and paste it into .env.local:
LEMONSQUEEZY_STORE_ID=your_store_id

3. Configure Variants

To link your code to the specific products, you need the Variant IDs.

  1. Go to your Products list.
  2. Click on the "Pro Plan" product.
  3. In the URL, you will see the product ID. However, we need the Variant ID.
  4. The easiest way to find this is to go to the Checkout preview for the product.
  5. In the URL of the checkout page, look for ?cart=....
  6. Alternatively, use the LemonSqueezy API to list variants.
  7. Paste the Variant IDs into .env.local:
LEMONSQUEEZY_PRO_VARIANT_ID=your_pro_variant_id
LEMONSQUEEZY_ENTERPRISE_VARIANT_ID=your_enterprise_variant_id

4. Setup Webhooks

Webhooks allow LemonSqueezy to notify your app when a payment succeeds or a subscription is cancelled.

  1. Go to Settings > Webhooks.
  2. Click Create Webhook.
  3. Callback URL: https://your-app.com/api/webhooks/lemonsqueezy
    • Note: For local development, use ngrok to get a public URL (e.g., https://xyz.ngrok.io/api/webhooks/lemonsqueezy).
  4. Signing Secret: Create a random string (e.g., my-secret-123).
  5. Events: Select all Subscription and Order events.
  6. Click Save Webhook.
  7. Paste the Signing Secret into .env.local:
LEMONSQUEEZY_WEBHOOK_SECRET=your_signing_secret

Next Steps

Finally, let's configure transactional emails.

Step 4: Email Setup