Validate a key
Check that a key, and optionally one device's activation, is still good.
/api/v1/licenses/validateDoesn't use an activation. Call it on launch, at most once a day. With instance_id, it also confirms that this device's activation still exists and records when it was last seen.
Request
license_keystringrequiredThe key.
instance_idstringoptionalThe instance.id you got from activate. Send it to check this device, not just the key.
product_idstringoptionalYour product's link or id. When sent, a key for a different product is not valid.
curl https://shop.example.com/api/v1/licenses/validate \
-d license_key="7KQ2M-XW9PA-4TB8N-R2HDE" \
-d instance_id="inst_8fq2…" \
-d product_id="pastepal"const response = await fetch("https://shop.example.com/api/v1/licenses/validate", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
license_key: "7KQ2M-XW9PA-4TB8N-R2HDE",
instance_id: "inst_8fq2…",
product_id: "pastepal",
}),
});
const result = await response.json();var request = URLRequest(url: URL(string: "https://shop.example.com/api/v1/licenses/validate")!)
request.httpMethod = "POST"
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.httpBody = try JSONEncoder().encode([
"license_key": "7KQ2M-XW9PA-4TB8N-R2HDE",
"instance_id": "inst_8fq2…",
"product_id": "pastepal",
])
let (data, _) = try await URLSession.shared.data(for: request)import requests
result = requests.post("https://shop.example.com/api/v1/licenses/validate", json={
"license_key": "7KQ2M-XW9PA-4TB8N-R2HDE",
"instance_id": "inst_8fq2…",
"product_id": "pastepal",
}, timeout=10).json()Response
200, with valid saying whether to unlock. A disabled, expired or wrong-product key is still 200, with valid: false and an error: check valid, not the status code.
{
"valid": true,
"error": null,
"license_key": {
"id": "lic_3k9x…",
"status": "active",
"key": "7KQ2M-XW9PA-4TB8N-R2HDE",
"activation_limit": 3,
"activation_usage": 1,
"created_at": "2026-11-17T09:51:52.000Z",
"expires_at": null
},
"instance": {
"id": "inst_8fq2…",
"name": "Ada's MacBook Pro",
"created_at": "2026-11-17T09:55:01.000Z"
},
"meta": {
"store_id": "4b1c…",
"order_id": "ord_q3fq…",
"order_number": 1042,
"product_id": "prod_s64g…",
"product_name": "PastePal",
"variant_id": "var_82vd…",
"variant_name": "Family",
"customer_id": "cus_ea3j…",
"customer_name": "Ada Lovelace",
"customer_email": "ada@example.com"
}
}{
"valid": false,
"error": "This license key has been disabled.",
"instance": { "id": "inst_8fq2…", "name": "Ada's MacBook Pro", "created_at": "2026-11-17T09:55:01.000Z" },
"license_key": { "status": "disabled", "…": "…" },
"meta": { "…": "…" }
}If instance_id doesn't belong to this key (for example the buyer freed this device from their purchases), the answer is 404 with valid: false. Ask the user to activate again.