Migrate from Lemon Squeezy
Export Lemon Squeezy keys and devices, match customers and products, then import each batch into Comecero without changing saved keys or device IDs.
Importing keys does not migrate subscriptions or payments. Use a generated service and switch your app to the Comecero License key API.
Use Node 22+ and jq. Keep files private: they contain full keys. Stop source device changes before the final export.
1. Download and export
curl -fLO https://docs.comecero.com/downloads/export-lemon-squeezy.mjs
curl -fLO https://docs.comecero.com/downloads/convert-lemon-squeezy.mjs
LS_API_KEY='...' LS_STORE_ID='10' LS_MODE='live' \
node export-lemon-squeezy.mjs > lemon-squeezy.jsonThe API key sets the mode; set LS_MODE to match. The exporter reads every page and checks device counts. If counts differ, stop changes and export again.
The exporter keeps each UUID attributes.identifier, which installed apps save, instead of the numeric JSON:API id.
2. Match customers and products
Create Comecero customers and digital or service products in the target mode. Match source IDs in these files; check email matches.
{ "15": "customer_test" }Products use product_id:variant_id; leave the suffix empty without a variant.
{ "30:40": "widget-pro.test" }node convert-lemon-squeezy.mjs \
--input lemon-squeezy.json \
--customers customers-map.json \
--products products-map.json \
--rows-per-batch 20 \
--output batchesMissing matches or devices stop conversion. Expired and revoked keys keep devices. Batch files are not overwritten.
| Source value | Comecero value |
|---|---|
active or inactive | status: active |
expired | Keeps past expiry; validation returns EXPIRED |
disabled status or disabled: 1 or true | status: revoked, revoked_reason: merchant |
Limit 0 or null | No device limit |
Device identifier, name, created_at | instance_id, name, activated_at |
| Limit | Maximum |
|---|---|
| Dashboard source file | 20 MiB |
| Keys per batch | 20 |
| Devices per key | 90; contact support for more |
| Devices per batch | 500 |
| JSON body | 1 MiB |
| Requests per account | Five per minute across modes |
3. Check and import each batch
Set your secret or trusted token and service ID. The token sets the mode. Test with made-up keys or another account: one key cannot exist in both modes.
CORE='https://api.comecero.com'
TOKEN='...'
SERVICE='...'
jq '.dry_run = true' batches/001.json > preview.json
curl --fail-with-body "$CORE/api/v1/license_services/$SERVICE/imports" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: ls-preview-001" \
--data-binary @preview.jsonReview every row, then import:
curl --fail-with-body "$CORE/api/v1/license_services/$SERVICE/imports" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: ls-import-001" \
--data-binary @batches/001.jsonUse a new request key per batch and dry run. Follow Retry-After. If you receive an error with error.meta.import_id, read that receipt before retrying. A timeout may give no reply and no receipt ID. In that case, deliberately resend the same body and same Idempotency-Key, for example rerun the exact curl command above with the same file. The request replays the saved receipt or continues unfinished rows. Never retry in the background. After a dashboard reload, choose the same file and matches; the rebuilt body must match the saved digest.
Correct failed rows with a new request key. Change successful imports through Update a license; a new import key does not bypass source conflicts. Check every row, including its flat error.message, and keep receipt IDs for later batches.
Read a known receipt and its imported license:
IMPORT_ID='...'
LICENSE_ID='...'
curl --fail-with-body "$CORE/api/v1/license_services/$SERVICE/imports/$IMPORT_ID" \
-H "Authorization: Bearer $TOKEN"
curl --fail-with-body "$CORE/api/v1/licenses/$LICENSE_ID" \
-H "Authorization: Bearer $TOKEN"4. Switch your app
Wait for active_in_apollo: true. Switch your app's host, account_id and request handling. Validate saved UUIDs before new activations. Imported devices have fingerprint: null.
Test a full key: block refuses new devices; rotate replaces the oldest and keeps the count. Removed devices return INSTANCE_DEACTIVATED. Deactivation lowers the count once. Re-import must not restore devices.
See Import existing keys for access, CSV and updates.
Import existing keys
Bring existing license keys and devices into Comecero. Choose a file, match customers and products, check each batch, then import it.
Entitlements
Decide what each customer may use in your app from what they bought. Features, feature sets and their revisions, memberships, overrides and limits.