Payments Setup
PacBoiler uses LemonSqueezy for processing payments and managing subscriptions.
1. Create Store & Products
- Log in to LemonSqueezy.
- Go to Store > Products.
- Create a new product (e.g., "Pro Plan").
- Set it as a Subscription.
- Set the price.
- Create another product for "Enterprise Plan" if needed.
2. Get API Keys
- Go to Settings > API.
- Create a new API Key.
- Copy the key and paste it into
.env.local:
LEMONSQUEEZY_API_KEY=your_api_key- Go to Settings > Stores.
- Copy your Store ID and paste it into
.env.local:
LEMONSQUEEZY_STORE_ID=your_store_id3. Configure Variants
To link your code to the specific products, you need the Variant IDs.
- Go to your Products list.
- Click on the "Pro Plan" product.
- In the URL, you will see the product ID. However, we need the Variant ID.
- The easiest way to find this is to go to the Checkout preview for the product.
- In the URL of the checkout page, look for
?cart=.... - Alternatively, use the LemonSqueezy API to list variants.
- Paste the Variant IDs into
.env.local:
LEMONSQUEEZY_PRO_VARIANT_ID=your_pro_variant_id
LEMONSQUEEZY_ENTERPRISE_VARIANT_ID=your_enterprise_variant_id4. Setup Webhooks
Webhooks allow LemonSqueezy to notify your app when a payment succeeds or a subscription is cancelled.
- Go to Settings > Webhooks.
- Click Create Webhook.
- 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).
- Note: For local development, use ngrok to get a public URL (e.g.,
- Signing Secret: Create a random string (e.g.,
my-secret-123). - Events: Select all
SubscriptionandOrderevents. - Click Save Webhook.
- Paste the Signing Secret into
.env.local:
LEMONSQUEEZY_WEBHOOK_SECRET=your_signing_secretNext Steps
Finally, let's configure transactional emails.