ShipVeryFastShipVeryFast
Documentation

Swap Stripe for Lemon Squeezy

Lemon Squeezy is a merchant of record with hosted checkout overlays and a simple webhook model. The swap is the same shape as any payment provider change in ShipVeryFast, because billing sits behind a thin layer.

The seam

Only three places know your provider: app/api/checkout/session/route.ts (create checkout), app/api/webhooks/stripe/route.ts (sync status) and libs/pricingPlans.ts (map plans to price ids).

Add keys

Add LEMONSQUEEZY_API_KEY, LEMONSQUEEZY_STORE_ID and LEMONSQUEEZY_WEBHOOK_SECRET to libs/config.ts.

Create a checkout

From the checkout route, create a Lemon Squeezy checkout for the requested variant and return its URL. The route still takes a plan id and returns a redirect URL.

curl -X POST https://api.lemonsqueezy.com/v1/checkouts \
  -H "Authorization: Bearer $LEMONSQUEEZY_API_KEY" \
  -H "Content-Type: application/vnd.api+json" \
  -d '{ "data": { "type": "checkouts", "attributes": { /* variant + store */ } } }'

Sync via webhook

Verify the signature with LEMONSQUEEZY_WEBHOOK_SECRET, then map subscription_created and subscription_updated to the same writes the Stripe handler made to your subscriptions table.

Map plans

Return Lemon Squeezy variant ids from getStripePriceId, keeping your internal plan ids stable.