Connect Lemon Squeezy

Send your Lemon Squeezy orders, renewals and refunds to Clakta over a webhook, and credit each sale to the visitor who made it.

Connecting Lemon Squeezy sends every sale, renewal and refund to Clakta as it happens. That is the first half of measuring Lemon Squeezy performance; the second is carrying the visitor's session into the checkout, so each sale is credited to the traffic that produced it.

Both halves are covered below, and the second one is automatic if you already install the tracking script.

Connect

  1. Go to Project settings → Sales platforms.
  2. Choose Lemon Squeezy, name the connection, and click Create connection. Clakta generates a webhook URL — copy it.
  3. In Lemon Squeezy, go to Settings → Webhooks and click +.
  4. Paste the URL, choose a signing secret between 6 and 40 characters, and select the four events in the table below.
  5. Back in Clakta, paste the same signing secret and click Finish.

The card reads Added once the secret is saved.

Events to select

EventWhat it does in Clakta
order_createdRecords the sale.
order_refundedMarks the order refunded.
subscription_payment_successRecords each subscription renewal.
subscription_payment_refundedMarks a refunded renewal.

Selecting extra events is harmless: anything Clakta does not handle is acknowledged and ignored.

Attribute sales to visitors

Lemon Squeezy checkouts happen on Lemon Squeezy's own domain, so the visitor's session has to travel with them. It rides in a checkout[custom] value that Lemon Squeezy stores against the order and returns on the webhook.

If you link to a checkout from a page running the Clakta script, this is automatic. When a visitor clicks a link to *.lemonsqueezy.com/checkout/buy/… or /buy/…, the script appends the session for you. Lemon.js overlay buttons are covered too.

If you create checkouts through the Lemon Squeezy API, pass it yourself. This is the most reliable option, because it never depends on the browser:

If you open overlays yourself, decorate the URL first:

Privacy-friendly projects

Projects in privacy-friendly mode have no client-side session id to send, so Lemon Squeezy sales are recorded but not linked to a visitor. If you need attribution there, report the sale from your thank-you page instead — set the Lemon Squeezy button link to include ?order_id=[order_identifier] and call clakta.purchase({ orderId }) with that value. Use [order_identifier], the UUID, not [order_id]: the UUID is the id Clakta records the order under.

What gets recorded

  • Revenue, in the order's own currency. If Clakta does not support that currency, the amount is kept and your project currency applies.
  • Customer name and email, unless the project is privacy-friendly.
  • Products — the first line of the order.
  • Status, and the date the sale was approved.
  • Attribution — the session, plus the click token and UTMs when the checkout carried them.

The payment method reads Other for one-off sales — Lemon Squeezy is the merchant of record and does not report one. Renewals show the card that was charged.

Refunds and chargebacks

A full refund marks the order refunded. A partial refund leaves it paid, because Clakta records a sale as one amount and flipping the whole order would erase revenue you actually kept.

Lemon Squeezy absorbs chargebacks on your behalf and refunds the buyer, so a chargeback reaches Clakta as a refund rather than as a dispute.

Disconnect

Remove the connection from Project settings → Sales platforms. Deliveries stop being accepted immediately. Orders already recorded stay where they are — disconnecting never deletes history.

Delete the webhook in Lemon Squeezy too, so it stops retrying against an endpoint that no longer exists.

Troubleshooting

Related articles