Overview
Protect your work with our modern license system. You can easily validate licenses via our REST API using just a few lines of code.
API Endpoint
To validate a license, send a POST request to:
https://api.craftingstudiopro.de/v1/license/validate
Authentication
All license validation requests require a Developer API Key in the header:
Important: Never share your developer API key publicly (e.g., on GitHub).
Request & Response
Request Body (JSON)
{
"licenseKey": "XXXX-XXXX-XXXX-XXXX",
"pluginId": "your-plugin-slug-or-id"
}
Success Response Example
{
"valid": true,
"message": null,
"purchase": {
"id": "123",
"userId": "456",
"pluginId": "789",
"createdAt": "2024-03-09T10:00:00Z"
}
}
Java Implementation
For Minecraft plugin developers, here is a simple validator class using Java’s HttpClient:
public class LicenseValidator {
private static final String API_URL = "https://api.craftingstudiopro.de/v1/license/validate";
private static final String API_KEY = "YOUR_DEVELOPER_API_KEY";
public boolean validate(String licenseKey, String pluginSlug) {
try {
HttpClient client = HttpClient.newHttpClient();
String json = String.format("{\"licenseKey\": \"%s\", \"pluginId\": \"%s\"}",
licenseKey, pluginSlug);
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(API_URL))
.header("Content-Type", "application/json")
.header("X-API-Key", API_KEY)
.POST(HttpRequest.BodyPublishers.ofString(json))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
// Check if status is 200 and response contains "valid":true
return response.statusCode() == 200 && response.body().contains("\"valid\":true");
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
}
Fast Validation
Validation takes less than 200ms on average.
Slug Support
You can use either the numeric ID or the plugin slug as the pluginId.