---
name: lemonsqueezy-to-anyway
description: Guide for migrating a merchant from Lemon Squeezy to Anyway — catalog (stores, products, variants, prices), payment links and the integration cutover, plus a list of what cannot move (discounts, files, license keys, existing subscribers). Use when the user asks to move, import, migrate or copy products from Lemon Squeezy (lemonsqueezy, LS) to Anyway, to plan or preview such a migration, or to compare which Lemon Squeezy features Anyway can carry over.
---

# Lemon Squeezy → Anyway migration

This skill gives no script on purpose. Merchant catalogs vary too much for fixed code to cover every case. Read the current docs below, look at the merchant's actual data, and decide each item with the user. Where the docs and this file disagree, the docs win.

## Documentation

### Anyway
The full page index is at https://docs.anyway.sh/llms.txt; the Chinese index is at https://docs.anyway.sh/_llms/cn.txt.

- **Concepts:** https://docs.anyway.sh/concepts.md
- **Products & payment links:** https://docs.anyway.sh/features/payments.md
- **Merchant API:** https://docs.anyway.sh/api-reference/merchant-api.md
- **Authentication and the permission table:** https://docs.anyway.sh/api-reference/authentication.md
- **API keys:** https://docs.anyway.sh/features/developer-settings.md
- **Sandbox:** https://docs.anyway.sh/features/sandbox-environment.md
  - Merchant API: `merchant-api-stg.anyway.sh`
  - Dashboard: `stg.anyway.sh`
  - Sandbox data may be cleared at any time.
- **Endpoints:**
  - Inspect API key: https://docs.anyway.sh/api-reference/endpoint/api-keys.md
  - Create a product: https://docs.anyway.sh/api-reference/endpoint/create-product.md
  - Create a payment link: https://docs.anyway.sh/api-reference/endpoint/create-product-payment-link.md
  - List products: https://docs.anyway.sh/api-reference/endpoint/products.md
  - Get a product: https://docs.anyway.sh/api-reference/endpoint/get-product.md
  - Update a product: https://docs.anyway.sh/api-reference/endpoint/update-product.md
  - Get product payment links: https://docs.anyway.sh/api-reference/endpoint/get-product-payment-links.md
  - Update a payment link: https://docs.anyway.sh/api-reference/endpoint/update-payment-link.md
  - Checkout sessions: https://docs.anyway.sh/api-reference/checkout-sessions.md
- **Selling requirements:**
  - Business verification: https://docs.anyway.sh/features/business-verification.md
  - Account review: https://docs.anyway.sh/mor/account-review.md
  - Prohibited and restricted categories: https://docs.anyway.sh/mor/prohibited-and-restricted.md
  - Payment methods and currencies: https://docs.anyway.sh/mor/payment-methods.md
  - Merchant of Record and tax: https://docs.anyway.sh/mor/what-is-mor.md and https://docs.anyway.sh/changelog/2026-09-21-automatic-vat.md
- **After the migration:**
  - Webhooks: https://docs.anyway.sh/features/webhooks.md
  - Customers & subscriptions: https://docs.anyway.sh/features/customers-and-subscriptions.md
  - Entitlements: https://docs.anyway.sh/api-reference/endpoint/check-entitlement.md
- **OpenAPI spec:** https://docs.anyway.sh/api-reference/openapi.json

### Lemon Squeezy
- **API overview and rate limit:** https://docs.lemonsqueezy.com/api
- **Requests:** https://docs.lemonsqueezy.com/api/getting-started/requests — covers headers, authentication, pagination, filters and `include`.
- **Test mode:** https://docs.lemonsqueezy.com/help/getting-started/test-mode
- **Tax-inclusive pricing:** https://docs.lemonsqueezy.com/help/payments/sales-tax-vat
- **Objects:**
  - Store: https://docs.lemonsqueezy.com/api/stores/the-store-object
  - Product: https://docs.lemonsqueezy.com/api/products/the-product-object
  - Variant: https://docs.lemonsqueezy.com/api/variants/the-variant-object
  - Price: https://docs.lemonsqueezy.com/api/prices/the-price-object
  - File: https://docs.lemonsqueezy.com/api/files/the-file-object
  - Discount: https://docs.lemonsqueezy.com/api/discounts/the-discount-object
  - Checkout: https://docs.lemonsqueezy.com/api/checkouts/the-checkout-object
  - License key: https://docs.lemonsqueezy.com/api/license-keys/the-license-key-object
  - Subscription: https://docs.lemonsqueezy.com/api/subscriptions/the-subscription-object

