Skip to main content
This guide walks you through the complete Avalex workflow from a fresh installation to your first successful license validation. By the end, you will have authenticated with the API, created a product and a customer, issued a license, and confirmed that the validation endpoint returns {"valid": true} — the signal your application will rely on at runtime. All examples use curl against the default base URL http://localhost:8080.
1

Log In and Obtain a JWT

Send your admin credentials to POST /auth/login. Avalex returns a JWT that is valid for 7 days. Copy the token value — you will pass it as a Bearer token in every subsequent authenticated request.
Response:
Store the token in an environment variable so you can reuse it cleanly across the steps below:
2

Create a Product

Define the software product you want to license. Set requiresLicense: true to enforce validation, and choose slot limits for IP addresses and hardware identifiers. Use null for either limit to allow unlimited activations.
Note the id field in the response (e.g., prod_67890). You will use it when issuing and validating licenses.
3

Create a Customer

Add the customer who will receive the license. At minimum, provide a display name and an email address.
Note the id field in the response (e.g., cust_11111). You will link this customer to the license in the next step.
4

Issue a License

Create a license that ties a specific product to a specific customer. Provide the expiration date as a Unix epoch timestamp in milliseconds.
The response includes the new license’s id (e.g., lic_12345). This is the value your end-user’s application will present at validation time.
5

Validate the License

Call POST /licenses/validate with the license ID, the product ID, and the hardware identifier computed on the end-user’s machine. This endpoint is public and unauthenticated — do not include credentials in your distributed application.
Success response (license is valid):
Response when the license is not valid (expired, wrong product, or slots exhausted):
If you exceed the rate limit (30 requests per minute per IP), the endpoint returns:
A valid: true response means the license passed all checks: the product ID matched, the license has not expired, and the IP and HWID slots were either already bound to this client or had room for a new binding.
Cache the last successful validation response locally on the end-user’s machine and allow a 24–72 hour grace period before blocking access. This keeps your application functional when the user is temporarily offline or your server is briefly unreachable, without meaningfully weakening license enforcement.

Next Steps

Integration Overview

Learn how to embed license validation into your application, handle edge cases like offline mode and HWID resets, and explore SDK examples for popular languages.