Paddle
SaaSBold comes with Paddle integration to manage subscriptions. This part of the documentation will show you how to integrate Paddle into your SaaS boilerplate.
Overview
Paddle provides a comprehensive solution for handling subscriptions and payments in your SaaS application. This guide will walk you through the steps to set up Paddle, including creating products, generating required tokens, and configuring webhooks.
Note: If you want to use another payment provider option for integration, skip this step. Instead, follow the LemonSqueezy guide or Stripe guide to integrate subscriptions.
Steps to Integrate Paddle
To integrate Paddle, you need a Paddle account. For testing purposes, you can create a Sandbox account. When you are done testing, replace the credentials with the live account's credentials.
Create Product
To begin integrating Paddle, you need to create a product:
Login to Paddle: Log in to your Paddle account.
Navigate to Catalog: Go to
Catalog
->Products
, and click on the "New Product" button and add the products.
Once you have created a product, you will see the product like this:
Set Pricing: After creating the product, click the "View" button. Then click on the "New Price" button and add pricing details.
Copy Price ID: Once you are done, your product page should look like this.
Copy Price ID: Copy the price_id, update the pricingData.ts file, and update the unit_amount to your price.
Get The Seller ID
You need the Seller ID to enable checkout on the boilerplate.
Find Seller ID: To find the Seller ID, Log in to your account, click on the three dots, and you will see the Seller ID there.
Update Environment Variable: Go ahead and copy the Seller ID and update your environment variable:
Generate Client Token
Now, we need a client-side token for authentication:
Generate Token: Navigate to Developer Tools
-> Authentication
-> Generate client-side-token
. Generate a Client-side token if you donβt have one.
Copy Token: Copy the generated token and update your environment variable:
API Key
Now, we need the API token to perform API requests with the Paddle API.
Generate API Key: Go to Developer Tools
-> Authentication
-> API Keys
and generate a key.
Copy API Key: Copy the API key and update your environment variable:
Webhook Integration
Now that we have all the keys, letβs integrate Webhook to save the subscription data on the Database.
Add Webhook: Navigate to Developer Tools
-> Notifications
, and click on the "New Destination" button.
Webhook Details: Provide a short description and add the Webhook URL, which is:
Select Events: Finally, select the events, for now, you can select all. You can disable the one you donβt need later. Once you are done, click on the Edit Destination button. You will see a Secret Key there.
Copy Secret Key: After saving, copy the Secret Key and update your environment variable:
Paddle API URL
Finally, we need the Paddle API URL.
Paddle provides separate APIs for live and sandbox ( for Testing) environments.
Tips
Testing: Always test your integration thoroughly in the sandbox environment before switching to the live environment.
Documentation: Refer to Paddleβs official documentation for detailed guidance and troubleshooting.
Security: Ensure all API keys and secrets are stored securely and not exposed.
Event Selection: Carefully select the webhook events relevant to your application to avoid unnecessary data processing.
Summary
By following these steps, you will have integrated Paddle into your SaaSBold boilerplate, enabling robust subscription management. Test the integration thoroughly using the sandbox environment before moving to the live environment.
Last updated