> ## Documentation Index
> Fetch the complete documentation index at: https://docs.authforge.cc/llms.txt
> Use this file to discover all available pages before exploring further.

# Migrate License Keys from Lemon Squeezy

> Move your license keys off Lemon Squeezy before March 31, 2027: list them with its API, map each field to the AuthForge import file, and keep every key.

Lemon Squeezy is closing. It stopped accepting new stores on November 16, 2026 and stops processing payments on March 31, 2027. If your software checks Lemon Squeezy license keys, this guide moves those keys into AuthForge as they are, so your customers keep the key they already have.

AuthForge replaces one part of Lemon Squeezy: issuing license keys and checking them in your app. It does not take payments, so you still need a payment provider for new sales.

## What changes, and when

| Date | What Lemon Squeezy says |
| - | - |
| November 16, 2026 | "As of today, we've closed new store sign-ups, and Lemon Squeezy will stop processing payments on March 31, 2027." \[1] |
| March 31, 2027 | "Lemon Squeezy stops processing transactions, including subscription renewals" \[2] |
| After March 31, 2027 | "After that date, license keys, files, and links hosted on Lemon Squeezy will become inaccessible." \[3] |

Lemon Squeezy recommends Stripe Managed Payments as the successor, and says of it: "Managed Payments doesn't deliver files, links, or license keys. You'll need a separate solution" \[2]. Its fulfillment page gives two options, hosting fulfillment yourself or using a third-party provider, and adds: "Before choosing a provider, confirm what can be imported and plan how existing customers will continue accessing their purchases." \[3]

The next section is that confirmation for AuthForge.

> [!NOTE]
>
> Lemon Squeezy's pages do not mention its License API (activate, validate, deactivate) by name when they describe what stops. If your plan depends on those endpoints after March 31, 2027, ask Lemon Squeezy.

## What moves and what does not

