Activations
Activations track which sites are using a license. When a customer installs your plugin and enters their license key, the site is activated against the license.
How It Works
- Customer enters license key in your WordPress plugin
- Plugin calls the activate endpoint with the key and domain
- PackEdge verifies the license is valid and has available seats
- An activation record is created, tracking the domain and IP
activatedCounton the license is incremented
Activate
POST https://api.packedge.dev/v1/licenses/activatejson
{
"license_key": "MYPLUGIN-XXXX-XXXX-XXXX-XXXX",
"domain": "https://example.com"
}Response:
json
{
"success": true,
"activation_id": "act_xxx"
}If the same domain is already activated, the existing activation is reused (idempotent).
Deactivate
POST https://api.packedge.dev/v1/licenses/deactivatejson
{
"license_key": "MYPLUGIN-XXXX-XXXX-XXXX-XXXX",
"domain": "https://example.com"
}Seat Limits
Each license has a seats field defining the maximum number of concurrent activations. When the limit is reached, new activations are rejected with an error.
Activation Status
| Status | Description |
|---|---|
active | Currently using the license |
deactivated | Previously active, now deactivated |
Managing Activations
In the dashboard, you can view all activations for a license and manually deactivate any of them. Revoking a license automatically deactivates all its activations.
PHP Example
php
function activate_license($key) {
$response = wp_remote_post('https://api.packedge.dev/v1/licenses/activate', [
'body' => json_encode([
'license_key' => $key,
'domain' => home_url(),
]),
'headers' => ['Content-Type' => 'application/json'],
]);
$body = json_decode(wp_remote_retrieve_body($response), true);
return $body['success'] ?? false;
}
function deactivate_license($key) {
$response = wp_remote_post('https://api.packedge.dev/v1/licenses/deactivate', [
'body' => json_encode([
'license_key' => $key,
'domain' => home_url(),
]),
'headers' => ['Content-Type' => 'application/json'],
]);
$body = json_decode(wp_remote_retrieve_body($response), true);
return $body['success'] ?? false;
}