LuaSecureDocumentationDashboard ↗
For script owners / Documentation

API examples (owners)

Inspect an authorization response without executing its payload.

JavaScript / Node

Inspects both phases. Supply your own values and keep buyer keys out of logs.

const access = {
  script: "YOUR_SCRIPT_FILE_ID",
  key: "YOUR_LICENSE_KEY",
  hwid: "YOUR_DEVICE_ID"
};
async function authenticate(body) {
  const response = await fetch("https://luasecure.xyz/files/v4/auth", {
    method: "POST",
    headers: {"Content-Type": "application/json", "Accept": "application/json"},
    body: JSON.stringify(body)
  });
  const data = await response.json();
  if (!response.ok || !data.success) throw new Error(data.code || "HTTP " + response.status);
  return data;
}
const first = await authenticate(access);
const delivered = await authenticate({...access, ticket: first.ticket});
console.log({success: delivered.success, encoding: delivered.enc || "plain"});

Python

import json, urllib.request, urllib.error
access = {"script": "YOUR_SCRIPT_FILE_ID", "key": "YOUR_LICENSE_KEY", "hwid": "YOUR_DEVICE_ID"}
def authenticate(body):
    request = urllib.request.Request("https://luasecure.xyz/files/v4/auth",
        data=json.dumps(body).encode(),
        headers={"Content-Type": "application/json", "Accept": "application/json"}, method="POST")
    try:
        with urllib.request.urlopen(request, timeout=15) as response:
            result = json.load(response)
    except urllib.error.HTTPError as error:
        raise RuntimeError("Auth request failed: HTTP " + str(error.code)) from None
    if not result.get("success"):
        raise RuntimeError(result.get("code", "Auth failed"))
    return result
first = authenticate(access)
delivered = authenticate({**access, "ticket": first["ticket"]})
print({"success": delivered["success"], "encoding": delivered.get("enc", "plain")})

Postman

Import the collection, fill in script, key, and hwid, then send “Request ticket” and “Exchange ticket”. The first request stores the ticket automatically.

A successful check can bind an unused license to the supplied HWID. Use a dedicated test key, and clear local keys/tickets before sharing a collection.