Offline Licensing with WooCommerce
Offline licensing allows your customers to activate and use your software on a device without an internet connection. The license file is generated through your WooCommerce store and loaded into your application locally.
This guide covers the full flow — from your store settings to the end user’s experience.
How It Works
- Your application displays the device’s Host ID to the user
- The user purchases a license from your WooCommerce store
- On the order downloads page, the user enters their Host ID
- The store generates an encrypted license file for that specific device
- The user downloads the file and loads it into your application
- Your application validates the license file locally — no internet needed
Configure Your WooCommerce Store
In the KEYZY WooCommerce plugin settings, enable two options:
- Go to WooCommerce > Settings > KEYZY (or the KeyzyWc settings page)
- Enable “Show Download Link” — this lets the user download the encrypted license file
- Enable “Show HostID Input Field” — this adds an input where the user can paste their Host ID
Without these options enabled, the user won’t see the fields needed for offline activation.
Display the Host ID in Your Application
Your application needs to show the user their device’s unique Host ID. Use the getHostIdHash() function from the KEYZY C++ Client Library:
std::string hostId = pValidator->getHostIdHash();
// Display this to the user — e.g. in a dialog, or copy it to the clipboard
The Host ID is a hash that uniquely identifies the device. The user copies this value and enters it in your WooCommerce store when downloading the license file.
Important: The Host ID must be copied exactly. An incorrect Host ID will produce a license file that won’t work on the device.
The User’s Experience
After purchasing a license from your store:
- The user goes to their order’s downloads page
- They paste the Host ID from your application into the input field
- They click download — the store generates an encrypted license file tied to that device
- The user saves the file and provides it to your application (e.g. via a file browser dialog)
Activate the License File
Once the user has the license file, your application needs to load and validate it. See the Offline Activation tutorial for the full implementation — covering activation, validation, offline license life, and deactivation.
Tips
- The encryption key in your
ProductDatais required for offline activation — you can find it on the Products page in the dashboard - Each license file is tied to a specific device via the Host ID — it cannot be used on a different machine
- If a user needs to move their license to a new device, they need to deactivate on the old device and generate a new license file with the new device’s Host ID