规划中 · 第二阶段
License API
将卡密激活集成到你的软件或网站中。每个产品都有独立的 API 密钥;授权绑定到硬件 ID(桌面应用)或域名(网页应用)。
接口
POST/api/v1/licenses/activate首次使用时将卡密绑定到设备(HWID)或域名,并开始计算授权时长。
POST/api/v1/licenses/validate每次启动应用时校验卡密,返回状态、到期时间和套餐。
POST/api/v1/licenses/reset-hwid解除设备绑定,让卡密可以在新电脑上使用(需要 HWID 重置卡密)。
请求
POST /api/v1/licenses/validate
Authorization: Bearer <PRODUCT_API_KEY>
Content-Type: application/json
{
"key": "ARCS-7K2QM-PX9RT-4HVNA-ZD3WE",
"hwid": "b4f1c9…e02", // device fingerprint, or "domain" for websites
"version": "1.4.2"
}响应
200 OK
{
"valid": true,
"status": "active", // active | expired | banned | hwid_mismatch
"product": "arc-studio",
"plan": "1 Month Key",
"expiresAt": "2026-11-22T13:05:00Z",
"signature": "ed25519:…" // verify offline with the public key
}客户端示例
// Node / Electron example
const res = await fetch("https://your-shop.com/api/v1/licenses/validate", {
method: "POST",
headers: { "Content-Type": "application/json", Authorization: `Bearer ${PRODUCT_API_KEY}` },
body: JSON.stringify({ key, hwid: await getHwid(), version: app.getVersion() }),
});
const lic = await res.json();
if (!lic.valid) showActivationScreen(lic.status);