Deactivate

This endpoint can be used to deactivate / disable a License Activation

When deactivating licenses, the License Activation records in the table {prefix}_dlm_activations are updated and the deactivated_at column is set to the current timestamp that tells the system that the License Activation is deactivated (disabled). If this value is NULL then the record is still valid.

Endpoint

GET
/wp-json/dlm/v1/licenses/deactivate/{activation_token}

Responses

{
    "success": true,
    "data": {
        "id": 16,
        "token": "94face23474767399c106d7598685764853b49b5",
        "license_id": 33,
        "label": "My Device",
        "source": 2,
        "ip_address": "127.0.0.1",
        "user_agent": "DLM cURL Client v10",
        "meta_data": [],
        "created_at": "2021-08-28 06:32:40",
        "updated_at": "2021-08-28 10:59:53",
        "deactivated_at": "2021-08-28 10:59:53",
        "license": {
            "id": 33,
            "order_id": 56,
            "product_id": 12,
            "user_id": 1,
            "license_key": "DWA9-AAZZ-3199-Z312",
            "expires_at": "2022-07-25 09:38:12",
            "valid_for": 365,
            "source": 1,
            "status": 2,
            "times_activated": 2,
            "activations_limit": 5,
            "is_expired": false,
            "created_at": "2021-07-25 09:38:12",
            "updated_at": "2021-07-25 09:38:12",
        }
    }
}
{
    "code": "data_error",
    "message": "License activation token could not be found.",
    "data": {
        "status": 404
    }
}

Examples

Example
use IdeoLogix\DigitalLicenseManagerClient\Service;

$api = new Service( 'http://site.com', 'ck_XXXX', 'cs_XXXX' );

$response = $api->licenses()->deactivate( '94face2...' );

print_r($response->get_data());
Response
Array
(
    [id] => 16
    [token] => 94face23474767399c106d7598685764853b49b5
    [license_id] => 33
    [label] => 'My Device'
    [source] => 2
    [ip_address] => 127.0.0.1
    [user_agent] => DLM cURL Client v10
    [meta_data] => Array()
    [created_at] => 2021-08-28 06:32:40
    [updated_at] => 2021-08-28 10:59:53
    [deactivated_at] => 2021-08-28 10:59:53
    [license] => Array
        (
            [id] => 33
            [order_id] => 56
            [product_id] => 12
            [user_id] => 1
            [license_key] => DWA9-AAZZ-3199-Z312
            [expires_at] => 2022-07-25 09:38:12
            [valid_for] => 365
            [source] => 1
            [status] => 2
            [times_activated] => 2
            [activations_limit] => 5
            [is_expired] => false
            [created_at] => 2021-07-25 09:38:12
            [updated_at] => 2021-07-25 09:38:12
        )

)
For more details please click here.