License Manager for WooCommerce

Easily sell and manage software license keys through your shop

Activate a license

Description

Increases the “times_activated” value by one (1). The plugin will check if there is a “times_activated_max” value, if there is and if the “times_activated” value has not reached the limit set by “times_activated_max”, then the “times_activated” will be incremented by 1, and the updated license key data object will be returned.

Request URL

GET/wp-json/lmfwc/v2/licenses/activate/THE-PRETENDER

Request Example (PHP)

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "{{host}}/wp-json/lmfwc/v2/licenses/activate/THE-PRETENDER?consumer_key={{consumer_key}}&consumer_secret={{consumer_secret}}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => false,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}

?>

Response

{
  "success": true,
  "data": {
    "id": "2",
    "orderId": null,
    "productId": null,
    "licenseKey": "THE-PRETENDER",
    "expiresAt": null,
    "validFor": null,
    "source": "3",
    "status": "3",
    "timesActivated": "1",
    "timesActivatedMax": "999",
    "createdAt": "2019-09-04 18:12:38",
    "createdBy": "1",
    "updatedAt": "2019-09-04 18:19:23",
    "updatedBy": "1"
  }
}