## Workflow

1. **Readiness check.** Before planning anything, check that the org can sell on Anyway:
   - Business verification and account review are done, so Card / USD is available.
   - The merchant's products are not in a prohibited or restricted category.
   - Account review also asks for public pricing, terms, privacy and refund pages, and an acceptable-use policy for AIGC products. Tell the user what is missing.

   The catalog can still be created before approval. Payment links will fail until it is granted (`CARD_USD_VERIFICATION_REQUIRED`), so create them after approval.

2. **Keys.** Your commands only see environment variables of the process you run in; a variable the user exports later in another terminal does not reach you. Ask the user for one of:
   - export the keys in a shell, then start your session from that same shell; or
   - save each key in a file outside the repository that only they can read (for example `read -rs KEY && printf %s "$KEY" > ~/.ls-key && chmod 600 ~/.ls-key`), and you reference it as `$(cat ~/.ls-key)` inside your commands.

   Never ask them to paste a key into chat, and never print, log or write a key yourself.
   - **Lemon Squeezy API key:** use a live-mode key to read live data. Test-mode keys only see test data, and keys expire after one year.
   - **Anyway Merchant API key:** Full access, or Limited access with `products:products:read` and `products:products:write`. Add `products:payment_links:read` and `products:payment_links:write` if links will be created too. Each permission is checked on its own: a write permission does not include read, and reading products back needs `products:products:read`. Only an Owner or Admin can grant write permissions.

3. **Target.** Rehearse in the sandbox first unless the user says otherwise. Before any write, call `GET /v1/me` and tell the user which `orgId` will receive the products. Full access shows `permissions: []`.

4. **Read Lemon Squeezy** with GET requests only.
   - Send `Accept: application/vnd.api+json`.
   - Use `page[size]` up to 100 and follow `links.next`.
   - Stay under 300 calls per minute; back off on `429`.
   - Read the stores. If the key sees several stores, ask which one to use.
   - Read the products, the variants, each variant's newest price (every price change creates a new price object and old ones are kept), the files, the discounts, and any checkouts created through the API (for their `product_options.redirect_url`).
   - Record each product's `status` (`draft` or `published`) and each variant's `status` (`pending`, `draft` or `published`). Do not migrate drafts unless the user asks; if they do, create the product but no payment link. A `pending` variant that is its product's only variant is the product's default variant: treat it as the product itself, not as a separate item.
   - Record `test_mode`.

5. **Write a migration plan for the user** before any write. Put it in a file in the working folder, or in an Artifact if it is long. It should cover:
   - each source item with its Lemon Squeezy product, variant and price IDs, and the Anyway product, price or link you propose for it;
   - every decision listed under "Decisions to make with the user";
   - what cannot be carried over;
   - the follow-ups the merchant must do by hand.

6. **Get explicit approval** for the plan, the target org and the environment.

7. **Create one item first and verify it.** Read it back with "Get a product", and check it in the dashboard if the user wants. Then create the rest. "Get a product" lists only prices that have a payment link, so record each `pricingId` from the create response.
   - Give every create call (product or payment link) a stable `Idempotency-Key` derived from the source IDs. Retries then return the original instead of creating a duplicate.
   - On `409 PRODUCT_CONFLICT`, or any other error, stop and report. Do not work around it.

8. **Report back:**
   - a mapping table (Lemon Squeezy variant → Anyway `productId`, `pricingId`, and `paymentLinkUrl` once the link exists);
   - the failures;
   - the cutover checklist below.

## Decisions to make with the user

- **Variants → products or prices.** "Create a product" creates one product with one price and no payment link. "Create a payment link" always adds a new price with its own link. Agree on one of:
  - one Anyway product per variant; or
  - one product per Lemon Squeezy product, with one payment link per variant.

  The product's own price (from "Create a product") has no link and can be sold only through a Checkout Session. A variant sold through a link gets its own price from "Create a payment link", so the variant used to create the product ends up with two prices: one for Checkout Sessions and one for its link. Record both in the mapping table and tell the merchant.
