Skip to content

Check licenses from your app

Your software asks one question: what is this client licensed for? It sends only public values, so it never holds a secret that could be extracted.

GET https://laasio.functual.com/api/v1/lookup?org=<organization id>&client=<client id>[&app=<application id>]
Accept: application/json
Parameter Required Description
org yes Your public organization ID (lzo_…), from LaaSio → Settings.
client yes The client’s ID: your own identifier for this install, machine or customer.
app no An application ID. Returns only that application’s licenses and enables auto-provisioning.

From a terminal:

Terminal window
curl -H 'Accept: application/json' 'https://laasio.functual.com/api/v1/lookup?org=lzo_YOUR_ORG_ID&client=PC-123'

The same lookup as a POST with a JSON body can also carry an activation key and client attributes: data your software reports about itself, such as its version.

One entry per license granted by each SKU the client holds:

{ "data": [ {
"clientId": "PC-123",
"name": "av-realtime",
"displayName": "Real-time Protection",
"type": "Paid",
"start": "2026-10-28T00:00:00Z",
"end": "2027-10-29T00:00:00Z",
"limits": { "devices": 25, "scans_per_day": null },
"issued": "2026-10-28T14:32:05Z",
"keyVersion": 1,
"key": "<base64 Ed25519 signature>"
} ] }
Field Meaning
clientId The client the entry was issued for. It is signed, so an entry can’t be moved to another client.
name, displayName The license’s stable name (map it to a feature) and its label.
type Free, Trial, Paid, NFR, Internal or Educational. Automatic trials report Paid licenses as Trial.
start, end The term, in UTC. end: null means perpetual.
limits Limits that apply to this license, by name. null = not set by the SKU (your software decides, usually no limit). A missing key means the limit doesn’t apply. Always an object, {} when none apply.
issued When this answer was produced. Use it to reject stale cached copies.
keyVersion, key The signing key’s version and the Ed25519 signature. See Verify signatures.
  • Verify every entry before trusting it, and check that clientId matches the client you asked about.
  • Compare start and end with the current time yourself. The answer includes expired and not-yet-started terms, so you can tell “expired” from “never licensed” and show the right message.
  • {"data": []} means not licensed. Unknown organizations, applications and clients get the same empty answer, so the endpoint can’t be used to discover which IDs exist.
  • Keep working when LaaSio can’t be reached. Save the last verified answer and fall back to it; see below.

A network outage, a firewall or an offline machine shouldn’t lock a paying customer out. Because every entry is signed, a saved answer is just as trustworthy as a fresh one, so your software can keep running from it.

  1. Save every verified answer, for example in a file in your app’s data folder. No encryption is needed: the signature covers every field, so an edited file fails verification.
  2. Fall back only when the lookup fails: a network error, a timeout, a 5xx or a 429. A 200 is always the current truth, even when it says the client is no longer licensed, so replace the saved answer with it.
  3. Verify the saved answer again when you load it, and check clientId, start and end against the current time exactly as you would for a fresh answer. A term that has ended while offline has still ended.
  4. Decide how long an answer may be used offline, based on its issued time: for example 7 days for a subscription product, 30 or more for software that often runs without a connection. Past that, ask the user to connect.
  5. Distrust a clock that runs backwards. If the current time is earlier than the saved answer’s issued, the computer’s clock was probably set back to stretch the offline period. Ask the user to connect.

Lookups that keep failing are worth logging, so you can tell a customer’s firewall from an outage.

This example is the one from Verify signatures with these rules added. It is tested against LaaSio both online and with LaaSio unreachable.

// Node.js 18+, save as licenses.mjs. The verify example, plus a saved answer for when LaaSio can't be reached.
import { createPublicKey, verify } from "node:crypto";
import { readFileSync, writeFileSync } from "node:fs";
const LAASIO_URL = "https://laasio.functual.com";
const ORG_ID = "lzo_YOUR_ORG_ID";
const SAVED_ANSWER = "laasio-answer.json"; // the last answer, saved after every lookup; use one file per client
const MAX_OFFLINE_MS = 7 * 24 * 60 * 60 * 1000; // how long a saved answer may be used without reaching LaaSio: your choice
const PUBLIC_KEY = createPublicKey({
key: Buffer.concat([Buffer.from("302a300506032b6570032100", "hex"), Buffer.from("YOUR_PUBLIC_KEY_BASE64", "base64")]),
format: "der",
type: "spki",
});
// Keys sorted at every level; JSON.stringify adds no whitespace and leaves "/" and Unicode as-is
function canonical(value) {
if (Array.isArray(value)) return value.map(canonical);
if (value && typeof value === "object") {
return Object.fromEntries(Object.keys(value).sort().map((k) => [k, canonical(value[k])]));
}
return value;
}
/** The lookup answer as text, or null when LaaSio can't be reached (network error, timeout, 5xx, 429). */
async function fetchAnswer(clientId) {
const url = `${LAASIO_URL}/api/v1/lookup?${new URLSearchParams({ org: ORG_ID, client: clientId })}`;
let response;
try {
response = await fetch(url, { headers: { Accept: "application/json" }, signal: AbortSignal.timeout(10_000) });
} catch {
return null;
}
if (response.status === 429 || response.status >= 500) return null;
if (!response.ok) throw new Error(`LaaSio ${response.status}`); // a bad request: fix it, don't fall back
return response.text();
}
/** The entries of an answer whose signature is valid for this client. */
function verified(answer, clientId) {
return JSON.parse(answer).data.filter(({ key, ...signed }) =>
signed.clientId === clientId &&
verify(null, Buffer.from(JSON.stringify(canonical(signed))), PUBLIC_KEY, Buffer.from(key, "base64")));
}
/** The client's verified licenses from LaaSio, or from the saved answer when LaaSio can't be reached. */
export async function getLicenses(clientId, now = new Date()) {
const fresh = await fetchAnswer(clientId);
if (fresh !== null) {
writeFileSync(SAVED_ANSWER, fresh); // a 200 is the current truth, even "not licensed"
return { source: "LaaSio", licenses: verified(fresh, clientId) };
}
let saved;
try {
saved = readFileSync(SAVED_ANSWER, "utf8");
} catch {
throw new Error("LaaSio can't be reached and there is no saved answer");
}
const licenses = verified(saved, clientId); // an edited file fails verification
for (const { issued } of licenses) {
const age = now - new Date(issued);
if (age < 0) throw new Error("The clock is earlier than the saved answer: connect to LaaSio");
if (age > MAX_OFFLINE_MS) throw new Error("The saved answer is too old: connect to LaaSio");
}
return { source: "saved answer", licenses };
}
/** A license is active from its start until its end (end null = never expires). */
export function isActive(license, now = new Date()) {
return new Date(license.start) <= now && (license.end === null || now < new Date(license.end));
}
const { source, licenses } = await getLicenses("PC-123");
console.log(`From ${source}:`);
for (const license of licenses.filter((l) => isActive(l))) {
console.log(license.name, license.type, license.limits);
}
Status When What to do
200 Always for a valid request, licensed or not Read data.
422 org or client missing or too long Fix the request.
429 More than 60 lookups a minute from one IP address Back off and retry later; use your saved answer meanwhile.

Lookups are never blocked or slowed because of your plan: going over your plan’s limits doesn’t affect your customers. See Plans and limits.