Guide
Generate Keys via API
Generate license keys programmatically from your website or backend after a purchase.
Generate a Single Key
POST/api/v1/licenses/generate
x-api-keyrequiredheader
Your application API key
product_idstring
Assign a product to this key
expires_in_daysnumber
Days until expiry after first activation
max_usesnumber
Max number of activations
prefixstring
Custom prefix for the key e.g. PRO
Python — After Stripe Payment
python
import requests
def generate_license_after_purchase(product_id, customer_email):
r = requests.post(
"https://authorized.lol/api/v1/licenses/generate",
headers={"x-api-key": "your_api_key"},
json={
"product_id": product_id,
"expires_in_days": 30,
"email": customer_email,
"prefix": "PRO"
}
)
data = r.json()
return data["license_key"] # e.g. "PRO-XXXXX-XXXXX-XXXXX"
# In your Stripe webhook:
key = generate_license_after_purchase("uuid-of-pro-plan", "user@example.com")
send_email(customer_email, f"Your license key: {key}")Bulk Generate
POST/api/v1/licenses/bulk
python
r = requests.post(
"https://authorized.lol/api/v1/licenses/bulk",
headers={"x-api-key": "your_api_key"},
json={"quantity": 50, "product_id": "uuid", "expires_in_days": 30}
)
keys = r.json()["licenses"] # list of 50 keysWarning:Free accounts are limited to 20 total license keys. Upgrade to VIP for unlimited generation.