- **Status.** Create products with the default `PUBLISHED`. Do not use `DRAFT` (it can never be published later) or `ARCHIVED`. A product created through the API has no payment link, so nobody can buy it until you create a link and the merchant puts its URL on their site, or the merchant creates a Checkout Session for it.
- **Currency.** Anyway rejects currencies outside its supported list. Its docs describe card checkout, recurring subscriptions and payouts in terms of Card / USD. If the Lemon Squeezy store currency is not USD, confirm with the user and the current docs whether to keep it or convert the prices.
- **Tax.** Anyway prices are before tax; EU and UK VAT is added on top at checkout. Lemon Squeezy stores can be set to tax-inclusive pricing in the store's General Settings. The store object does not report this setting, so ask the merchant. If the store was tax-inclusive, the same number on Anyway makes some buyers pay more, so decide whether to lower prices. Lemon Squeezy `tax_code` (eservice, ebook, saas) has no Anyway field.
- **Amounts.** Lemon Squeezy amounts (`unit_price`) are integers in cents for USD. Anyway takes a decimal string in major units (`"19.99"`) that must be greater than 0. For any other store currency, check the conversion with the user on one known price before converting the rest; zero-decimal currencies such as JPY must not be divided by 100. Usage-based prices only have `unit_price_decimal`.
- **Intervals.** Lemon Squeezy allows day, week, month and year. Anyway allows `DAY`, `MONTH` and `YEAR` with a count. Weekly billing needs a decision, for example every 7 days.
- **Price types without an equivalent.** Decide each case with the user:
  - pay-what-you-want (`pwyw`): Anyway supports flexible one-time amounts with optional `minAmount`/`maxAmount`, but the suggested price is lost, flexible amounts can only be sold through a payment link (not a checkout session), and flexible subscriptions are not allowed;
  - free products and lead magnets: an amount of 0 is rejected;
  - package, graduated and volume pricing (`tiers`);
  - usage-based billing;
  - setup fees;
  - free trials.
- **Field limits.** Names are at most 255 characters and descriptions at most 2000. Lemon Squeezy descriptions are HTML; convert them to plain text. The request body is at most 64 KB, and unknown fields return `400`.
- **Success URL.** Lemon Squeezy products and variants have no redirect field; only checkouts created through the API carry `product_options.redirect_url`. Ask the merchant where buyers should land after paying for each product. Pass that URL as `successUrl` to "Create a payment link" ("Create a product" has no such field). It must be an absolute HTTPS URL. Without it, buyers see the Anyway receipt.

## What does not carry over (tell the user; do not imply it moves)

- **Files and download links.** Covers variant files and variant `links`. Anyway does not deliver files. The merchant must host files and deliver them, for example from a webhook. Lemon Squeezy `download_url`s are signed and expire after 1 hour, so they cannot be reused as links.
- **License keys.** Covers activation limits, key lifetime and the Lemon Squeezy License API calls in the merchant's app. These need the merchant's own system; Anyway entitlements only answer whether a customer has access.
- **Product images.**
- **Discounts.** The Merchant API has no coupon endpoint. List each discount for manual handling: code, percent or fixed amount, duration (once, repeating with months, forever), product limits, redemption limit, start and end dates, and status.
- **Customers, orders, subscriptions and license keys already sold.** These stay in Lemon Squeezy. Active subscribers cannot be moved; changing the card on an Anyway subscription is not supported either, so moving subscribers means they subscribe again on Anyway. Plan this with the merchant, for example by keeping Lemon Squeezy running until existing subscriptions end.
- **Affiliates and store settings.**

## Cutover checklist for the merchant

- Replace Lemon Squeezy `buy_now_url`s and checkout links on the merchant's site with Anyway `paymentLinkUrl`s. For a backend-created checkout of a fixed price, create a Checkout Session with the `pricingId` mapped to that variant.
- Move fulfillment from Lemon Squeezy webhooks to Anyway webhooks: verify signatures, deduplicate by `webhook-id`, fulfill on `order.paid` (one-time purchases and subscription orders), keep subscription state from `subscription.*`, and revoke access on `refund.succeeded` with `fullyRefunded: true`.
- Replace Lemon Squeezy subscription and license checks with Anyway subscription records or entitlement checks.
- Test one real purchase through one Anyway payment link before replacing the rest.
