Description
n8n-nodes-polar
This is an n8n community node for Polar.sh – a modern payment infrastructure platform for SaaS and digital products. Polar is an open-source alternative to Stripe, designed specifically for developers selling software.
n8n is a fair-code licensed workflow automation platform.
Features
- ๐ณ Checkout Management – Create and manage checkout sessions with flexible pricing
- ๐ฆ Product Catalog – Manage products with one-time and recurring pricing models
- ๐ฅ Customer Management – Track and manage your customers with billing addresses
- ๐ช Webhooks – React to payment events in real-time with secure webhook validation
- ๐งช Sandbox Support – Test everything safely before going live
- ๐ Secure Authentication – Built-in webhook signature validation for security
Installation
Community Node (Recommended)
- Go to Settings > Community Nodes
- Select Install
- Enter
n8n-nodes-polarin the package name field - Click Install
Manual Installation
# Navigate to your n8n installation directory
cd ~/.n8n
# Install the node
npm install n8n-nodes-polar
Authentication
- Create a Polar account at polar.sh
- Go to your organization settings
- Navigate to Settings > Access Tokens
- Click Create Token
- Copy the token (you'll only see it once!)
- In n8n, create new Polar credentials:
- Access Token: Your token from step 5
- Environment: Choose between Production or Sandbox
Supported Operations
Products
- Create – Create products with flexible pricing (one-time, recurring, custom, free)
- Get – Retrieve product details by ID
- Get Many – List all your products with pagination and filtering
- Update – Modify product information
- Archive – Archive products you no longer sell
Checkouts
- Create – Generate checkout sessions for customers with pre-filled data
- Get – Retrieve checkout details and status
- Update – Modify checkout parameters before completion
Customers
- Create – Add new customers with billing information
- Get – Retrieve customer information by ID
- Get Many – List all customers with filtering options
- Update – Update customer details and billing addresses
- Delete – Remove customer records
Webhook Trigger
- Listen for real-time events with signature validation:
- Checkout created/updated
- Order created/updated
- Subscription created/updated/canceled
- Customer created/updated
- Benefit granted/revoked
- Product created/updated
Example Workflows
1. Simple Product Checkout Flow
HTTP Request Trigger โ
Polar: Create Product โ
Polar: Create Checkout โ
Send Email with checkout link
2. Complete SaaS Onboarding
Typeform Trigger โ
Polar: Create/Update Customer โ
Polar: Create Checkout โ
Gmail: Send checkout link โ
Polar Webhook: order.created โ
Postgres: Add user to database โ
SendGrid: Send welcome email โ
Slack: Notify team
3. Subscription Management
Polar Webhook: subscription.created โ
Grant access in your app โ
Send welcome email
Polar Webhook: subscription.updated โ
If: Plan changed โ Update user permissions
If: Payment failed โ Send dunning email
Polar Webhook: subscription.canceled โ
Revoke access โ
Send win-back email โ
Update CRM
4. Customer Management
Polar Webhook: customer.created โ
Airtable: Add to customer database โ
Slack: Notify sales team โ
HubSpot: Create contact
Webhook Security
This node implements secure webhook validation using Polar.sh's webhook keys:
- Signature Validation: All webhooks are validated using HMAC-SHA256 signatures
- Automatic Setup: Webhook endpoints are automatically created and cleaned up
- Event Filtering: Only receive events you've subscribed to
- Error Handling: Graceful handling of invalid signatures and malformed requests
Sandbox Testing
Polar provides a sandbox environment for safe testing:
- Set environment to "Sandbox" in credentials
- Use test credit card:
4242 4242 4242 4242 - Any future expiration date and 3-digit CVC
- Webhooks work in sandbox mode for complete testing
Common Use Cases
SaaS Business
- Monthly/annual subscriptions with trials
- One-time payments for lifetime deals
- Tiered pricing with different features
- Usage-based billing for API calls
Digital Products
- One-time purchases for courses/ebooks
- Early access for supporters
- Bundle deals and discounts
- Downloadable content delivery
Open Source Monetization
- GitHub Sponsors alternative
- Private repository access
- Priority support tiers
- Commercial license sales
API Integration Patterns
This node follows n8n's modern routing patterns:
- Automatic Pagination: Get Many operations handle large datasets automatically
- Dynamic URLs: Product and customer IDs are dynamically inserted into API calls
- Request Validation: Input validation happens before API calls
- Error Handling: Comprehensive error handling with detailed messages
Tips & Best Practices
- Use Metadata: Attach metadata to products, checkouts, and customers for easy reconciliation
- External IDs: Use your own user IDs as external_customer_id for linking
- Webhook Validation: Always keep signature validation enabled for security
- Test in Sandbox: Always test payment flows in sandbox before going live
- Amount Handling: Amounts are automatically converted between dollars and cents
Pricing Features
- One-time Payments: Perfect for lifetime deals and single purchases
- Recurring Subscriptions: Monthly and yearly billing cycles
- Custom Pricing: Let customers set their own amount
- Free Products: Useful for trials and lead magnets
- Multiple Currencies: Support for USD, EUR, GBP, CAD, AUD, SEK, NOK, DKK
Resources
Support
- Polar Support: Discord | Email
- Node Issues: GitHub Issues
- n8n Community: Forum
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License – see the LICENSE file for details.
Acknowledgments
- Thanks to the Polar team for building an amazing platform
- Thanks to the n8n community for the excellent automation platform
- Built with โค๏ธ for the developer community
โก Webhook Setup (Polar Trigger)
The Polar Trigger node handles webhook events from Polar.sh using the Standard Webhooks specification. Webhooks are automatically created and managed via the Polar.sh API.
Automatic Webhook Configuration
-
Add webhook secret to credentials:
- Go to your Polar dashboard: https://polar.sh/dashboard
- Navigate to: Settings โ Webhooks
- Create a webhook (or use an existing one)
- Copy the webhook secret
- Add the webhook secret to your Polar webhook node in n8n
-
Configure the trigger node:
- Create a Polar Trigger node in your n8n workflow
- Select the events you want to listen to
- Choose your Polar API credentials (with webhook secret)
- Activate the workflow
-
Webhook is automatically created:
- n8n will automatically create a webhook in your Polar dashboard
- The webhook URL will be generated automatically
- Selected events will be subscribed
- When you deactivate the workflow, the webhook is automatically deleted
Webhook Events
The Polar Trigger supports these webhook events:
benefit_grant.created– When a benefit is grantedbenefit_grant.revoked– When a benefit is revokedcheckout.created– When a checkout session is createdcheckout.updated– When a checkout session is updatedcustomer.created– When a customer is createdcustomer.updated– When a customer is updatedorder.created– When an order is createdorder.updated– When an order is updatedproduct.created– When a product is createdproduct.updated– When a product is updatedsubscription.canceled– When a subscription is canceledsubscription.created– When a subscription is createdsubscription.updated– When a subscription is updated
Security Features
Webhooks are validated using the Standard Webhooks specification:
- Signature validation: Uses HMAC-SHA256 with your webhook secret
- Timestamp validation: Prevents replay attacks (configurable tolerance)
- Required headers:
webhook-id,webhook-timestamp,webhook-signature - Event filtering: Only subscribed events are processed
Configuration Options
- Validate Signature: Toggle webhook signature validation (enabled by default)
- Timestamp Tolerance: Configure how many seconds tolerance for timestamp validation (default: 300 seconds)