from kdpika_licensing import LicenseClient
client = LicenseClient(
product="YOUR_PUBLIC_APP_ID",
environment="SANDBOX",
base_url="https://licensing.kdpika.com",
application_name="Your Application",
application_version="1.0.0",
)
result = client.check()
if not result.valid and result.error_code == "NOT_ACTIVATED":
result = client.activate("YOUR-LICENSE-KEY", "customer@example.com")
if not result.valid:
raise SystemExit(f"{result.error_code}: {result.message}")
if result.feature("pdf_export"):
print("PDF export is permitted.")
<?php
// Run this on your backend, never in browser-delivered code.
require __DIR__ . '/vendor/autoload.php';
use KDPika\LicenseSdk\LicenseClient;
$client = new LicenseClient(product: 'YOUR_PUBLIC_APP_ID', environment: 'SANDBOX',
baseUrl: 'https://licensing.kdpika.com', applicationName: 'Your Application', applicationVersion: '1.0.0');
$result = $client->check();
if (!$result->valid && $result->errorCode === 'NOT_ACTIVATED')
$result = $client->activate('YOUR-LICENSE-KEY', 'customer@example.com');
if (!$result->valid) throw new RuntimeException("$result->errorCode: $result->message");
import {LicenseClient} from "@kdpika/license-sdk";
const client = new LicenseClient({product:"YOUR_PUBLIC_APP_ID", environment:"SANDBOX",
baseUrl:"https://licensing.kdpika.com", applicationName:"Your Application", applicationVersion:"1.0.0"});
let result = await client.check();
if (!result.valid && result.errorCode === "NOT_ACTIVATED")
result = await client.activate("YOUR-LICENSE-KEY", "customer@example.com");
if (!result.valid) throw new Error(`${result.errorCode}: ${result.message}`);
POST https://licensing.kdpika.com/api/v1/licenses/activate
Content-Type: application/json
X-App-ID: YOUR_PUBLIC_APP_ID
X-Environment: SANDBOX
{
"license_key": "YOUR-LICENSE-KEY",
"email": "customer@example.com",
"device_id": "YOUR-STABLE-RANDOM-INSTALLATION-ID",
"device_name": "Your Application",
"platform": "your-platform",
"app_version": "1.0.0",
"fingerprint": {
"version": 1,
"hardware_id": "YOUR_COMBINED_SHA256_HASH",
"components": {"baseboard": "YOUR_PRODUCT_SALTED_SHA256_HASH", "cpu": "YOUR_PRODUCT_SALTED_SHA256_HASH"},
"is_virtual": null
}
}
IMPLEMENTATION CHECKLIST
1. This is a REST contract template, not a complete executable SDK.
Derive the required product-salted hardware hashes; never send the placeholders above.
See /docs/v1/licensing/hardware-fingerprint. Use an HTTPS client and JSON encoder.
2. Generate one random installation ID, persist it, and reuse it.
3. Verify the signed response, product/environment, times and device binding before
enabling features. Protect activation_token in the operating-system credential store.
4. Validate with the activation token, X-Installation-ID and current fingerprint. Never send raw serials.
5. Deactivate with POST /api/v1/licenses/deactivate when releasing the device.
6. For offline access, verify canonical JSON + Ed25519; otherwise keep authorization online.
POST https://licensing.kdpika.com/api/v1/licenses/activate
Content-Type: application/json
X-App-ID: YOUR_PUBLIC_APP_ID
X-Environment: SANDBOX
{
"license_key": "YOUR-LICENSE-KEY",
"email": "customer@example.com",
"device_id": "YOUR-STABLE-RANDOM-INSTALLATION-ID",
"device_name": "Your Application",
"platform": "your-platform",
"app_version": "1.0.0",
"fingerprint": {
"version": 1,
"hardware_id": "YOUR_COMBINED_SHA256_HASH",
"components": {"baseboard": "YOUR_PRODUCT_SALTED_SHA256_HASH", "cpu": "YOUR_PRODUCT_SALTED_SHA256_HASH"},
"is_virtual": null
}
}
IMPLEMENTATION CHECKLIST
1. This is a REST contract template, not a complete executable SDK.
Derive the required product-salted hardware hashes; never send the placeholders above.
See /docs/v1/licensing/hardware-fingerprint. Use an HTTPS client and JSON encoder.
2. Generate one random installation ID, persist it, and reuse it.
3. Verify the signed response, product/environment, times and device binding before
enabling features. Protect activation_token in the operating-system credential store.
4. Validate with the activation token, X-Installation-ID and current fingerprint. Never send raw serials.
5. Deactivate with POST /api/v1/licenses/deactivate when releasing the device.
6. For offline access, verify canonical JSON + Ed25519; otherwise keep authorization online.
using KDPika.LicenseSdk;
var client = new LicenseClient("YOUR_PUBLIC_APP_ID", "SANDBOX", "https://licensing.kdpika.com", "Your Application", "1.0.0");
var result = await client.CheckAsync();
if (!result.Valid && result.ErrorCode == "NOT_ACTIVATED")
result = await client.ActivateAsync("YOUR-LICENSE-KEY", "customer@example.com");
if (!result.Valid) throw new Exception($"{result.ErrorCode}: {result.Message}");
POST https://licensing.kdpika.com/api/v1/licenses/activate
Content-Type: application/json
X-App-ID: YOUR_PUBLIC_APP_ID
X-Environment: SANDBOX
{
"license_key": "YOUR-LICENSE-KEY",
"email": "customer@example.com",
"device_id": "YOUR-STABLE-RANDOM-INSTALLATION-ID",
"device_name": "Your Application",
"platform": "your-platform",
"app_version": "1.0.0",
"fingerprint": {
"version": 1,
"hardware_id": "YOUR_COMBINED_SHA256_HASH",
"components": {"baseboard": "YOUR_PRODUCT_SALTED_SHA256_HASH", "cpu": "YOUR_PRODUCT_SALTED_SHA256_HASH"},
"is_virtual": null
}
}
IMPLEMENTATION CHECKLIST
1. This is a REST contract template, not a complete executable SDK.
Derive the required product-salted hardware hashes; never send the placeholders above.
See /docs/v1/licensing/hardware-fingerprint. Use an HTTPS client and JSON encoder.
2. Generate one random installation ID, persist it, and reuse it.
3. Verify the signed response, product/environment, times and device binding before
enabling features. Protect activation_token in the operating-system credential store.
4. Validate with the activation token, X-Installation-ID and current fingerprint. Never send raw serials.
5. Deactivate with POST /api/v1/licenses/deactivate when releasing the device.
6. For offline access, verify canonical JSON + Ed25519; otherwise keep authorization online.
POST https://licensing.kdpika.com/api/v1/licenses/activate
Content-Type: application/json
X-App-ID: YOUR_PUBLIC_APP_ID
X-Environment: SANDBOX
{
"license_key": "YOUR-LICENSE-KEY",
"email": "customer@example.com",
"device_id": "YOUR-STABLE-RANDOM-INSTALLATION-ID",
"device_name": "Your Application",
"platform": "your-platform",
"app_version": "1.0.0",
"fingerprint": {
"version": 1,
"hardware_id": "YOUR_COMBINED_SHA256_HASH",
"components": {"baseboard": "YOUR_PRODUCT_SALTED_SHA256_HASH", "cpu": "YOUR_PRODUCT_SALTED_SHA256_HASH"},
"is_virtual": null
}
}
IMPLEMENTATION CHECKLIST
1. This is a REST contract template, not a complete executable SDK.
Derive the required product-salted hardware hashes; never send the placeholders above.
See /docs/v1/licensing/hardware-fingerprint. Use an HTTPS client and JSON encoder.
2. Generate one random installation ID, persist it, and reuse it.
3. Verify the signed response, product/environment, times and device binding before
enabling features. Protect activation_token in the operating-system credential store.
4. Validate with the activation token, X-Installation-ID and current fingerprint. Never send raw serials.
5. Deactivate with POST /api/v1/licenses/deactivate when releasing the device.
6. For offline access, verify canonical JSON + Ed25519; otherwise keep authorization online.
POST https://licensing.kdpika.com/api/v1/licenses/activate
Content-Type: application/json
X-App-ID: YOUR_PUBLIC_APP_ID
X-Environment: SANDBOX
{
"license_key": "YOUR-LICENSE-KEY",
"email": "customer@example.com",
"device_id": "YOUR-STABLE-RANDOM-INSTALLATION-ID",
"device_name": "Your Application",
"platform": "your-platform",
"app_version": "1.0.0",
"fingerprint": {
"version": 1,
"hardware_id": "YOUR_COMBINED_SHA256_HASH",
"components": {"baseboard": "YOUR_PRODUCT_SALTED_SHA256_HASH", "cpu": "YOUR_PRODUCT_SALTED_SHA256_HASH"},
"is_virtual": null
}
}
IMPLEMENTATION CHECKLIST
1. This is a REST contract template, not a complete executable SDK.
Derive the required product-salted hardware hashes; never send the placeholders above.
See /docs/v1/licensing/hardware-fingerprint. Use an HTTPS client and JSON encoder.
2. Generate one random installation ID, persist it, and reuse it.
3. Verify the signed response, product/environment, times and device binding before
enabling features. Protect activation_token in the operating-system credential store.
4. Validate with the activation token, X-Installation-ID and current fingerprint. Never send raw serials.
5. Deactivate with POST /api/v1/licenses/deactivate when releasing the device.
6. For offline access, verify canonical JSON + Ed25519; otherwise keep authorization online.
use kdpika_licensing::{Environment, ErrorCode, LicenseClient};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let environment = if "SANDBOX" == "LIVE" { Environment::Live } else { Environment::Sandbox };
let client = LicenseClient::builder("YOUR_PUBLIC_APP_ID")
.base_url("https://licensing.kdpika.com")
.environment(environment)
.application_name("Your Application")
.application_version("1.0.0")
.build()?;
let mut result = client.check();
if result.error_code() == Some(ErrorCode::NotActivated) {
result = client.activate("YOUR-LICENSE-KEY", Some("customer@example.com"));
}
if !result.valid() {
eprintln!("{}", result.message());
return Ok(());
}
if result.feature("pdf_export") {
println!("PDF export is included.");
}
Ok(())
}
POST https://licensing.kdpika.com/api/v1/licenses/activate
Content-Type: application/json
X-App-ID: YOUR_PUBLIC_APP_ID
X-Environment: SANDBOX
{
"license_key": "YOUR-LICENSE-KEY",
"email": "customer@example.com",
"device_id": "YOUR-STABLE-RANDOM-INSTALLATION-ID",
"device_name": "Your Application",
"platform": "your-platform",
"app_version": "1.0.0",
"fingerprint": {
"version": 1,
"hardware_id": "YOUR_COMBINED_SHA256_HASH",
"components": {"baseboard": "YOUR_PRODUCT_SALTED_SHA256_HASH", "cpu": "YOUR_PRODUCT_SALTED_SHA256_HASH"},
"is_virtual": null
}
}
IMPLEMENTATION CHECKLIST
1. This is a REST contract template, not a complete executable SDK.
Derive the required product-salted hardware hashes; never send the placeholders above.
See /docs/v1/licensing/hardware-fingerprint. Use an HTTPS client and JSON encoder.
2. Generate one random installation ID, persist it, and reuse it.
3. Verify the signed response, product/environment, times and device binding before
enabling features. Protect activation_token in the operating-system credential store.
4. Validate with the activation token, X-Installation-ID and current fingerprint. Never send raw serials.
5. Deactivate with POST /api/v1/licenses/deactivate when releasing the device.
6. For offline access, verify canonical JSON + Ed25519; otherwise keep authorization online.
POST https://licensing.kdpika.com/api/v1/licenses/activate
Content-Type: application/json
X-App-ID: YOUR_PUBLIC_APP_ID
X-Environment: SANDBOX
{
"license_key": "YOUR-LICENSE-KEY",
"email": "customer@example.com",
"device_id": "YOUR-STABLE-RANDOM-INSTALLATION-ID",
"device_name": "Your Application",
"platform": "your-platform",
"app_version": "1.0.0",
"fingerprint": {
"version": 1,
"hardware_id": "YOUR_COMBINED_SHA256_HASH",
"components": {"baseboard": "YOUR_PRODUCT_SALTED_SHA256_HASH", "cpu": "YOUR_PRODUCT_SALTED_SHA256_HASH"},
"is_virtual": null
}
}
IMPLEMENTATION CHECKLIST
1. This is a REST contract template, not a complete executable SDK.
Derive the required product-salted hardware hashes; never send the placeholders above.
See /docs/v1/licensing/hardware-fingerprint. Use an HTTPS client and JSON encoder.
2. Generate one random installation ID, persist it, and reuse it.
3. Verify the signed response, product/environment, times and device binding before
enabling features. Protect activation_token in the operating-system credential store.
4. Validate with the activation token, X-Installation-ID and current fingerprint. Never send raw serials.
5. Deactivate with POST /api/v1/licenses/deactivate when releasing the device.
6. For offline access, verify canonical JSON + Ed25519; otherwise keep authorization online.
POST https://licensing.kdpika.com/api/v1/licenses/activate
Content-Type: application/json
X-App-ID: YOUR_PUBLIC_APP_ID
X-Environment: SANDBOX
{
"license_key": "YOUR-LICENSE-KEY",
"email": "customer@example.com",
"device_id": "YOUR-STABLE-RANDOM-INSTALLATION-ID",
"device_name": "Your Application",
"platform": "your-platform",
"app_version": "1.0.0",
"fingerprint": {
"version": 1,
"hardware_id": "YOUR_COMBINED_SHA256_HASH",
"components": {"baseboard": "YOUR_PRODUCT_SALTED_SHA256_HASH", "cpu": "YOUR_PRODUCT_SALTED_SHA256_HASH"},
"is_virtual": null
}
}
IMPLEMENTATION CHECKLIST
1. This is a REST contract template, not a complete executable SDK.
Derive the required product-salted hardware hashes; never send the placeholders above.
See /docs/v1/licensing/hardware-fingerprint. Use an HTTPS client and JSON encoder.
2. Generate one random installation ID, persist it, and reuse it.
3. Verify the signed response, product/environment, times and device binding before
enabling features. Protect activation_token in the operating-system credential store.
4. Validate with the activation token, X-Installation-ID and current fingerprint. Never send raw serials.
5. Deactivate with POST /api/v1/licenses/deactivate when releasing the device.
6. For offline access, verify canonical JSON + Ed25519; otherwise keep authorization online.
POST https://licensing.kdpika.com/api/v1/licenses/activate
Content-Type: application/json
X-App-ID: YOUR_PUBLIC_APP_ID
X-Environment: SANDBOX
{
"license_key": "YOUR-LICENSE-KEY",
"email": "customer@example.com",
"device_id": "YOUR-STABLE-RANDOM-INSTALLATION-ID",
"device_name": "Your Application",
"platform": "your-platform",
"app_version": "1.0.0",
"fingerprint": {
"version": 1,
"hardware_id": "YOUR_COMBINED_SHA256_HASH",
"components": {"baseboard": "YOUR_PRODUCT_SALTED_SHA256_HASH", "cpu": "YOUR_PRODUCT_SALTED_SHA256_HASH"},
"is_virtual": null
}
}
IMPLEMENTATION CHECKLIST
1. This is a REST contract template, not a complete executable SDK.
Derive the required product-salted hardware hashes; never send the placeholders above.
See /docs/v1/licensing/hardware-fingerprint. Use an HTTPS client and JSON encoder.
2. Generate one random installation ID, persist it, and reuse it.
3. Verify the signed response, product/environment, times and device binding before
enabling features. Protect activation_token in the operating-system credential store.
4. Validate with the activation token, X-Installation-ID and current fingerprint. Never send raw serials.
5. Deactivate with POST /api/v1/licenses/deactivate when releasing the device.
6. For offline access, verify canonical JSON + Ed25519; otherwise keep authorization online.
POST https://licensing.kdpika.com/api/v1/licenses/activate
Content-Type: application/json
X-App-ID: YOUR_PUBLIC_APP_ID
X-Environment: SANDBOX
{
"license_key": "YOUR-LICENSE-KEY",
"email": "customer@example.com",
"device_id": "YOUR-STABLE-RANDOM-INSTALLATION-ID",
"device_name": "Your Application",
"platform": "your-platform",
"app_version": "1.0.0",
"fingerprint": {
"version": 1,
"hardware_id": "YOUR_COMBINED_SHA256_HASH",
"components": {"baseboard": "YOUR_PRODUCT_SALTED_SHA256_HASH", "cpu": "YOUR_PRODUCT_SALTED_SHA256_HASH"},
"is_virtual": null
}
}
IMPLEMENTATION CHECKLIST
1. This is a REST contract template, not a complete executable SDK.
Derive the required product-salted hardware hashes; never send the placeholders above.
See /docs/v1/licensing/hardware-fingerprint. Use an HTTPS client and JSON encoder.
2. Generate one random installation ID, persist it, and reuse it.
3. Verify the signed response, product/environment, times and device binding before
enabling features. Protect activation_token in the operating-system credential store.
4. Validate with the activation token, X-Installation-ID and current fingerprint. Never send raw serials.
5. Deactivate with POST /api/v1/licenses/deactivate when releasing the device.
6. For offline access, verify canonical JSON + Ed25519; otherwise keep authorization online.
{
"success": true,
"activation_token": "act_...",
"license": {
"payload": {"status":"active","features":{"pdf_export":true}},
"signature": "base64url...",
"algorithm": "Ed25519",
"key_id": "ed25519_..."
},
"request_id": "req_example"
}