License Manager for WooCommerce

Easily sell and manage software license keys through your shop

List all licenses

Description

This route is used to retrieve all license keys from the database. Be very careful, if you do not need to use this API route in your productive environment then it is best to disable the route altogether via the settings page. The response contains an array of license key data objects.

Request URL

GET/wp-json/lmfwc/v2/licenses

Request Example (PHP)

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "{{host}}/wp-json/lmfwc/v2/licenses?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": "1777",
      "licenseKey": "FOO-FIGHTERS",
      "expiresAt": null,
      "validFor": "365",
      "source": "3",
      "status": "3",
      "timesActivated": null,
      "timesActivatedMax": "1",
      "createdAt": "2019-09-04 18:12:38",
      "createdBy": "1",
      "updatedAt": null,
      "updatedBy": null
    },
    {
      "id": "3",
      "orderId": null,
      "productId": "1777",
      "licenseKey": "THE-PRETENDER",
      "expiresAt": null,
      "validFor": "365",
      "source": "3",
      "status": "3",
      "timesActivated": null,
      "timesActivatedMax": "1",
      "createdAt": "2019-09-04 18:13:08",
      "createdBy": "1",
      "updatedAt": null,
      "updatedBy": null
    }
  ]
}