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

How to export all your Lemon Squeezy data before the shutdown

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

Before you migrate anything, take a complete copy of your Lemon Squeezy store. It's your source of truth for rebuilding on the new provider, your backup if something goes wrong, and your record for refunds, support and tax questions long after Lemon Squeezy is gone.

Dashboard CSV exports are fine for a quick look, but they don't include every field or the IDs that connect records together. Use the API.

What to export

Resource Why you need it
Stores Store ID, currency, country
Products & variants Rebuilding your catalog, mapping old variant IDs to new prices
Prices Intervals, trial lengths, pricing model
Customers Emails and names for the migration emails
Subscriptions Status, variant, renews_at, trial_ends_at, pause state
Subscription invoices Payment history for support and refunds
Orders & order items One-time purchase history, refunds
License keys & instances Keys, status, activation limits and every activation
Discounts Codes you still honour
Files Which downloads belong to which variant

Step 1: Create an API key

In Lemon Squeezy go to Settings → API and create a key. Store it as an environment variable, never in code. Delete the key when you're done.

Step 2: Run the export script

Save this as export.mjs and run it with Node 18+: LS_API_KEY=... node export.mjs. It walks every page of every resource and writes one JSON file per resource.

import { writeFile, mkdir } from "node:fs/promises";

const BASE = "https://api.lemonsqueezy.com/v1";
const headers = {
  Accept: "application/vnd.api+json",
  Authorization: "Bearer " + process.env.LS_API_KEY,
};

const RESOURCES = [
  "stores", "products", "variants", "prices", "files",
  "customers", "orders", "order-items",
  "subscriptions", "subscription-invoices", "subscription-items",
  "discounts", "license-keys", "license-key-instances",
];

async function listAll(resource) {
  const out = [];
  for (let page = 1; ; page++) {
    const url = BASE + "/" + resource + "?page[number]=" + page + "&page[size]=100";
    const res = await fetch(url, { headers });
    if (res.status === 429) { await new Promise(r => setTimeout(r, 2000)); page--; continue; }
    if (!res.ok) throw new Error(resource + " page " + page + ": " + res.status);
    const json = await res.json();
    out.push(...json.data);
    const last = json.meta?.page?.lastPage ?? 1;
    if (page >= last) break;
  }
  return out;
}

await mkdir("ls-export", { recursive: true });
for (const r of RESOURCES) {
  const rows = await listAll(r);
  await writeFile("ls-export/" + r + ".json", JSON.stringify(rows, null, 2));
  console.log(r.padEnd(24), rows.length);
}

If you run more than one store on one account, add &filter[store_id]=YOUR_STORE_ID to each request.

Step 3: Sanity-check the numbers

Before trusting the export, compare counts with your dashboard:

  • Active subscriptions in subscriptions.json (filter attributes.status === "active") should match the dashboard.
  • License key count should match.
  • Spot-check five customers end to end: customer → order → subscription → license key.

Step 4: Build your mapping file

As you rebuild your catalog on the new provider, keep a simple mapping:

{
  "variants": { "123456": "price_1Q...", "123457": "pri_01h..." },
  "customers": { "998877": "cus_..." }
}

Every later step (subscriptions, license keys, webhooks) uses it.

What you can't export

Card details. Lemon Squeezy is the merchant of record and holds payment methods. They can only move through a provider-to-provider PCI data transfer, if both sides agree. See migrating subscriptions.

Affiliate data may not all be available through the same API. Export what's there and fill gaps from the dashboard. See migrating affiliates.

Keep it safe

The export contains customer personal data. Store it encrypted, limit who can access it, and delete it when you no longer need it under your privacy policy.

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

Questions

Can I export my Lemon Squeezy customers and subscriptions?+

Yes, through the Lemon Squeezy API. Customers, subscriptions, orders, license keys and more are all available as JSON. The script on this page exports everything.

Can I export my customers' card details?+

No. Payment methods are held by Lemon Squeezy as merchant of record and can only move through a secure transfer between providers.

How long does the export take?+

Usually minutes. The API returns up to 100 records per page, and the script retries automatically if it hits a rate limit.

Keep reading

Migration guides by destination