| | Moves to AuthForge | How |
| - | - | - |
| The key itself | Yes | Imported exactly as it is, if it fits the [key rules](https://docs.authforge.cc/guides/import-licenses.md#key-rules). |
| Customer email | Yes | `user_email` becomes the license's email, which lets the customer sign in to the [self-service portal](https://docs.authforge.cc/features/portal.md). Nothing is sent to it. |
| Expiry date | Yes | `expires_at` becomes the license's expiry. A perpetual key stays perpetual. |
| Activation limit | Yes, from 1 to 16 | A limit above 16 has to be lowered to 16 or made unlimited. "Unlimited" on Lemon Squeezy becomes an [unlimited-seat license](https://docs.authforge.cc/features/unlimited-seats.md). |
| Activations (instances) | No | Each device binds again the first time your new build checks its key. See [Activations do not carry over](#activations-do-not-carry-over). |
| Disabled and expired keys | Yes, as what they are | A disabled key is imported revoked, through the import file's `status` column. An expired key is imported with its past expiry date, which makes it expired. Your app is told `revoked` or `expired` for them; a key you leave out is refused as `invalid_key`. |
| The link to an order or a subscription | No | An imported license has the expiry date from the file. The import stores no order or subscription with it. See [Subscriptions](#subscriptions). |
| Checkout, tax, files and download links | No | AuthForge does licensing only. |

Two more things to know before you plan the move:

* **Your app needs a new build.** AuthForge does not answer the Lemon Squeezy License API. Your software checks keys through an [AuthForge SDK](https://docs.authforge.cc/sdk/overview.md) instead of calling `activate` and `validate`. Builds you have already shipped keep asking Lemon Squeezy until the customer updates.
* **One AuthForge app per product.** A license key belongs to one app. If you sell several products with license keys, create an app for each and import each product's keys into its own app.

## Before you start

* Create the AuthForge app (or apps) the keys belong to.
* Create a Lemon Squeezy API key (in Lemon Squeezy: **Settings → API**).
* Decide what a key with no activation limit becomes. See the `activation_limit` row below.

## 1. List your keys

The order export that Lemon Squeezy documents has no license key column \[8]. Its API lists the keys: `GET /v1/license-keys` "Returns a paginated list of license keys." \[4]

```bash theme={null}
curl "https://api.lemonsqueezy.com/v1/license-keys?filter[product_id]=PRODUCT_ID&page[size]=100&page[number]=1" \
  -H "Accept: application/vnd.api+json" \
  -H "Content-Type: application/vnd.api+json" \
  -H "Authorization: Bearer $LEMON_API_KEY"
```

A page holds at most 100 keys (`page[size]`, default 10). Read `meta.page.lastPage` in the answer and request each page up to it \[5]. The filters are `store_id`, `order_id`, `order_item_id`, `product_id` and `status` \[4].

## 2. Map the fields

Each key in the answer has an `attributes` object \[6]. This is how it maps to the [import file](https://docs.authforge.cc/guides/import-licenses.md#the-file):

| Lemon Squeezy attribute | Import column | Rule |
| - | - | - |
| `key` | `key` | Copy it unchanged. It must be 8 to 64 characters of letters, digits, hyphens, underscores and dots. The example keys in Lemon Squeezy's documentation are UUID-shaped (`38b1460a-5104-4067-a91d-77b872934d51`), which fits. |
| `user_email` | `email` | Copy it. |
| `expires_at` | `expires` | Copy the date-time (`2027-05-24T14:15:07Z`). `null` means the key is perpetual: leave the column empty. |
| `activation_limit` | `seats` | `1` to `16`: copy it. `null` or `0` "means unlimited activations" \[6]: write `unlimited`, or a number from 1 to 16 if you would rather cap it. Above 16: write `16` or `unlimited`. |
| `status`, `disabled` | `status` | Write `revoked` when `status` is `disabled` or `disabled` is true; leave the column empty otherwise. Do not copy Lemon Squeezy's word. Its `inactive` means "The license key is valid but has no activations" \[7], which is an active license here, and the import rejects a line that says `inactive` rather than guess what the word means. A key whose `status` is `expired` needs nothing here: its past date in `expires` is what makes it expired. |
| `user_name` | none | Not imported. The `label` column is the only free-text field, and it is not private: your app receives it and the customer sees it in the portal. |
| `instances_count` | none | Not imported. |
| `product_id` | none | Decides which AuthForge app the key goes into. |

A file made this way looks like this:

```csv theme={null}
key,email,expires,seats,status
38b1460a-5104-4067-a91d-77b872934d51,alice@example.com,,3,
80e15db5-c796-436b-850c-8f9c98a48abe,bob@example.com,2027-05-24T14:15:07Z,1,
1c9a4f6e-0b7d-4d0e-9a55-6f2f0c3b8e21,team@example.com,,unlimited,
4f2d7c91-3ea0-4031-ad88-9c5c3f6eb154,carol@example.com,,1,revoked
```

The last line is a key that was disabled on Lemon Squeezy.

> [!WARNING]
>
> `unlimited` is permanent. An unlimited-seat license accepts any device and cannot be given a seat limit later. A license with a limit can have it changed at any time. If you are unsure, import with a number; you can [remove an import](https://docs.authforge.cc/guides/import-licenses.md#remove-an-import) and run it again while nothing depends on it yet.

### A script for steps 1 and 2

This Python script (standard library only, Python 3.8 or later) reads every page of `GET /v1/license-keys` and writes the import file. Keys that are not imported go to `left-out.csv` with the reason, so nothing disappears silently.

> [!WARNING]
>
> This script has not been run against a live Lemon Squeezy store. It was tested against a local server that answers with pages built from the example response in Lemon Squeezy's API reference \[4]. Run the import as a dry run first and read the report before you write anything.

```python lemon_keys_to_csv.py theme={null}
"""Turn Lemon Squeezy license keys into AuthForge import files.

  LEMON_API_KEY=... python lemon_keys_to_csv.py --product-id 12345

Writes keys-1.csv, keys-2.csv, ... (5,000 rows each, the import's limit per
file) and left-out.csv (keys that were not written, with the reason).
"""
import argparse
import csv
import datetime
import json
import os
import re
import urllib.parse
import urllib.request

KEY_RULE = re.compile(r"^[A-Za-z0-9][A-Za-z0-9._-]{7,63}$")
ROWS_PER_FILE = 5000


def license_keys(base_url, api_key, filters):
    """Yield the attributes of every license key, following the pages."""
    number = 1
    while True:
        query = dict(filters)
        query.update({"page[number]": number, "page[size]": 100})
        request = urllib.request.Request(
            base_url + "/v1/license-keys?" + urllib.parse.urlencode(query),
            headers={
                "Accept": "application/vnd.api+json",
                "Content-Type": "application/vnd.api+json",
                "Authorization": "Bearer " + api_key,
            },
        )
        with urllib.request.urlopen(request, timeout=30) as response:
            body = json.load(response)
        for item in body["data"]:
            yield item["attributes"]
        if number >= body["meta"]["page"]["lastPage"]:
            return
        number += 1


def is_past(expires):
    """True for a date-time such as 2025-01-01T00:00:00Z that has passed."""
    try:
        moment = datetime.datetime.strptime(expires, "%Y-%m-%dT%H:%M:%SZ")
    except ValueError:
        return False
    return moment.replace(tzinfo=datetime.timezone.utc) < datetime.datetime.now(datetime.timezone.utc)


def to_row(attributes, over_16):
    """Return (row, None) for a key to import, or (None, reason) to leave it out."""
    key = attributes.get("key") or ""
    status = attributes.get("status")
    disabled = bool(attributes.get("disabled")) or status == "disabled"
    if not KEY_RULE.match(key):
        return None, "key does not fit the import rules"
    limit = attributes.get("activation_limit")
    if not limit:
        seats = "unlimited"
    elif limit <= 16:
        seats = str(limit)
    elif over_16:
        seats = over_16
    else:
        return None, "activation_limit %s is above 16; run again with --over-16" % limit
    # 2027-05-24T14:15:07.000000Z -> 2027-05-24T14:15:07Z
    expires = re.sub(r"\.\d+", "", attributes.get("expires_at") or "")
    if status == "expired" and not disabled and not is_past(expires):
        # AuthForge works out "expired" from the date, and this key has none that has passed.
        return None, "status is expired, and expires_at is not a date in the past"
    row = {
        "key": key,
        "email": attributes.get("user_email") or "",
        "expires": expires,
        "seats": seats,
        # A disabled key is imported revoked. "inactive" on Lemon Squeezy is a
        # valid key with no activations, which is an active license here.
        "status": "revoked" if disabled else "",
    }
    return row, None


def write_csv(path, fieldnames, rows):
    with open(path, "w", newline="", encoding="utf-8") as handle:
        writer = csv.DictWriter(handle, fieldnames=fieldnames)
        writer.writeheader()
        writer.writerows(rows)


def main(argv=None):
    parser = argparse.ArgumentParser(description=__doc__.split("\n")[0])
    parser.add_argument("--product-id", help="only keys of this Lemon Squeezy product")
    parser.add_argument("--store-id", help="only keys of this Lemon Squeezy store")
    parser.add_argument(
        "--over-16",
        choices=["16", "unlimited"],
        help="what a key with an activation limit above 16 becomes",
    )
    parser.add_argument("--out-dir", default=".")
    parser.add_argument("--base-url", default="https://api.lemonsqueezy.com")
    args = parser.parse_args(argv)

    filters = {}
    if args.product_id:
        filters["filter[product_id]"] = args.product_id
    if args.store_id:
        filters["filter[store_id]"] = args.store_id

    rows, left_out = [], []
    for attributes in license_keys(args.base_url, os.environ["LEMON_API_KEY"], filters):
        row, reason = to_row(attributes, args.over_16)
        if row:
            rows.append(row)
        else:
            left_out.append({"key": attributes.get("key") or "", "reason": reason})

    for start in range(0, len(rows), ROWS_PER_FILE):
        name = "keys-%d.csv" % (start // ROWS_PER_FILE + 1)
        write_csv(
            os.path.join(args.out_dir, name),
            ["key", "email", "expires", "seats", "status"],
            rows[start:start + ROWS_PER_FILE],
        )
    write_csv(os.path.join(args.out_dir, "left-out.csv"), ["key", "reason"], left_out)
    print("%d keys to import, %d left out" % (len(rows), len(left_out)))


if __name__ == "__main__":
    main()
```

What it decides for you, so you can decide otherwise:

* A key with no activation limit becomes `unlimited`. To cap those keys instead, replace `unlimited` in the `seats` column before you import.
* A key with a limit above 16 is left out until you run the script again with `--over-16 16` or `--over-16 unlimited`.
* A disabled key is written with `revoked` in the `status` column, so it is imported revoked and your app is told `revoked` for it. To leave disabled keys out instead, delete those lines from the file before you import; AuthForge then refuses them as `invalid_key`.
* An expired key is written with its past date and is imported as an expired license. An expired key whose `expires_at` is empty or still in the future is left out and listed in `left-out.csv`: AuthForge works out "expired" from the date, and there is none to go by. Give it a past date by hand, or `revoked` in the `status` column, if you want it on record.
* A key whose status is `inactive` ("valid but has no activations" \[7]) is imported as an active license with no device bound, like every other key.

The files contain your customers' email addresses and working license keys. Keep them off shared drives and delete them when the import is done.

## 3. Import, dry run first

Follow [Import existing license keys](https://docs.authforge.cc/guides/import-licenses.md): open the app, choose **Import Keys**, select the file and **Check file**. Nothing is written until you have read the report and chosen **Import N licenses**. From a script, `POST /v1/licenses/import` with `dryRun: true` does the same check.

The import is free and open to every account. It sends no email to your customers and fires no webhook. If you imported the wrong file, [remove the import](https://docs.authforge.cc/guides/import-licenses.md#remove-an-import) and start again.

## 4. Ship a build that asks AuthForge

Replace the calls to the Lemon Squeezy License API with an [AuthForge SDK](https://docs.authforge.cc/sdk/overview.md): Python, C#, C++, Rust, Go or Node.js. The [quickstart](https://docs.authforge.cc/quickstart.md) has the login call for each.

Your current build has the customer's license key saved somewhere. Have the new build read that saved key and log in with it, so the customer is not asked for a key they entered long ago.

An imported key works the moment the import finishes, in a build that asks AuthForge. Builds you shipped earlier keep asking Lemon Squeezy; get the new build to your customers before March 31, 2027.

### Activations do not carry over

On Lemon Squeezy an activation is an "instance": "an instance is a recorded "use" of a license key" \[7], created with a name your app chooses (`instance_name`) and identified by an ID your app stores. An AuthForge seat is a hardware ID that the SDK computes on the customer's machine (see [HWID locking](https://docs.authforge.cc/features/hwid-locking.md)). The two cannot be converted into each other, so the import leaves the device bindings empty.

The first time a customer runs the new build, the SDK binds that device to the key. A key imported with 3 seats is taken by the first 3 devices that run the new build. If the wrong device takes a seat, [reset the key](https://docs.authforge.cc/api/licenses.md#reset-hwid-bindings), or let customers reset their own devices in the [portal](https://docs.authforge.cc/features/portal.md) under a policy you set.

## 5. Deliver keys for new sales

AuthForge does not sell your product. Once your new payment provider is taking orders, each sale has to create a license:

* **Stripe Checkout.** [Commerce](https://docs.authforge.cc/features/commerce.md) issues the key when a Stripe Checkout purchase completes, emails it to the buyer, and revokes it on a full refund or a chargeback.
* **Any other provider.** Your own webhook handler creates the license with one call to the Developer API when a sale completes. See [Build your own integration](https://docs.authforge.cc/guides/custom-integration.md).

> [!WARNING]
>
> Commerce has not been tested with a store on Stripe Managed Payments, the provider Lemon Squeezy recommends. Until it has, do not assume that it works there: test it in a Stripe sandbox before you depend on it, or create licenses from your own webhook handler with the Developer API, which does not depend on the provider.

### Subscriptions

An imported license keeps the expiry date from the file. The import does not link a license to a subscription, and [Commerce](https://docs.authforge.cc/features/commerce.md) never changes an imported license, even when its email is the buyer's: a renewal, refund or chargeback at your new provider does not move its date or revoke it. If you sell subscriptions, move the date yourself when a renewal is paid: `PUT /v1/licenses/{licenseKey}` with `action: "extend"` ([Extend expiration](https://docs.authforge.cc/api/licenses.md#extend-expiration)). [Subscription lifecycle](https://docs.authforge.cc/guides/subscriptions.md) has the pattern.

How subscriptions themselves move from Lemon Squeezy to another provider is described in Lemon Squeezy's migration guide \[2]; this guide covers the keys. A license that Commerce issued through your Lemon Squeezy connection is not imported: it is already in AuthForge, and when Lemon Squeezy moves its subscription to your Stripe account it follows the subscription. See [Moving subscriptions to Stripe](https://docs.authforge.cc/guides/lemon.md#moving-subscriptions-to-stripe).

## Limits

These are the same for every account, free or paying:

* 5,000 rows and 2 MB per file. The script above splits the list into files of 5,000.
* 50,000 imported licenses per account per day (UTC).
* 10 import requests per account per minute, checks and removals included.
* Keys are 8 to 64 characters; `seats` is 1 to 16 or `unlimited`.
* A license key is unique across all of AuthForge. A long random key, such as the UUID-shaped keys in Lemon Squeezy's documentation, will not collide with someone else's.

Importing costs no credits. A license costs a credit when it is validated, like any other.

## Sources

Read on December 2, 2026. Lemon Squeezy is changing these pages as the shutdown approaches; if one of them disagrees with this guide, the page is right.

1. Lemon Squeezy, "Saying goodbye to Lemon Squeezy", November 16, 2026: [lemonsqueezy.com/blog/saying-goodbye-to-lemon-squeezy](https://www.lemonsqueezy.com/blog/saying-goodbye-to-lemon-squeezy)
2. Lemon Squeezy, "Lemon Squeezy is winding down": [docs.lemonsqueezy.com/migration](https://docs.lemonsqueezy.com/migration)
3. Lemon Squeezy, "Digital fulfillment when moving from Lemon Squeezy to Managed Payments": [docs.lemonsqueezy.com/migration/digital-fulfillment](https://docs.lemonsqueezy.com/migration/digital-fulfillment)
4. Lemon Squeezy API, "List all license keys": [docs.lemonsqueezy.com/api/license-keys/list-all-license-keys](https://docs.lemonsqueezy.com/api/license-keys/list-all-license-keys)
5. Lemon Squeezy API, "Requests" (pagination): [docs.lemonsqueezy.com/api/getting-started/requests](https://docs.lemonsqueezy.com/api/getting-started/requests)
6. Lemon Squeezy API, "The license key object": [docs.lemonsqueezy.com/api/license-keys/the-license-key-object](https://docs.lemonsqueezy.com/api/license-keys/the-license-key-object)
7. Lemon Squeezy, "License keys" tutorial: [docs.lemonsqueezy.com/guides/tutorials/license-keys](https://docs.lemonsqueezy.com/guides/tutorials/license-keys)
8. Lemon Squeezy, "Exporting orders": [docs.lemonsqueezy.com/help/orders/exporting-orders](https://docs.lemonsqueezy.com/help/orders/exporting-orders)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.