Beta. The Lemon Squeezy connector is built and tested against Lemon Squeezy's documented, signed webhook events. It has not yet run against a live Lemon Squeezy store in production. Try it in test mode first.
Lemon Squeezy
Connect Lemon Squeezy (a developer-friendly merchant of record) so its orders and subscription payments reach your CashSDK revenue and entitlements.
Lemon Squeezy is a merchant of record built for developers and indie makers: subscriptions and one-off sales with almost no setup. Like other MoRs, it sells your product and handles global tax, so you never touch a VAT return. Connect it to CashSDK and its orders and subscription payments sit beside your in-app purchases, while each subscription's status grants and ends the entitlements your apps check.
Lemon Squeezy is a good fit for solo developers and small teams. CashSDK reads orders, subscription payments, refunds and subscription status. License keys are not mapped to entitlements.
How it works#
Connect Lemon Squeezy from your app's Marketplace page with an API key and the webhook signing secret.
Each product variant ID matches a CashSDK product and the entitlement it unlocks.
One-time orders and subscription payments become revenue, refunds come back out, and a subscription's status changes grant and end access.
Connect Lemon Squeezy#
In Lemon Squeezy, go to Settings → API and create an API key. Copy it.
In the dashboard, open your app's Marketplace page, choose Lemon Squeezy and select Connect. Pick Sandbox while you build in Lemon Squeezy's Test mode, or Production for live sales, and paste the key. Leave the signing secret empty for now. Credentials are stored encrypted at rest.
Copy the connection's webhook URL from the Connected list and add it in
Lemon Squeezy under Settings → Webhooks. Set a signing secret there and
select these events: order_created, order_refunded,
subscription_created, subscription_updated, subscription_cancelled,
subscription_resumed, subscription_expired, subscription_paused,
subscription_unpaused, subscription_payment_success and
subscription_payment_refunded.
Back in CashSDK, select Reconnect, enter the API key and the same signing secret, then select Activate. A connection without a signing secret cannot be activated.
Map your catalog#
Lemon Squeezy events name the product variant. Payments for variants your app
does not sell are skipped, so for each variant create a
product in CashSDK whose identifier is the variant ID and
attach the entitlement it unlocks. To point a variant at an
existing product instead, map it with map_marketplace_catalog
(prompt setup).
- A one-time order unlocks a non-consumable product for good.
- A subscription grants access while Lemon Squeezy reports it
on_trial,active,past_dueorpaused. A cancelled subscription keeps access until its paid period ends, and an expired one ends it. - A refund comes off your revenue, a partial refund only by its amount. A refund of the whole payment also ends the access that payment gave.
Who gets access#
Pass your app user ID as cashsdk_user_id in the checkout's custom data. CashSDK
reads it from the subscription events and remembers it for that subscription, so
its payments land on the same user. Without it, and for one-time orders, the
customer's email address stands in for the user. Link it to the right user with
the link_marketplace_user tool on the MCP server.
Test and go live#
With a Sandbox connection and Lemon Squeezy's Test mode on, complete a checkout with a test card. Confirm the purchase appears under Transactions and the entitlement is granted to your test user. Test-mode events are always recorded as Sandbox.
Turn test mode off and add a Production connection with your live API key, its own webhook and signing secret. Your CashSDK publishable key does not change.