Docs menu

Lemon Squeezy

Attribute every Lemon Squeezy payment to the visit that brought it.

Updated 21 Oct 2026

Connect

  1. In Lemon Squeezy, open Settings → Webhooks → add a webhook. You choose the Signing secret there yourself; paste the same value into atrby.
  2. In atrby, open Revenue → Payment processors → Connect, choose Lemon Squeezy and paste the secret.
  3. atrby shows your webhook URL. It looks like https://app.atrby.site/api/webhooks/lemonsqueezy/…. Add it in Lemon Squeezy and send these events: order_created, subscription_created, subscription_payment_success, order_refunded.

The connection shows as active once the first webhook arrives. Webhooks with a wrong signature are rejected.

Pass the visit ids

Where they go: Checkout checkout_data.custom. Lemon Squeezy returns it as meta.custom_data on orders and subscription payments. Read them in the browser with atrby.ids() and send them to your server with the checkout request.

Browser
const ids = window.atrby?.ids(); // { atrby_sid, atrby_site }
Server · Lemon Squeezy checkout
await createCheckout(storeId, variantId, {
  checkoutData: {
    custom: { ...ids, atrby_uid: user.id },
  },
});

// Or on a checkout link:
// https://acme.lemonsqueezy.com/buy/…?checkout[custom][atrby_sid]=…&checkout[custom][atrby_site]=…

atrby_uid is your user id, from identify. It's optional, but it credits payments made long after the first visit.

What gets recorded

  • Each payment once, however often Lemon Squeezy retries the webhook.
  • Full and partial refunds are subtracted from the source of the original order.
  • subscription_payment_success is only used for renewals; the first payment comes from order_created.
Was this helpful?
Ask a question about this page