Creator
Billing

Webhooks

How payment webhooks are processed for Stripe and Lemon Squeezy.

Stripe webhooks

Route: POST /api/stripe/webhook

EventAction
checkout.session.completedRecords order, delivers access
customer.subscription.createdCreates subscription record
customer.subscription.updatedUpdates subscription (plan, status, period)
customer.subscription.deletedSets status to canceled
invoice.payment_succeededRecords order for revenue tracking
invoice.payment_failedSets status to past_due

Lemon Squeezy webhooks

Route: POST /api/lemonsqueezy/webhook

EventAction
order_createdRecords order for revenue tracking
order_refundedMarks order as refunded
subscription_createdCreates subscription record
subscription_updatedUpdates subscription status and period
subscription_cancelledSets status to canceled
subscription_payment_successRecords order for revenue
subscription_payment_failedSets status to past_due

Testing webhooks locally

Stripe

stripe listen --forward-to localhost:3000/api/stripe/webhook

Lemon Squeezy

Use a tunneling service like ngrok or Cloudflare Tunnel to expose your local server, then set the webhook URL in the Lemon Squeezy dashboard.

On this page

We use cookies to ensure you get the best experience on our website. For more information on how we use cookies, please see our cookie policy.