Documentation
WooCommerce License Manager

API

The Licenses Manager for WooCommerce provides a comprehensive REST API for managing software licenses, activations, and product downloads. All endpoints are accessible via the WordPress REST API under the wc/wlm namespace.

Base URL: https://yoursite.com/wp-json/wc/wlm/

Format: All responses are in JSON format (except file downloads)

Authentication

Most endpoints require authentication using a combination of API keys:

  • product_key – Unique identifier for your product (found in WooCommerce product settings)
  • secret_key – Secret key for API authentication (found in WooCommerce product settings)

Optional User-Agent Validation

You can enable User-Agent validation in the plugin settings. When enabled, all API requests must include a User-Agent header starting with “WLM”.

User-Agent: WLM/1.0 MyApp/2.0

License Endpoints

1. Create License

Create a new license key for a product.

HTTP Method: POST, PUT, PATCH

Endpoint: /license

Full URL: https://yoursite.com/wp-json/wc/wlm/license

Required Parameters:

  • product_key (string) – Your product’s unique key
  • secret_key (string) – Your product’s secret key
  • product_id (integer) – WooCommerce product ID

Optional Parameters:

  • order_id (integer) – WooCommerce order ID to associate with license

Example Request:

curl -X POST "https://yoursite.com/wp-json/wc/wlm/license" \
  -H "Content-Type: application/json" \
  -d '{
    "product_key": "37af35f3fd31d9b119799608c554f5cb",
    "secret_key": "78c8d021a43418b916375e923487a3db6ad66007",
    "product_id": 23,
    "order_id": 15
  }'

Success Response:

{
  "order_id": 15,
  "license_key": "free-db704283-f81b-454f-b8b8-0af13fa02527",
  "license_email": 1,
  "license_limit": 0,
  "license_updates": 1,
  "license_support": 1,
  "license_expiration": "",
  "license_created": "2023-11-07 17:57:18",
  "activation_count": 0,
  "activation_remaining": "Unlimited",
  "product": "My Product Name"
}

Possible Error Codes: 2001, 3007, 4001


2. Get License

Retrieve information about an existing license.

HTTP Method: GET

Endpoint: /license

Full URL: https://yoursite.com/wp-json/wc/wlm/license

Required Parameters:

  • license_key (string) – The license key to retrieve
  • product_key (string) – Your product’s unique key
  • secret_key (string) – Your product’s secret key

Example URL:

https://yoursite.com/wp-json/wc/wlm/license?product_key=3946f45a460b400fc7c263a482e50b6c&secret_key=d8437f8f5b54c225f70b7addfc1be393a11c81b0&license_key=a29983f5-5001-46d5-b6b0-d7f0dcb7fc32

Success Response:

{
  "license_id": 3,
  "license_key": "a29983f5-5001-46d5-b6b0-d7f0dcb7fc32",
  "license_email": 1,
  "license_limit": 0,
  "license_updates": 1,
  "license_support": 1,
  "license_expiration": "0000-00-00 00:00:00",
  "license_created": "2023-11-07 14:57:16",
  "license_activations": [
    {
      "activation_site": "https://example.com",
      "activation_created": "2023-11-07 15:00:00"
    }
  ],
  "activation_count": 1,
  "activation_remaining": "Unlimited"
}

Possible Error Codes: 2001, 3001


3. Delete License

Permanently delete a license key.

HTTP Method: DELETE

Endpoint: /license

Required Parameters:

  • license_key (string) – The license key to delete
  • product_key (string) – Your product’s unique key
  • secret_key (string) – Your product’s secret key

Example URL:

https://yoursite.com/wp-json/wc/wlm/license?product_key=3946f45a460b400fc7c263a482e50b6c&secret_key=d8437f8f5b54c225f70b7addfc1be393a11c81b0&license_key=02080b8d-5258-445a-8ddd-5e430378efe8

Success Response:

{
  "order_id": 27,
  "order_subscription": null,
  "license_created": "2023-11-08 15:54:03"
}

Possible Error Codes: 2001, 3001, 3005


4. Reset License Activations

Remove all activations from a license (resets activation count to 0).

HTTP Method: DELETE

Endpoint: /license/activations

Required Parameters:

  • license_key (string) – The license key to reset
  • product_key (string) – Your product’s unique key
  • secret_key (string) – Your product’s secret key

Example URL:

https://yoursite.com/wp-json/wc/wlm/license/activations?product_key=3946f45a460b400fc7c263a482e50b6c&secret_key=d8437f8f5b54c225f70b7addfc1be393a11c81b0&license_key=1548b574-5779-43ed-8b06-f5dc4269444c

Success Response:

{
  "license_id": 35,
  "license_key": "1548b574-5779-43ed-8b06-f5dc4269444c",
  "license_email": 1,
  "license_limit": 0,
  "license_updates": 1,
  "license_support": 1,
  "license_expiration": "0000-00-00 00:00:00",
  "license_created": "2023-11-07 18:39:31",
  "activation_count": 0,
  "activation_remaining": "Unlimited"
}

