Appearance
Deactivate License
Deactivate a license from a domain, freeing up a seat.
POST /public/v1/licenses/deactivateRequest
json
{
"public_key": "pk_your_public_key",
"license_key": "MYPLUGIN-XXXX-XXXX-XXXX-XXXX",
"domain": "https://example.com"
}| Field | Required | Description |
|---|---|---|
public_key | Yes | Your product's public key |
license_key | Yes | The license key to deactivate |
domain | Conditional | Domain to deactivate (required if no activation_id) |
activation_id | Conditional | Activation ID (required if no domain) |
Response
json
{
"success": true,
"message": "Activation deactivated"
}Example
bash
curl -X POST https://api.packedge.dev/public/v1/licenses/deactivate \
-H "Content-Type: application/json" \
-d '{
"public_key": "pk_your_public_key",
"license_key": "MYPLUGIN-XXXX-XXXX-XXXX-XXXX",
"domain": "https://example.com"
}'PHP Example
php
function deactivate_license($license_key) {
$response = wp_remote_post('https://api.packedge.dev/public/v1/licenses/deactivate', [
'body' => json_encode([
'public_key' => 'pk_your_public_key',
'license_key' => $license_key,
'domain' => home_url(),
]),
'headers' => ['Content-Type' => 'application/json'],
]);
$body = json_decode(wp_remote_retrieve_body($response), true);
if (isset($body['success']) && $body['success']) {
delete_option('my_plugin_activation_id');
return true;
}
return false;
}