# Price testing for Lemon Squeezy: verified revenue until the March 2027 shutdown

Source: https://leverprice.com/integrations/lemon-squeezy
Updated: 2026-11-17

> Lemon Squeezy stops processing transactions on March 31, 2027. Until then Leverprice verifies its orders: your server sets custom_price to each visitor's tested price, and an order counts once Lemon Squeezy's signed order_created webhook confirms it. You paste a signing secret you choose, never an API key. Size any test to finish before you migrate.

Lemon Squeezy is winding down. It closed new store sign-ups on November 16, 2026 and stops processing transactions, subscription renewals included, on March 31, 2027, with no extensions ([Lemon Squeezy](https://www.lemonsqueezy.com/blog/saying-goodbye-to-lemon-squeezy)). Leverprice keeps verifying Lemon Squeezy orders for as long as Lemon Squeezy processes them, so the purchases in a test you run now are still verified. Start with [what the shutdown means for your store](https://leverprice.com/blog/lemon-squeezy-shutting-down).

Migration tooling to Stripe Managed Payments opens on December 2, 2026, and Lemon Squeezy recommends starting no later than mid-January 2027 ([migration guide](https://docs.lemonsqueezy.com/migration)). Migrating merchants pay a promotional 1.5% Managed Payments fee through December 1, 2027, plus standard Stripe processing fees ([migration guide](https://docs.lemonsqueezy.com/migration)). As of November 2026, the standard Managed Payments fee is 3.5% ([Stripe pricing](https://stripe.com/us/pricing)). Managed Payments doesn't support PayPal, storefronts, file or license-key delivery, or affiliates. If you rely on any of those, compare [moving to Polar](https://leverprice.com/blog/lemon-squeezy-to-polar) with [moving to Managed Payments](https://leverprice.com/blog/lemon-squeezy-to-stripe-managed-payments).

## Is it worth testing prices on Lemon Squeezy now?

It is if your volume lets a test finish before you migrate. What a test produces is a price, and a price works on any provider. In our simulations of the production engine, a price earning 10% more per visitor took a median of 40 days to find at 300 sales a month, 14 days at 1,000 and 113 days at 100 ([full table](https://leverprice.com/blog/how-long-should-a-price-test-run)).

So a store at 300 sales a month that starts in late November can have its answer before the mid-January migration start Lemon Squeezy recommends, while a store at 100 sales a month would still be testing. At that volume, test prices that are further apart, or run the test on your new provider.

## How does price testing work on Lemon Squeezy?

1. In Leverprice, you add a product in your store's currency with the price range you'd accept, for example $19 to $49, and start a test. Your current price stays the fallback.
2. Where the price is shown, your server calls `getPrice()` and renders `quote.price`. A signed first-party cookie keeps each visitor on one price.
3. Your checkout route asks again and creates a Lemon Squeezy checkout with `custom_price` set to `quote.price` and `quote.metadata` as custom data.
4. Lemon Squeezy sends `order_created` with that custom data in `meta.custom_data`. Leverprice checks the signature, credits the order to the visitor's price and moves traffic toward the price that earns the most per visitor.

If Leverprice is slow or down, `getPrice()` returns your fallback price within 500 ms.

## How do I connect Lemon Squeezy webhooks to Leverprice?

With Lemon Squeezy you choose the signing secret yourself. Make it a random string of 8 to 40 characters: Lemon Squeezy accepts 6 to 40 ([docs](https://docs.lemonsqueezy.com/help/webhooks)) and Leverprice needs at least 8.

1. In Leverprice, open **Payments**, click **Connect provider**, and choose Lemon Squeezy and a mode, Test or Live. Leverprice generates a webhook URL.
2. In Lemon Squeezy, go to **Settings → Webhooks** and add a webhook with the Leverprice URL as its callback URL.
3. Enter your signing secret and select `order_created` and `order_refunded`.
4. Paste the same secret into Leverprice.

| Event | What Leverprice does with it |
|---|---|
| `order_created` | Counts the order once its status is paid |
| `order_refunded` | Takes full and partial refunds, before tax, off that price's revenue |

Lemon Squeezy signs the raw body with HMAC-SHA256 and sends the result in the `X-Signature` header ([docs](https://docs.lemonsqueezy.com/help/webhooks/signing-requests)). The scheme carries no timestamp, so Leverprice identifies each event by its order and refunded amount, and a resent event never counts twice.

*Figure: An order moves from your checkout to Lemon Squeezy, then as a signed webhook to Leverprice, which records a verified purchase. Leverprice is one more webhook in Lemon Squeezy. Any webhook you already use keeps receiving the same events.*

## How do I charge the tested price on Lemon Squeezy?

Set `custom_price` when you create the checkout. Lemon Squeezy documents it as a positive integer in cents ([API reference](https://docs.lemonsqueezy.com/api/checkouts/create-checkout)), the same minor units as `quote.price`. It takes no currency, so set the Leverprice product to your store's currency. Pass `quote.metadata` as custom checkout data; Lemon Squeezy returns it in `meta.custom_data` on order webhooks ([docs](https://docs.lemonsqueezy.com/help/checkout/passing-custom-data)).

Create the Leverprice client once ([setup details](https://leverprice.com/docs)):

```ts title="lib/leverprice.ts"
import { Leverprice } from "@leverprice/sdk";

export const leverprice = new Leverprice({
  secretKey: process.env.LEVERPRICE_SECRET_KEY, // server only
  products: {
    // Prices outside these bounds are never returned.
    pro: { currency: "usd", fallbackPrice: 2900, minPrice: 1900, maxPrice: 4900 },
  },
});
```

The checkout route uses Lemon Squeezy's JavaScript SDK:

```ts title="app/api/checkout/route.ts"
import { createCheckout, lemonSqueezySetup } from "@lemonsqueezy/lemonsqueezy.js";
import { leverprice } from "@/lib/leverprice";

lemonSqueezySetup({ apiKey: process.env.LEMONSQUEEZY_API_KEY! });

const STORE_ID = process.env.LEMONSQUEEZY_STORE_ID!;
const VARIANT_ID = process.env.LEMONSQUEEZY_VARIANT_ID!;

export async function POST(request: Request) {
  // Ask again here. Never trust a price sent by the browser.
  const quote = await leverprice.getPrice("pro", { request });

  const { data, error } = await createCheckout(STORE_ID, VARIANT_ID, {
    customPrice: quote.price, // cents: 2900 = $29.00
    productOptions: { enabledVariants: [Number(VARIANT_ID)] },
    checkoutData: { custom: quote.metadata }, // signed attribution: pass it whole
  });
  if (error) throw error;

  const headers = new Headers({ Location: data.data.attributes.url });
  for (const cookie of quote.setCookie) headers.append("Set-Cookie", cookie);
  return new Response(null, { status: 303, headers });
}
```

`enabledVariants` keeps the checkout on the one variant the custom price applies to. Run one test-mode checkout before you go live and check that the order total matches the tested price. From each paid order, Leverprice counts `total` minus `tax`, the amount after discounts and before tax.

## Do Lemon Squeezy subscriptions count?

The first payment does. Lemon Squeezy always sends `order_created` alongside `subscription_created` ([event types](https://docs.lemonsqueezy.com/help/webhooks/event-types)), and Leverprice counts that first order. Renewal payments arrive as subscription payment events, which Leverprice ignores: renewals never count toward a test, so each price is judged on first payments minus refunds.

A custom price stays with the subscription. Lemon Squeezy uses it for all renewal payments until the customer moves to another variant ([API reference](https://docs.lemonsqueezy.com/api/checkouts/create-checkout)).

Leave free trials out of a test. A trial starts the subscription without a payment ([Lemon Squeezy docs](https://docs.lemonsqueezy.com/help/products/subscriptions)), and the payment that follows is a subscription payment, so Leverprice never sees what a trial sign-up pays.

## What happens when I refund a Lemon Squeezy order?

Lemon Squeezy sends `order_refunded` for full and partial refunds, with the total refunded so far. That figure includes tax, so Leverprice scales it by the order's pre-tax share before taking it off the price's revenue. A full refund comes out exact and turns the order into a refunded purchase that adds nothing to its price. A partial refund keeps the sale and lowers it, with the tax prorated.

## Can I test in Lemon Squeezy test mode first?

Yes. Lemon Squeezy keeps test-mode data apart, and API keys created in test mode only touch test-mode data ([test mode](https://docs.lemonsqueezy.com/help/getting-started/test-mode)). Set up a test webhook as well and connect it in Leverprice as Test, with your live webhook as Live, and run your app with your `pp_sk_test_…` key. Every order also carries a `test_mode` flag ([order object](https://docs.lemonsqueezy.com/api/orders/the-order-object)), which Leverprice uses to keep test purchases out of live results.

## What if a customer pays in another currency?

Lemon Squeezy records each order in the order's currency and also in US dollars at the rate used at purchase, as `total_usd` and `tax_usd` ([order object](https://docs.lemonsqueezy.com/api/orders/the-order-object)). When an order's currency differs from the experiment's, Leverprice uses those US dollar figures for a USD experiment and daily reference exchange rates otherwise.

Because `custom_price` takes no currency, regional prices on Lemon Squeezy stay in your store's currency. List only that currency in the product's regional guard; visitors priced in other currencies then get your standard price.

## Can I test prices with Lemon Squeezy checkout links and no code?

Yes. For a site without a backend, create one variant per test price, paste each variant's checkout link into Leverprice next to its price, and point your Buy button at the product's Leverprice link (`/l/…`) from the **Install** page. Leverprice redirects each visitor to their price's link with the signed attribution as `checkout[custom]` parameters, which Lemon Squeezy returns in `meta.custom_data` ([docs](https://docs.lemonsqueezy.com/help/checkout/passing-custom-data)). In this mode your page can't show the tested price, and checkout links carry standard prices only.

## What does Leverprice verify on Lemon Squeezy?

| Lemon Squeezy event | Counts toward the test |
|---|---|
| Paid one-time order | Yes, at total minus tax |
| A subscription's first order | Yes |
| Renewal payment | No |
| Payment after a free trial | No |
| Refund, full or partial | Yes, with tax prorated on partial refunds |
| Anything after March 31, 2027 | No: Lemon Squeezy stops processing |

After you move, connect the new provider in Leverprice: [Stripe](https://leverprice.com/integrations/stripe), [Polar](https://leverprice.com/integrations/polar) or [Dodo Payments](https://leverprice.com/integrations/dodo-payments).

## Frequently asked questions

### Can I still open a Lemon Squeezy store to run a price test?

No. Lemon Squeezy closed new store sign-ups on November 16, 2026 ([migration guide](https://docs.lemonsqueezy.com/migration)). If you don't have a store yet, set up the test on Stripe, Polar or Dodo Payments.

### Does Leverprice need my Lemon Squeezy API key?

No. Your server keeps its API key and creates every checkout. Leverprice stores only the signing secret you chose, encrypted.

### Should I migrate before or after a price test?

If the test can finish before mid-January 2027, run it first and carry the winning price over. If it can't, migrate first and test on the new provider, so the whole test runs on one checkout.