Possible Error Codes: 2001, 3001, 3002

Activation Endpoints

1. Create Activation

Activate a license on a specific site.

HTTP Method: POST, PUT, PATCH

Endpoint: /activation

Required Parameters:

  • license_key (string) – The license key to activate
  • activation_site (string) – The site URL (must start with http:// or https://)

Conditional Parameters:

These parameters are required when the plugin setting “Validate Product on Activation” is enabled:

  • license_email (string) – Customer email address (must be valid email)
  • product_key (string) – Your product’s unique key

PRO Version – Envato Integration:

  • license_market (string) – Set to “envato” for Envato marketplace licenses

Success Response:

{
  "order_id": 15,
  "license_key": "a29983f5-5001-46d5-b6b0-d7f0dcb7fc32",
  "license_email": 1,
  "license_limit": 5,
  "license_updates": 1,
  "license_support": 1,
  "license_expiration": "2024-11-07 00:00:00",
  "license_created": "2023-11-07 14:57:16",
  "activation_limit": "Limited",
  "activation_count": 1,
  "activation_remaining": 4,
  "activation_instance": "1699447862",
  "activation_status": 1,
  "activation_site": "https://customer-site.com",
  "activation_created": "2023-11-08 15:24:22"
}

Important: Store the activation_instance value – you’ll need it to deactivate or check the activation later.

Possible Error Codes: 1001, 2003, 3000, 3001, 3003, 3007, 4001


2. Get Activation

Retrieve information about a specific activation.

HTTP Method: GET

Endpoint: /activation

Required Parameters:

  • license_key (string) – The license key
  • activation_instance (string) – The activation instance ID

Example URL:

https://yoursite.com/wp-json/wc/wlm/activation?license_key=600b47be-45b7-4da0-9381-f0717290512d&activation_instance=1699445281

Use Case: Check activation status before performing updates or downloads

Possible Error Codes: 2003, 3002


3. Delete Activation (Deactivate)

Deactivate a license from a specific site.

HTTP Method: DELETE

Endpoint: /activation

Required Parameters:

  • license_key (string) – The license key
  • activation_instance (string) – The activation instance ID to remove

Example URL:

https://yoursite.com/wp-json/wc/wlm/activation?license_key=600b47be-45b7-4da0-9381-f0717290512d&activation_instance=1699445281

Note: This feature must be enabled in plugin settings (“Allow User Deactivation”). Deactivation frees up an activation slot if the license has a limit.

Possible Error Codes: 2003, 3002, 9001

Product Endpoints

1. Get Product Information

Retrieve product metadata including version, changelog, and update information.

HTTP Method: GET

Endpoint: /product/information

Required Parameters:

  • product_key (string) – Your product’s unique key

Example URL:

https://yoursite.com/wp-json/wc/wlm/product/information?product_key=3946f45a460b400fc7c263a482e50b6c

Success Response:

{
  "version": "2.1.0",
  "added": "November 7, 2023",
  "name": "My Awesome Plugin",
  "requires": "5.0",
  "tested": "6.4",
  "author": "Your Company",
  "last_updated": "November 8, 2023",
  "banner_high": "https://yoursite.com/banner-high.jpg",
  "banner_low": "https://yoursite.com/banner-low.jpg",
  "icon": "https://yoursite.com/icon.png",
  "homepage": "https://yoursite.com/product",
  "upgrade_notice": "Important security update",
  "changelog": "<h3>2.1.0</h3><ul><li>New feature added</li></ul>",
  "description": "Product description here",
  "screenshots": false,
  "product": "My Awesome Plugin"
}

Use Case: Check for available updates from your WordPress plugin/theme

Caching: This endpoint is cached for 1 hour for performance

Possible Error Codes: 3007


2. Get Product Update URL

Get the download URL for the latest version of the product.

HTTP Method: GET

Endpoint: /product/update

Required Parameters:

  • license_key (string) – Valid license key
  • activation_instance (string) – Activation instance ID

Example URL:

https://yoursite.com/wp-json/wc/wlm/product/update?license_key=free-9a8c2984-25e9-491b-b441-569935a74665&activation_instance=1699447862

Success Response:

"https://yoursite.com/wp-json/wc/wlm/download?license_key=free-9a8c2984-25e9-491b-b441-569935a74665&activation_instance=1699447862"

Use Case: Get the download URL to update your plugin/theme automatically

Caching: This endpoint is cached for 1 hour for performance

Possible Error Codes: 1001, 3002, 3008

Download Endpoint

Download Product File

Download the product file (plugin/theme ZIP archive).

HTTP Method: GET

Endpoint: /download

Required Parameters:

  • license_key (string) – Valid license key
  • activation_instance (string) – Activation instance ID

Example URL:

https://yoursite.com/wp-json/wc/wlm/download?license_key=free-9a8c2984-25e9-491b-b441-569935a74665&activation_instance=1699447862

Response: Binary file stream (ZIP archive)

Validations:

  • License must be valid and not expired
  • Activation must exist and be active
  • License updates must not be expired
  • Product must have a download file configured

Use Case: Automatically download and install updates

Possible Error Codes: 2003, 3002, 3004, 3007, 3008, 4002

Error Handling

All error responses follow this format:

{
  "error": 3001,
  "message": "License not found"
}

Error Codes Reference

CodeDescriptionResolution
1001Required parameter missingCheck that all required parameters are included
2001Invalid secret keyVerify your product_key and secret_key are correct
2003Permission deniedEmail mismatch, license banned, or insufficient permissions
3000Order not found or invalidCheck the order_id exists and has valid status
3001License not foundVerify the license_key is correct
3002Activation not foundCheck the activation_instance is correct
3003Activation limit reachedLicense has no remaining activation slots
3004License expiredThe license or update period has expired
3005License already deletedCannot delete a license that’s already deleted
3007Product not foundCheck the product_key or product_id is correct
3008Download file not foundProduct has no download file configured
4001Database errorServer error creating record, contact support
4002External service errorWooCommerce dependency missing
9001Unknown errorUnexpected error occurred

PRO Version – Envato Integration

The PRO version includes additional functionality for Envato Marketplace integration.

Envato License Activation

When activating licenses purchased through Envato, include the license_market parameter in the activation request:

curl -X POST "https://yoursite.com/wp-json/wc/wlm/activation" \
  -H "Content-Type: application/json" \
  -d '{
    "license_key": "envato-purchase-code-here",
    "activation_site": "https://customer-site.com",
    "license_market": "envato"
  }'

