Appearance
Activate License
Activate a license on a specific url. Returns existing site if already activated (idempotent).
POST /public/v1/licenses/activateRequest
json
{
"public_key": "pk_your_public_key",
"license_key": "MYPLUGIN-XXXX-XXXX-XXXX-XXXX",
"url": "https://example.com"
}| Field | Required | Description |
|---|---|---|
public_key | Yes | Your product's public key |
license_key | Yes | The license key to activate |
url | Yes | URL to activate on |
Response
json
{
"success": true,
"site_id": "act_xxx",
"activated_at": "2026-02-06T12:00:00.000Z"
}Errors
| Status | Error |
|---|---|
| 400 | License is suspended |
| 400 | License has expired |
| 400 | License seat limit reached |
| 404 | Invalid public_key |
| 404 | License key not found |
Example
bash
curl -X POST https://api.packedge.dev/public/v1/licenses/activate \
-H "Content-Type: application/json" \
-d '{
"public_key": "pk_your_public_key",
"license_key": "MYPLUGIN-XXXX-XXXX-XXXX-XXXX",
"url": "https://example.com"
}'PHP Example
php
function activate_license($license_key) {
$response = wp_remote_post('https://api.packedge.dev/public/v1/licenses/activate', [
'body' => json_encode([
'public_key' => 'pk_your_public_key',
'license_key' => $license_key,
'url' => home_url(),
]),
'headers' => ['Content-Type' => 'application/json'],
]);
$body = json_decode(wp_remote_retrieve_body($response), true);
if (isset($body['success']) && $body['success']) {
update_option('my_plugin_site_id', $body['site_id']);
return true;
}
return false;
}Idempotency
If the license is already activated on the same url, the existing site is returned. This means calling activate multiple times is safe and won't consume additional seats.
