Skip to content

Integration

License keys

Sell software with license keys and activation limits. The API is Lemon Squeezy's: change the host and add a key.

Updated

For desktop apps, plugins and software: every paid sale issues a license key. The buyer types the key into your app, and the app asks Infi whether it is valid and how many machines it is already activated on.

In preview

License keys are enabled per account. To use them, write to [email protected] and the team turns them on for you.

How it works

  • One key per paid sale. It goes to the buyer's e-mail and stays in their purchases. A subscription renewal issues no new key.
  • Activation limit. You choose how many machines (or sites) each key can activate. Unlimited works too.
  • Validity. Lifetime, a number of days, or while the subscription is active. When the subscription is canceled, the key expires.
  • Refunds disable it. A full refund or a chargeback disables the key when the money goes back. If you win the dispute, it works again.
  • You can revoke a key any time, in the dashboard, under Licenses.

Set up the product

In the dashboard, open the product and turn on License key. Choose the activation limit and the validity. It applies to the next sales: past buyers keep the terms they bought with.

Call the API from your app

The app needs a publishable key (pk_). Create one under Developers. It can ship inside the app: it only activates, validates and deactivates keys the user already has. It lists nothing and never returns the buyer's name or e-mail. From your server, with the sk_, the answer includes the buyer too.

The fields and answers are Lemon Squeezy's: a form or JSON body.

Activate

curl https://api.beinfi.com/v1/licenses/activate \
  -H "Authorization: Bearer pk_live_..." \
  -d license_key=38B1460A-5104-4067-A91D-77B872934D51 \
  -d instance_name="Ana's MacBook"
{
  "activated": true,
  "error": null,
  "license_key": {
    "id": "…", "status": "active", "key": "38B1460A-…",
    "activation_limit": 2, "activation_usage": 1,
    "created_at": "2026-11-17T12:00:00Z", "expires_at": null, "test_mode": false
  },
  "instance": { "id": "a1b2…", "name": "Ana's MacBook", "created_at": "…" },
  "meta": { "store_id": "…", "order_id": "inv_…", "product_id": "prod_…", "product_name": "Plugin Pro" }
}

Keep instance.id in the app. Past the limit, the answer is 400 with "activated": false and "error": "This license key has reached the activation limit.".

Validate

curl https://api.beinfi.com/v1/licenses/validate \
  -H "Authorization: Bearer pk_live_..." \
  -d license_key=38B1460A-5104-4067-A91D-77B872934D51 \
  -d instance_id=a1b2...

"valid": true unlocks the app. A refunded, revoked or expired key answers 200 with "valid": false and the reason in error. An unknown key or instance answers 404.

Deactivate

curl https://api.beinfi.com/v1/licenses/deactivate \
  -H "Authorization: Bearer pk_live_..." \
  -d license_key=38B1460A-5104-4067-A91D-77B872934D51 \
  -d instance_id=a1b2...

Frees the slot so the user can activate another machine.

Errors

Besides Lemon Squeezy's error, every refusal carries an error_code:

error_codeWhen
license_key_not_foundThe key is not this store's.
license_instance_not_foundThe instance is not this key's.
license_activation_limitThe key is at its activation limit.
license_key_disabledRefunded, charged back or revoked.
license_key_expiredPast its validity, or the subscription ended.
license_keys_not_availableThe preview is not enabled on your account.

Each key takes about 60 calls a minute. Validate when the app starts, not on every click.

Coming from Lemon Squeezy

  1. In Lemon Squeezy, export your license keys (CSV).
  2. In the Infi dashboard, under Licenses → Import from Lemon Squeezy, upload the file and pick the product.
  3. In the app, replace https://api.lemonsqueezy.com with https://api.beinfi.com and send Authorization: Bearer pk_live_....

Imported keys keep working. Activations made on Lemon Squeezy hold their slots until the app deactivates them. If the app kept Lemon Squeezy's instance_id, it keeps validating and deactivating with that id.

An imported buyer is linked to your store's customer with the same e-mail, if there is one. The import creates no customers.