Envato Integration Features:

  • Automatic Validation – Validates purchase codes with Envato API
  • Auto-Create Orders – Automatically creates WooCommerce orders for Envato sales
  • User Account Creation – Creates customer accounts automatically
  • License Expiration – Syncs expiration dates from Envato support period
  • Regular License Enforcement – Limits Regular Licenses to 1 activation
  • Download Permissions – Automatically grants download access

Required Configuration:

  • Envato API Key must be configured in plugin settings
  • Product must have Envato Item ID configured

Integration Examples

WordPress Plugin Update Checker

// Check for updates
$response = wp_remote_get('https://yoursite.com/wp-json/wc/wlm/product/information?product_key=YOUR_KEY');
$data = json_decode(wp_remote_retrieve_body($response), true);

if (version_compare($data['version'], YOUR_CURRENT_VERSION, '>')) {
    // Update available
    $download_url = 'https://yoursite.com/wp-json/wc/wlm/download?license_key=' . $license_key . '&activation_instance=' . $instance;
}

License Activation

// Activate license
$response = wp_remote_post('https://yoursite.com/wp-json/wc/wlm/activation', [
    'body' => json_encode([
        'license_key' => 'customer-license-key',
        'activation_site' => home_url(),
        'license_email' => '[email protected]',
        'product_key' => 'YOUR_PRODUCT_KEY'
    ]),
    'headers' => [
        'Content-Type' => 'application/json'
    ]
]);

$activation = json_decode(wp_remote_retrieve_body($response), true);
// Store activation_instance for future use
update_option('my_plugin_activation_instance', $activation['activation_instance']);

Check Activation Status

// Verify activation before performing actions
$license_key = get_option('my_plugin_license_key');
$instance = get_option('my_plugin_activation_instance');

$response = wp_remote_get("https://yoursite.com/wp-json/wc/wlm/activation?license_key={$license_key}&activation_instance={$instance}");
$activation = json_decode(wp_remote_retrieve_body($response), true);

if (isset($activation['error'])) {
    // Handle error - activation not valid
} else if ($activation['activation_status'] == 1) {
    // Activation is valid
}

Best Practices

  1. Store Activation Data – Save the activation_instance after successful activation
  2. Check Before Download – Verify activation status before downloading updates
  3. Handle Errors Gracefully – Implement proper error handling for all API calls
  4. Use HTTPS – Always use HTTPS for API requests
  5. Rate Limiting – Avoid excessive API calls by implementing local caching

Performance Notes

Caching: The following endpoints implement 1-hour caching for improved performance:

  • /product/information
  • /product/update

Cache can be bypassed by defining the QLWLM_DEVELOPER constant as true in wp-config.php

Can’t find the anwser?

Our docs solve most issues, but sometimes you need a human. If you’re still stuck, we’re just a message away.

Looking for support?

Premium users can log in to their account for priority support and a response in under 6 business hours (Mon–Fri).

Free users can submit a support ticket and we’ll reply within 24 h.

Log into your account
Forgot your password?