API Reference
Integrate LayerBuzz into your own tools and workflows. Use the API to validate licence keys, trigger checkouts, and more.
Overview
The LayerBuzz API is a REST API. All requests should be made over HTTPS. Responses are returned as JSON.
Base URL
https://layerbuzz.ayteelabs.com
Example request
curl -X GET "https://layerbuzz.ayteelabs.com/api/licences/validate?key=MYAPP-XXXX-XXXX-XXXX-XXXX"
Authentication
Public endpoints (licence validation, free checkout, discount validation) do not require authentication. They are designed to be called from your application or CLI tools on behalf of your users.
Licence Keys
Use these endpoints to validate and activate licence keys in your software. This is the core integration point for CLI tools and desktop apps sold through LayerBuzz.
Example — CLI activation
// Activate a licence key (call once, on first use)
const res = await fetch('https://layerbuzz.ayteelabs.com/api/licences/validate', {
method: 'POST',
headers: { 'content-type': 'application/json' },
body: JSON.stringify({
key: userEnteredKey,
increment_activation: true,
}),
})
const data = await res.json()
if (data.valid) {
// Save key locally and mark as activated
saveKeyLocally(data.licence.key)
} else {
console.error('Invalid key:', data.error)
}
// Validate on subsequent launches (no increment)
const res = await fetch(
`https://layerbuzz.ayteelabs.com/api/licences/validate?key=${savedKey}`
)
const data = await res.json()
// data.valid === true means key is still activeCheckout
Use the free checkout endpoint to programmatically trigger a free product delivery — useful for giveaways, lead magnets, or automated workflows.
Discounts
Validate discount codes before applying them to a checkout. This endpoint is called client-side when a buyer enters a discount code on the product page.
Errors
The API uses standard HTTP status codes. Errors return a JSON object with an error field describing what went wrong.
| Status | Meaning |
|---|---|
| 200 | Success |
| 400 | Bad request — missing or invalid parameters |
| 401 | Unauthorised — authentication required |
| 403 | Forbidden — download limit reached or key revoked |
| 404 | Not found — product, order, or key does not exist |
| 500 | Server error — something went wrong on our end |
Error response format
{
"error": "Invalid licence key"
}Handling errors in code
const res = await fetch('https://layerbuzz.ayteelabs.com/api/licences/validate', {
method: 'POST',
headers: { 'content-type': 'application/json' },
body: JSON.stringify({ key, increment_activation: true }),
})
if (!res.ok) {
const err = await res.json()
console.error('API error:', err.error)
return
}
const data = await res.json()
if (!data.valid) {
console.error('Invalid key:', data.error)
}