NOTICE · Lemon Squeezy stops processing payments March 31, 2027— days left
migratefromlemonsqueezy

Lemon Squeezy webhooks: event mapping and signature code for every destination

Updated November 2026 · Lemon Squeezy stops processing payments March 31, 2027

Lemon SqueezyStripePaddlePolarDodo PaymentsCreem
order_createdcheckout.session.completedtransaction.completedorder.paidpayment.succeededcheckout.completed
subscription_createdcustomer.subscription.createdsubscription.createdsubscription.createdsubscription.activesubscription.active
subscription_updatedcustomer.subscription.updatedsubscription.updatedsubscription.updatedsubscription.plan_changed / subscription.updatedsubscription.update
subscription_payment_successinvoice.paidtransaction.completed (with subscription_id)order.paid (billing_reason: subscription_cycle)subscription.renewedsubscription.paid
subscription_cancelledcustomer.subscription.deletedsubscription.canceledsubscription.canceledsubscription.cancelledsubscription.canceled
license_key_creatednone: issue keys from your own servicenone: issue keys from your own servicebenefit_grant.createdlicense_key.createdcheckout.completed (license key in payload)

Your app's access logic almost certainly runs on Lemon Squeezy webhooks. A purchase fires order_created, you grant access. A subscription lapses, subscription_expired fires, you take it away. When you migrate, every one of those handlers has to be rewritten for a different event name, a different payload shape and a different signature scheme.

The table above shows the closest equivalent for each core event. Below are the patterns that make the rewrite safe, and signature verification code for each provider.

Event names and payloads change. Treat this as a starting map and check against the provider's current docs before shipping.

How Lemon Squeezy webhooks work (what you're replacing)

  • One URL receives all events. The event name is in meta.event_name.
  • Your custom checkout data comes back in meta.custom_data. Most apps put their own user_id there.
  • The signature is an HMAC-SHA256 hex digest of the raw body using your signing secret, sent in the X-Signature header.
import crypto from "node:crypto";

function verifyLemonSqueezy(rawBody, signature, secret) {
  const digest = crypto.createHmac("sha256", secret).update(rawBody).digest("hex");
  return crypto.timingSafeEqual(Buffer.from(digest), Buffer.from(signature || ""));
}

Rule 1: carry your own user ID through checkout

Whatever you used custom_data.user_id for on Lemon Squeezy, make sure the new checkout carries the same thing: Stripe metadata or client_reference_id, Paddle custom_data, Polar metadata or external_customer_id, Dodo metadata, Creem metadata. If the webhook can't tell you which of your users paid, nothing else works.

Rule 2: store entitlements in your own database

Don't ask "what does the provider say?" on every request. Keep a table like:

user_id plan status provider provider_subscription_id current_period_end

Both the old and new provider's webhooks write to it. Your app only reads it. This lets you run two providers at once during cutover, which you need to.

Rule 3: make handlers idempotent

Every provider retries webhooks. Store each event ID you process and skip duplicates. Make "grant access" and "revoke access" safe to run twice.

Rule 4: run both during cutover

For a few weeks you'll have customers on both providers. Keep the Lemon Squeezy handler running. A user is active if either provider says so. Remove the old handler only after the last legacy subscription is gone.

Signature verification by provider

Stripe

import Stripe from "stripe";
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY);

// rawBody must be the exact bytes Stripe sent, not re-serialised JSON
const event = stripe.webhooks.constructEvent(rawBody, req.headers["stripe-signature"], process.env.STRIPE_WEBHOOK_SECRET);

Paddle

Paddle sends Paddle-Signature: ts=...;h1=.... The signature is HMAC-SHA256 of ts + ":" + rawBody. The official SDK does this for you:

import { Paddle } from "@paddle/paddle-node-sdk";
const paddle = new Paddle(process.env.PADDLE_API_KEY);

const event = await paddle.webhooks.unmarshal(rawBody, process.env.PADDLE_WEBHOOK_SECRET, req.headers["paddle-signature"]);

Polar

Polar follows the Standard Webhooks spec (webhook-id, webhook-timestamp, webhook-signature headers). Use their SDK helper:

import { validateEvent } from "@polar-sh/sdk/webhooks";

const event = validateEvent(rawBody, req.headers, process.env.POLAR_WEBHOOK_SECRET);

Dodo Payments

Dodo also uses Standard Webhooks headers. Verify with the standardwebhooks library:

import { Webhook } from "standardwebhooks";
const wh = new Webhook(process.env.DODO_WEBHOOK_SECRET);

const event = wh.verify(rawBody, {
  "webhook-id": req.headers["webhook-id"],
  "webhook-timestamp": req.headers["webhook-timestamp"],
  "webhook-signature": req.headers["webhook-signature"],
});

Creem

Creem signs the raw body with HMAC-SHA256 and sends it in the creem-signature header:

import crypto from "node:crypto";

const expected = crypto.createHmac("sha256", process.env.CREEM_WEBHOOK_SECRET).update(rawBody).digest("hex");
const ok = crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(req.headers["creem-signature"] || ""));

The raw body gotcha

Every scheme above signs the exact bytes the provider sent. If your framework parses JSON before your handler runs, the signature check fails. In Express use express.raw({ type: "application/json" }) on the webhook route. In Next.js route handlers use await req.text(). In Laravel use $request->getContent().

Event-by-event notes

order_created → one-time purchase. Fire access on the provider's "paid" event, not "checkout created". A created checkout isn't a payment.

subscription_created / subscription_updated. Most providers send several events through a subscription's life (created, active, updated, past_due, canceled). Map each to a status in your entitlements table, not to direct "grant/revoke" calls.

subscription_payment_success. Use it to extend current_period_end. On Stripe that's invoice.paid, on Paddle a completed transaction with a subscription ID, on Polar an order.paid with a subscription billing reason, on Dodo subscription.renewed, on Creem subscription.paid.

subscription_cancelled vs subscription_expired. Lemon Squeezy separates "will cancel at period end" from "access ends now". Keep that distinction. Revoke access at period end, not when the customer clicks cancel.

license_key_created. Only Polar, Dodo and Creem have keys built in. On Stripe and Paddle, create keys yourself in the "paid" handler.

Don't want to do this yourself? We'll do the whole migration at a fixed price.

Questions

What replaces Lemon Squeezy's order_created webhook on Stripe?+

checkout.session.completed for the purchase, and invoice.paid for subscription payments. Only grant access once payment is confirmed.

How do I verify webhooks from Polar and Dodo Payments?+

Both follow the Standard Webhooks spec with webhook-id, webhook-timestamp and webhook-signature headers. Use Polar's SDK helper or the standardwebhooks library for Dodo.

Can I run Lemon Squeezy and new provider webhooks at the same time?+

Yes, and you should during cutover. Write both into your own entitlements table and treat a user as active if either provider says so.

Why does my webhook signature check fail after migrating?+

Usually because the framework parsed and re-serialised the JSON body. Every provider signs the exact raw bytes, so read the raw body on webhook routes.

Keep reading

Migration guides by destination