refVenuerefVenue
Docs
Lemon Squeezy Integration

Lemon Squeezy Integration

Track Lemon Squeezy orders, subscription renewals, and refunds automatically

Lemon Squeezy Integration

Connect Lemon Squeezy and refVenue tracks orders, subscription renewals, and refunds automatically.

Already using Lemon Squeezy's built-in affiliate hub? Use one or the other for a given program — running both against the same traffic would double-pay affiliates. refVenue is the right choice when you want one program spanning multiple payment providers (e.g. Stripe + Lemon Squeezy), coupon-based attribution, or advanced fraud checks.

1. Create a webhook in Lemon Squeezy

  1. In Lemon Squeezy, go to Settings → Webhooks and create a webhook.
  2. Set the URL to the one shown on your refVenue Integration page: https://your-refvenue-domain/api/lemonsqueezy/webhook?program_id=YOUR_PROGRAM_ID
  3. Choose a signing secret and subscribe to:
    • order_created
    • order_refunded
    • subscription_payment_success
    • subscription_payment_refunded

2. Save the signing secret in refVenue

On the Integration page, open the Lemon Squeezy card and paste the signing secret. That's the whole connection — Lemon Squeezy includes the customer email in webhook payloads, so no API key is needed.

Append the visitor's referral ID to your checkout links as custom data:

const referralId = window.refvenue.getReferralId();
const checkoutUrl = referralId
  ? `${baseCheckoutUrl}?checkout[custom][refvenue_referral_id]=${referralId}`
  : baseCheckoutUrl;

Or, if you create checkouts via the Lemon Squeezy API, set checkout_data.custom.refvenue_referral_id.

Without the referral ID, refVenue falls back to matching the order's customer email against tracked signups (case-insensitive).

What gets tracked

Lemon Squeezy eventrefVenue action
order_createdCreates a PENDING commission on the net amount (post-discount, pre-tax)
subscription_payment_success (renewals)Recurring commission when enabled — the initial charge is covered by order_created
order_refunded / subscription_payment_refundedMarks the conversion refunded and reverses the commission

Duplicate webhook deliveries are handled automatically. Discount-code attribution isn't available from Lemon Squeezy webhooks — use the referral ID or email attribution.