Mattering Automations Lemon Squeezy integration
Connect Lemon Squeezy to Mattering Automations: orders with refunds, the subscription lifecycle, usage-based billing, license keys, checkouts, and webhooks as workflow steps, authenticated with a Lemon Squeezy API key.
The Mattering Automations Lemon Squeezy integration adds Lemon Squeezy to your automation canvas: read stores, products, variants, and prices, manage customers, list orders and issue refunds, run the full subscription lifecycle including pause, resume, and cancel, report usage-based billing, manage discount codes and license keys, create checkout links, and register webhooks.
Setup takes a few minutes: create an API key in the Lemon Squeezy dashboard under Settings > API, attach it as a credential in Mattering, and test the connection. This guide walks through each step and ends with the full node reference.
The money model deserves attention before anything runs. Lemon Squeezy: Refund Order and Lemon Squeezy: Refund Subscription Invoice move real money and cannot be reversed, and the subscription nodes change real billing. The safe path is built in: keys are created in live mode or test mode, and a test mode key exercises the entire surface, refunds included, against test data on the same URL.
Before you start
- A Lemon Squeezy account with a store. New stores start in test mode, which is exactly where a first integration should run; selling live requires store activation, but testing does not.
- Access to the store dashboard to create an API key under Settings > API.
- A Mattering workspace with access to the Automations app.
- For live money flows such as refunds: a live mode API key and an activated store. Everything can and should be rehearsed with a test mode key first.
Create a Lemon Squeezy API key
Mattering authenticates to Lemon Squeezy with an API key, sent as a bearer credential on every request. Keys are created in live mode or test mode: a test mode key sees and creates only test data against the same API URL, which makes it the right first credential. The three License API nodes are the one exception to bearer auth, because on those calls the license key itself is the credential.
Connect Lemon Squeezy to Mattering
Verify it works
After connecting, open any automation canvas and check the palette: a Lemon Squeezy section should list the query and action nodes. Drop Lemon Squeezy: Get Authenticated User onto the canvas and run a test step. It takes no parameters and is a safe, read-only call; a successful response returns your user record at data.data.attributes (the integration keeps Lemon Squeezy's JSON:API response shape as-is, so outputs match their documentation) and data.meta.test_mode tells you whether the key is live or test. Follow it with Lemon Squeezy: List Stores to collect the store ids the create nodes need.
To rehearse the rest of the surface, stay on a test mode key. Complete a test checkout with the documented card number 4242 4242 4242 4242 to mint a test order, subscription, and license key, then run anything against them, including Lemon Squeezy: Refund Order and Lemon Squeezy: Refund Subscription Invoice: on a test mode key they refund test money only, so even the destructive set verifies end to end without a cent moving.
Node reference
38 nodes, generated from the connector itself so this reference always matches what ships.
Read and query nodes 19
Lemon Squeezy: Get Authenticated User
lemon_squeezy_get_user
Retrieve the user the API key belongs to. Needs no parameters, so this is also the credential health check, and data.meta.test_mode tells you whether the key is a live mode or test mode key.
Lemon Squeezy: Get Checkout
lemon_squeezy_get_checkout
Retrieve a checkout by its UUID (checkout IDs are UUIDs, not integers), including its live URL, price and prefill configuration, and expiry.
Lemon Squeezy: Get Customer
lemon_squeezy_get_customer
Retrieve one customer by ID, including lifetime revenue, MRR, marketing status, and the signed customer portal URL.
Lemon Squeezy: Get License Key
lemon_squeezy_get_license_key
Retrieve one license key by its numeric ID (also returned in License API responses as license_key.id): full key string, status, activation limit and usage, expiry.
Lemon Squeezy: Get Order
lemon_squeezy_get_order
Retrieve one order by ID, including totals, tax, refund state (refunded, refunded_amount), first_order_item, and the signed receipt URL.
Lemon Squeezy: Get Subscription
lemon_squeezy_get_subscription
Retrieve one subscription by ID: status, pause state, cancelled flag, billing anchor, renews_at / ends_at, first_subscription_item (whose id feeds the quantity and usage nodes), and signed customer portal URLs.
Lemon Squeezy: Get Subscription Item Current Usage
lemon_squeezy_get_subscription_item_usage
Retrieve the reported usage total for a usage-based subscription item in the current billing period, with the period start and end. Returns 404 if the item is not usage-based. Pairs with Create Usage Record to verify what will be billed.
Lemon Squeezy: List Customers
lemon_squeezy_list_customers
List customers with revenue and MRR figures, filtered by store or exact email. The email filter is the standard look-up-a-customer step in automation flows.
Lemon Squeezy: List Discounts
lemon_squeezy_list_discounts
List discount codes with amount, type, duration, limits, and status, optionally filtered to one store. List responses return full discount objects, so no separate get is needed.
Lemon Squeezy: List License Keys
lemon_squeezy_list_license_keys
List license keys generated by orders, filtered by store, order, order item, product, or status (inactive, active, expired, disabled). Includes the full key string, activation limits, and instance counts.
Lemon Squeezy: List Orders
lemon_squeezy_list_orders
List orders, newest first, filtered by store, customer email, or order number. Totals are integer cents with formatted twins; each order carries first_order_item and a signed receipt URL.
Lemon Squeezy: List Prices
lemon_squeezy_list_prices
List price objects (the billing truth behind variants: unit price in cents, pricing scheme, usage aggregation, tiers, setup fees, renewal and trial intervals), optionally filtered to one variant. Price IDs appear on subscription items.
Lemon Squeezy: List Products
lemon_squeezy_list_products
List products, ordered by name, optionally filtered to one store. Each product carries price display fields and its hosted buy_now_url. List responses return full product objects, so no separate get is needed.
Lemon Squeezy: List Stores
lemon_squeezy_list_stores
List all stores this API key can see, with revenue and sales stats per store. Store IDs from here feed the create nodes (customer, discount, checkout, webhook).
Lemon Squeezy: List Subscription Invoices
lemon_squeezy_list_subscription_invoices
List subscription invoices (the billing history of subscriptions), newest first, filtered by store, status (pending, paid, void, refunded, partially_refunded), refunded flag, or subscription. Invoice IDs feed the refund and generate-invoice nodes; list responses return full invoice objects.
Lemon Squeezy: List Subscriptions
lemon_squeezy_list_subscriptions
List subscriptions, newest first, filtered by store, order, product, variant, customer email, or status (on_trial, active, paused, past_due, unpaid, cancelled, expired). Each carries renews_at, ends_at, pause state, and signed customer portal URLs.
Lemon Squeezy: List Usage Records
lemon_squeezy_list_usage_records
List reported usage records, newest first, optionally filtered to one subscription item. The audit trail for usage-based billing.
Lemon Squeezy: List Variants
lemon_squeezy_list_variants
List variants (the purchasable versions of a product, including subscription billing interval and license key settings), optionally filtered by product or status. Variant IDs from here feed Create Checkout and the subscription plan-change node.
Lemon Squeezy: List Webhooks
lemon_squeezy_list_webhooks
List webhook endpoints with their subscribed events and last_sent_at, optionally filtered to one store. The signing secret is never returned by the API (dashboard only).
Action nodes 19
Lemon Squeezy: Activate License Key
lemon_squeezy_activate_license
Activate a license key, creating a named instance and consuming one activation slot (activation_usage goes up; at the limit, activation fails with activated false and an error message). Reversible: Deactivate License Key frees the slot. Uses the License API: form-encoded, plain JSON response (not JSON:API), no Bearer auth needed because the license key itself is the credential. 60 requests per minute.
Lemon Squeezy: Cancel Subscription
lemon_squeezy_cancel_subscription
ENDS REAL RECURRING REVENUE: cancel a subscription. The honest semantics: the subscription flips to cancelled and enters a grace period until its ends_at date (the end of the paid period), during which it CAN still be resumed via Lemon Squeezy: Update Subscription with cancelled false. After ends_at it expires permanently and the customer must re-subscribe. There is no immediate-termination option on this endpoint.
Lemon Squeezy: Create Checkout
lemon_squeezy_create_checkout
Create a unique checkout URL for a variant, returned at data.data.attributes.url. NOTE WHAT THIS MAKES: with a live mode key the URL is a REAL checkout that accepts real payments from anyone holding the link, including at a custom price. Prefill customer details and custom data, override product name and price (custom_price in cents, also used for renewals on subscriptions), style the page, and set expires_at so programmatic links do not live forever. Creating the checkout itself charges nothing.
Lemon Squeezy: Create Customer
lemon_squeezy_create_customer
Create a customer record in a store (name and email; optional location). Reversible: a customer can be archived later via Lemon Squeezy: Update Customer with status archived.
Lemon Squeezy: Create Discount
lemon_squeezy_create_discount
Create a discount code redeemable at checkout: percent or fixed amount, optional redemption cap, validity window, and subscription duration (once, repeating, forever). Reversible in the sense that Delete Discount removes it, though a delete is itself permanent.
Lemon Squeezy: Create Usage Record
lemon_squeezy_create_usage_record
AFFECTS REAL BILLING: report usage against a usage-based subscription item; the reported quantity is what the customer is invoiced for at the end of the billing period. action increment adds to the period's running total (for sum aggregation), action set replaces it (for most-recent aggregation). There is no delete for usage records, so a wrong increment can only be corrected by compensating reports. Verify totals with Get Subscription Item Current Usage.
Lemon Squeezy: Create Webhook
lemon_squeezy_create_webhook
Register a webhook endpoint for store events (e.g. order_created, subscription_created, subscription_updated, subscription_expired, subscription_payment_success, license_key_created). Point it at a Mattering inbound webhook trigger to react to sales in automations. You supply the signing secret; the API never returns it, so keep your own copy. Reversible via Delete Webhook.
Lemon Squeezy: Deactivate License Key
lemon_squeezy_deactivate_license
Deactivate one activation instance of a license key, freeing its activation slot (reversible by activating again). Uses the License API: form-encoded, plain JSON response, no Bearer auth. 60 requests per minute.
Lemon Squeezy: Delete Discount
lemon_squeezy_delete_discount
PERMANENTLY delete a discount code. There is no undo and no unpublish: the code stops working immediately and its redemption history is gone. The discount itself can be recreated from its attributes, but the history cannot. Returns 204 with an empty body on success.
Lemon Squeezy: Delete Webhook
lemon_squeezy_delete_webhook
Delete a webhook endpoint so it stops receiving events. Classed reversible because a webhook is recreatable losslessly (URL, events, and secret are all client-supplied), but the deletion itself has no undo. Returns 204 with an empty body on success.
Lemon Squeezy: Generate Subscription Invoice PDF
lemon_squeezy_generate_subscription_invoice
Generate a customer-addressed invoice PDF for a subscription invoice and get back a signed download URL at data.meta.urls.download_invoice. The address fields go onto the invoice document; nothing about the invoice record itself changes, so this is safe to re-run.
Lemon Squeezy: Refund Order
lemon_squeezy_refund_order
MOVES REAL MONEY: refund an order, sending money back to the customer's payment method. Leave amount empty for a FULL refund; set amount in cents for a partial refund (100 refunds $1.00 on a USD order). A refund cannot be reversed once issued. Returns the order with updated refunded fields. On a test mode key this refunds test money only.
Lemon Squeezy: Refund Subscription Invoice
lemon_squeezy_refund_subscription_invoice
MOVES REAL MONEY: refund a subscription invoice payment, sending money back to the customer's payment method. Leave amount empty for a FULL refund; set amount in cents for a partial refund. A refund cannot be reversed once issued. Returns the invoice with updated refunded fields. On a test mode key this refunds test money only.
Lemon Squeezy: Update Customer
lemon_squeezy_update_customer
Update a customer's profile fields, or archive the customer by setting status to archived (stops marketing emails to them). archived is the only status value the API documents for writes, so treat archiving as one-way from the API side. Profile field edits are freely reversible.
Lemon Squeezy: Update License Key
lemon_squeezy_update_license_key
Change a license key's activation limit, expiry date, or disabled state. All three are reversible: re-enable with disabled false, extend or clear expiry, raise or lower the limit (null via extra_attrs means unlimited activations).
Lemon Squeezy: Update Subscription
lemon_squeezy_update_subscription
CHANGES REAL BILLING: the subscription lifecycle control. Change plan (variant_id; prorated by default, and invoice_immediately true charges the customer NOW), pause payment collection (pause object; unpause by sending pause null via extra_attrs), resume a pending cancellation (cancelled false, before ends_at), move the billing date (billing_anchor day of month; changing it issues a prorated adjustment), or adjust the trial end. PayPal funded subscriptions cannot be modified by the API; the response instead carries a customer portal URL to send the customer to.
Lemon Squeezy: Update Subscription Item Quantity
lemon_squeezy_update_subscription_item
CHANGES REAL BILLING: set the billed unit quantity on a quantity-based subscription (seats, units). Prorated by default at the next renewal; invoice_immediately true charges the prorated difference NOW. Only for quantity-based billing: a usage-based subscription item returns 422 (report usage with Create Usage Record instead). Get the subscription item ID from the subscription's first_subscription_item.id.
Lemon Squeezy: Update Webhook
lemon_squeezy_update_webhook
Change a webhook's destination URL, subscribed events, or signing secret. Any field left empty is kept as-is.
Lemon Squeezy: Validate License Key
lemon_squeezy_validate_license
Check whether a license key (or one specific activation instance of it) is valid, without changing anything. Returns valid true or false with the license key details and related order, product, and customer IDs in meta. Uses the License API: form-encoded, plain JSON response, no Bearer auth. 60 requests per minute.
Using the integration
On the automation canvas
Lemon Squeezy nodes chain with every other node: a scheduled Lemon Squeezy: List Subscriptions sweep filtered to past_due can open tasks in Mattering Productivity before failed payments become churn, license key activations can log rows to a Mattering database, and Lemon Squeezy: Create Checkout can mint a prefilled checkout link mid-workflow. Set expires_at on programmatic checkout links: on a live mode key the URL is a real checkout that accepts real payments from anyone holding it.
From AI assistants over MCP
Every node speaks MCP, the open protocol for connecting AI assistants to tools. Claude, ChatGPT, and Matter can list orders, look up customers with their lifetime revenue and MRR, and read subscription status through the same nodes your workflows use. The list and get nodes are read-only, which makes them the safest Lemon Squeezy surface to hand an agent.
Test mode is the rehearsal space
There is no separate sandbox host: a test mode key sees and creates only test data against the same URL, every object carries a test_mode flag, and documented test cards complete checkouts. That covers the whole surface, both refund nodes included, so a workflow can be proven correct before a live mode key ever touches it. Lemon Squeezy: Get Authenticated User reports the key's mode, so a workflow can even assert it is on test data before running anything destructive.
The subscription lifecycle, grace period included
Lemon Squeezy: Update Subscription changes plans (prorated by default; invoice_immediately charges the customer now), pauses and unpauses payment collection, and moves the billing anchor. Lemon Squeezy: Cancel Subscription flips the subscription to cancelled and starts a grace period until the end of the paid period, during which Lemon Squeezy: Update Subscription with cancelled set to false resumes it with nothing lost; after that it expires permanently. Lemon Squeezy: Update Subscription Item Quantity sets seat counts on quantity-based subscriptions, with the same invoice_immediately behavior.
Usage-based billing, reported and audited
Lemon Squeezy: Create Usage Record reports the quantity a customer will be invoiced for at the end of the billing period: increment adds to the running total, set replaces it. Usage records cannot be deleted, so a wrong report is corrected only by compensating reports. Verify what will be billed with Lemon Squeezy: Get Subscription Item Current Usage and keep Lemon Squeezy: List Usage Records as the audit trail.
Webhooks and license keys
Lemon Squeezy: Create Webhook registers an endpoint for store events such as order_created and subscription_payment_success and can point straight at a Mattering inbound webhook trigger; you supply the signing secret, and the API never returns it, so keep your own copy. For license workflows, Lemon Squeezy: Activate License Key, Lemon Squeezy: Validate License Key, and Lemon Squeezy: Deactivate License Key use the License API, where the license key itself is the credential and the documented limit is 60 requests per minute.
Troubleshooting
Test Connection fails with a 401
Every node worked for months and now returns 401s
Nodes succeed but live orders and customers are missing
A refund needs to be undone
A subscription was cancelled by mistake
A usage record was reported wrong
Lemon Squeezy: Update Subscription returned a customer portal URL instead of applying the change
Lemon Squeezy: Update Subscription Item Quantity returns a 422
Related
The Lemon Squeezy MCP
What connecting Lemon Squeezy unlocks for AI agents and automations, with common uses and FAQs.
More guides
All Automations documentation
Every integration guide, plus how connectors, credentials, and workflows fit together.
Lemon Squeezy is a trademark of its respective owner. Mattering uses platform names to identify the services these integrations connect to; no endorsement or affiliation is implied.