Getting started

SoftLicense issues license keys for your software, validates them from your app, and keeps them in sync with your billing. This page walks through the four concepts and the ten-minute integration.

Concepts

ConceptWhat it is
ProductOne of your applications. Has a key prefix (e.g. ACME-…) and an Ed25519 signing key for offline certificates.
PolicyA reusable rule set: duration, machine limit, node-locked vs floating, grace period, what happens after expiry, and the entitlements returned to your app.
LicenseA key issued from a policy to a customer. Can be suspended, reinstated, extended, renewed or revoked.
ActivationA machine (identified by a fingerprint you choose) that holds one of a license's seats.

Integrate in ten minutes

  1. Create a product and a policy in the dashboard (onboarding does this for you).
  2. Issue a license, or map a Stripe price so checkouts issue them automatically.
  3. In your app, call POST /api/v1/licenses/activate once with a stable machine fingerprint, then POST /api/v1/licenses/validate on launch. Read data.valid, data.code and data.entitlements.
  4. Optionally download an offline certificate for air-gapped installs and verify it with the product public key.
curl -X POST http://localhost:3000/api/v1/licenses/validate \
  -H "Content-Type: application/json" \
  -d '{"key":"ACME-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX","fingerprint":"<machine-id>","nonce":"<random>"}'

Two APIs

Public license API (/api/v1/licenses/*): called from end-user machines, authenticated by the license key itself, rate limited, and every response is signed. Management API (/api/v1/* with Authorization: Bearer sl_live_…): called from your backend to create and manage licenses, customers, products, policies and webhooks. See the API reference.

Response envelope

{ "ok": true,  "data": { ... } }
{ "ok": false, "error": { "code": "NO_SEATS", "message": "All activation seats for this license are in use." } }

Validation codes

CodevalidMeaning
VALIDtrueEverything checks out.
IN_GRACEtrueExpired, but inside the policy grace period.
EXPIRED_RESTRICTEDtrueExpired; policy says keep running with the restricted entitlements.
EXPIRED, SUSPENDED, REVOKEDfalseStop or degrade the app.
NO_SEATSfalseActivation refused: all machines are in use.
FINGERPRINT_REQUIRED, FINGERPRINT_NOT_ACTIVATEDfalseActivate this machine first.
LEASE_EXPIRED, HEARTBEAT_EXPIREDfalseThe seat lapsed; activate again.
NOT_FOUND, MALFORMED_KEY, PRODUCT_MISMATCHfalseWrong key or wrong product.