Description
n8n-nodes-lemonsqueezy




An n8n community node for Lemon Squeezy – a platform for selling digital products, subscriptions, and software licenses.
Features
- 20 Resources, 80+ Operations – Full CRUD for Products, Variants, Checkouts, and all Lemon Squeezy resources
- Dynamic Dropdowns – Store, Product, Variant, and Discount fields load options from your account automatically
- Webhook Trigger – Real-time events for orders, subscriptions, and license keys (19 event types) with mandatory HMAC-SHA256 signature verification
- Output Simplification – One toggle flattens nested JSON:API responses into clean key-value objects, with automatic relationship flattening
- Security Hardened – Hex-validated webhook signatures, replay attack protection, SSRF-blocking URL validation, RFC 5322 email validation
- Batch & Bulk Operations – Get Many by ID (orders, customers, subscriptions), bulk discount creation, bulk license key activate/deactivate
- Store Analytics – Revenue by product, churn rate, LTV, and subscription health metrics
- 378 Tests – Comprehensive test coverage at 80%+
Installation
Community Nodes (Recommended)
1. Go to Settings > Community Nodes in your n8n instance
2. Select Install
3. Enter n8n-nodes-lemonsqueezy
4. Click Install
npm
npm install n8n-nodes-lemonsqueezy
Credentials
To use this node, you need a Lemon Squeezy API key:
1. Log in to your Lemon Squeezy Dashboard
2. Go to Settings → API
3. Click Create API Key
4. Copy the generated key and use it in n8n
Nodes
Lemon Squeezy
The main node for interacting with the Lemon Squeezy API.
#### Resources & Operations
| Resource | Operations |
|———-|————|
| Affiliate | Get, Get Many |
| Checkout | Create, Delete, Get, Get Many, Update |
| Customer | Create, Update, Archive, Get, Get Many, Get Many by ID, Lookup by Email, Upsert |
| Discount | Create, Bulk Create, Delete, Get, Get Many |
| Discount Redemption | Get, Get Many |
| File | Download, Get, Get Many |
| License Key | Get, Get Many, Update, Validate, Activate, Deactivate, Bulk Activate, Bulk Deactivate |
| License Key Instance | Deactivate, Get, Get Many |
| Order | Get, Get Many, Get Many by ID, Refund, Generate Invoice |
| Order Item | Get, Get Many |
| Price | Get, Get Many |
| Product | Create, Delete, Get, Get Many, Update |
| Store | Get, Get Many, Get Revenue Summary, Get Analytics |
| Subscription | Get, Get Many, Get Many by ID, Update, Cancel, Pause, Resume |
| Subscription Invoice | Delete, Generate, Get, Get Many, Refund |
| Subscription Item | Get, Get Many, Update, Get Current Usage |
| Usage Record | Create, Get, Get Many |
| User | Get Current |
| Variant | Create, Delete, Get, Get Many, Update |
| Webhook | Create, Update, Delete, Get, Get Many |
Lemon Squeezy Trigger
Webhook trigger node for receiving real-time events.
#### Supported Events
order_created – New order placedorder_refunded – Order refundedsubscription_created – New subscription startedsubscription_updated – Subscription modifiedsubscription_cancelled – Subscription cancelledsubscription_resumed – Paused subscription resumedsubscription_paused – Subscription pausedsubscription_unpaused – Paused subscription unpausedsubscription_expired – Subscription expiredsubscriptionpaymentsuccess – Subscription payment succeededsubscriptionpaymentfailed – Subscription payment failedsubscriptionpaymentrecovered – Failed payment recoveredsubscriptionpaymentrefunded – Subscription payment refundedlicensekeycreated – License key generatedlicensekeyupdated – License key modifiedaffiliate_activated – Affiliate activatedorder_updated – Order updatedsubscriptionplanchanged – Subscription plan/variant changedlicensekeyexpired – License key expiredExample Workflows
1. New Order Notification to Slack
Lemon Squeezy Trigger (order_created) → Slack (Send Message)
Notify your team instantly when a new order comes in.
2. Subscription Churn Prevention
Schedule Trigger → Lemon Squeezy (Get Subscriptions, status=past_due) → Send Email
Automatically reach out to customers with failed payments.
3. License Key Validation API
Webhook → Lemon Squeezy (Validate License Key) → Respond to Webhook
Build a license validation endpoint for your software.
4. Dynamic Checkout Link Generation
HTTP Request → Lemon Squeezy (Create Checkout) → Return Checkout URL
Create personalized checkout links with pre-filled customer data.
5. Customer Sync to CRM
Lemon Squeezy Trigger (order_created) → Lemon Squeezy (Get Customer) → HubSpot (Create Contact)
Automatically sync new customers to your CRM.
6. Product Catalog Sync
Schedule Trigger → Lemon Squeezy (Get Many Products, status=published) → Google Sheets (Update Rows)
Keep an external product catalog in sync with your published Lemon Squeezy products.
Filtering
Most “Get Many” operations support filtering:
| Filter | Description | Available On |
|——–|————-|————–|
| storeId | Filter by store | All resources |
| status | Filter by status (includes partial_refund for Orders and Subscription Invoices) | Orders, Subscriptions, Customers, License Keys, Subscription Invoices, Products, Variants, Discounts |
| email | Filter by email | Orders, Customers |
| order_number | Filter by order number | Orders |
| orderitemid | Filter by order item | Subscriptions, License Keys |
| productId | Filter by product | Subscriptions, License Keys, Variants, Order Items |
| variantId | Filter by variant | Subscriptions, Checkouts, Order Items |
| orderId | Filter by order | Subscriptions, License Keys, Order Items, Discount Redemptions |
| subscriptionId | Filter by subscription | Subscription Invoices |
| licenseKeyId | Filter by license key | License Key Instances |
| discountId | Filter by discount | Discount Redemptions |
Advanced Options
“Get Many” operations support advanced query options for sorting and including related resources.
Sorting
Sort results by any of the following fields:
| Sort Field | Description |
|————|————-|
| created_at | Sort by creation date |
| updated_at | Sort by last update date |
Choose ascending or descending order.
Relationship Expansion
Include related resources in a single request to reduce API calls:
| Resource | Available Relationships |
|———-|————————|
| Order | store, customer, order-items, subscriptions, license-keys, discount-redemptions |
| Subscription | store, customer, order, order-item, product, variant, subscription-invoices, subscription-items |
| Customer | store, orders, subscriptions, license-keys |
| License Key | store, customer, order, order-item, product, license-key-instances |
| Product | store, variants |
| Variant | product, files |
| Checkout | store, variant |
| Discount | store, discount-redemptions |
Example: When fetching orders, include customer and order-items to get all related data in one request.
Automatic Flattening: When Simplify Output is enabled (default), included resources are automatically flattened into each item. Instead of a separate included array, you get store: { id, name, ... } directly on the order object.
Security
Webhook Security
The webhook trigger includes built-in security features:
Max Event Age (Minutes) option (0 to disable)Input Validation
– localhost, 127.0.0.1, 0.0.0.0
– Private ranges: 10.x.x.x, 172.16-31.x.x, 192.168.x.x
– Link-local: 169.254.x.x (AWS metadata endpoint)
– Only allows http:// and https:// protocols
Error Handling
The node includes built-in error handling with detailed messages:
Error Code Reference
| Status Code | Description |
|————-|————-|
| 400 | Bad Request – Invalid or malformed request |
| 401 | Unauthorized – Invalid or missing API key |
| 403 | Forbidden – No permission to access resource |
| 404 | Not Found – Resource does not exist |
| 409 | Conflict – Resource already exists |
| 422 | Unprocessable Entity – Invalid request data |
| 429 | Rate Limited – Too many requests |
| 500+ | Server Error – Something went wrong on the server |
Troubleshooting
“Invalid API Key” Error
1. Verify your API key is correct in the credentials
2. Check if the API key has been revoked in Lemon Squeezy
3. Ensure the key has appropriate permissions
“Resource Not Found” (404) Error
1. Verify the resource ID is correct
2. Check if the resource exists in Lemon Squeezy
3. Ensure you’re using the correct resource type
Webhook Not Receiving Events
1. Verify the webhook URL is publicly accessible
2. Check if your n8n instance has HTTPS enabled
3. Verify the webhook secret matches
4. Check the webhook events are enabled in Lemon Squeezy
Rate Limiting Issues
If you encounter rate limiting (429 errors):
1. Configure n8n’s workflow error handling to retry on failure
2. Reduce the frequency of API calls
3. Use “Return All” sparingly for large datasets
4. Consider caching responses where appropriate
5. Space out bulk operations using the Wait node
Validation Errors
If you receive validation errors:
1. Check email fields contain valid email addresses
2. Verify URLs are complete (including https://)
3. Ensure dates are in ISO 8601 format (e.g., 2024-01-15T10:30:00Z)
Development
Install dependencies
npm installBuild the node
npm run buildWatch mode (rebuild on changes)
npm run devRun tests
npm testRun tests in watch mode
npm run test:watchRun tests with coverage
npm run test:coverageRun linter
npm run lintRun linter with auto-fix
npm run lintfixCheck formatting
npm run format:checkFormat code
npm run formatType check
npm run typecheck
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
1. Fork the repository
2. Create your feature branch (git checkout -b feature/amazing-feature)
3. Commit your changes (git commit -m 'Add some amazing feature')
4. Push to the branch (git push origin feature/amazing-feature)
5. Open a Pull Request
Resources
Changelog
v2.0.0
New Operations:
New Filters:
Security:
timingSafeEqual — rejects malformed signatures without cryptographic comparison.validateHexString utility in validation.tsTests: 378 total (+34 new)
v1.0.0
New Features:
orderupdated, subscriptionplanchanged, licensekey_expired (19 total)Security:
Refactored:
helpers.ts and LemonSqueezy.node.ts into focused modules (validation.ts, api.ts, handlers.ts)v0.15.0
New Features:
store: { id, name } directly on order)Bug Fixes:
Lookup by Email operation not appearing in dropdownDownload operation not appearing in dropdownv0.14.0
New Features:
Improvements:
v0.13.0
New Features:
download operation on the File resource returns file binary data, ready for email attachments, S3 uploads, or any binary-aware downstream node.v0.12.0
Critical Fixes:
archivedid field in JSON:API body for partial refundsid field in JSON:API body for partial refundsNew Features:
trialendsat field to Subscription Update for extending/shortening trial periodsorder_number filter to Order Get Manyorderitemid filter to Subscription Get Many and License Key Get Manypartial_refund status filter to Subscription Invoice and Order status filterstermsprivacycolor and subscription_preview display options to Checkout Createislimitedto_products and variant IDs to Discount Create for product-scoped discountssubscription-invoices and subscription-items relationships to Subscription includesImprovements:
maxValue: 100 to all resource limit fields for consistencybuildJsonApiBody to support array relationshipsFixes:
status filter from Product resource (API only supports store_id)v0.11.0
New Features:
Changes:
Fixes:
v0.10.0
New Features:
Security:
Improvements:
v0.9.0
New Features:
Improvements:
v0.8.0
New Features:
Improvements:
v0.7.2
n8n Community Package Compliance:
requestWithAuthentication with httpRequestWithAuthenticationv0.7.0
New Features:
Security:
Bug Fixes:
v0.6.0
Reliability & Error Handling:
Input Validation:
Performance:
Code Quality:
v0.5.0
Security & Stability Improvements:
[::1]) for complete SSRF protectionNew Features:
Code Quality:
Documentation:
Test Coverage:
v0.4.0
getCurrent operation)v0.3.0
v0.2.0
License
—
Made with 🍋 by Jan Marc Coloma