The built-in API interface is a convenient way to allow your software to communication with the WooCommerce Software License API. Calls are initiated through GET/POST method. Additional code examples are included within the plugin download, also in our documentation area Software API Integration code example.
The following methods are available:
- activate
- deactivate
- status-check
- plugin_update
- plugin_information
- theme_update
- code_version
- key_delete
Each function generally requires some combination of the following input values:
- woo_sl_action: plugin function requested
- licence_key: the license key that was sent to the user
- product_unique_id: the Software Unique ID as defined in the WooCommerce product License tab
- domain: the URL to a WordPress site using a plugin or a unique hash for standalone software
- api_version: an API version to use, if not specified 1.0 will be used. Latest available is 1.1
For each function, the returned values are:
- status => error or success message (string)
- status_code => result code (integer)
- message => explanation of result (string)
The domain input ( unique hash ) is processed on API calls using regex, so it should be also validated on the client, before sending the request, to include the following allowed chars:
- alphanumeric characters ( lowercase and uppercases)
- dots
- minus
- underlines
- forward slashes
- spaces
activate
This method allows a license key to be synchronized with your software for activation. The following arguments are required for a typical software-license call:
- woo_sl_action = ‘activate’
- product_unique_id
- licence_key
- domain
deactivate
This method facilitate a licence key de-activation. Once de-activated a key is released from being set as used status, and it can be integrated with another domain / hash. The following arguments are required for a call:
- woo_sl_action = ‘deactivate’
- product_unique_id
- licence_key
- domain
status-check
The status-check API method allow a certain software key to be verified for being still active, valid, assigned to a certain domain. The following arguments are required for a call:
- woo_sl_action = ‘status-check’
- product_unique_id
- licence_key
- domain
plugin_update
The plugin_update API method return basic details regarding software update. The following arguments are required for a call:
- woo_sl_action = ‘plugin_update’
- product_unique_id
- licence_key
- version
- domain
theme_update
The theme_update API method return basic details regarding theme software update. The following arguments are required for a call:
- woo_sl_action = ‘theme_update’
- product_unique_id
- licence_key
- version
- domain
plugin_information
The plugin_information API method return detailed information’s regarding software as download link, latest software, upgrade notice, requires, description details, installation, faq, screenshot, changelog etc. The following arguments are required for a call:
- woo_sl_action = ‘plugin_information’
- product_unique_id
- licence_key
- version
- domain
code_version
The method return detailed information’s regarding a licenced product, latest version, upgrade notice, requires, description details, installation, faq, screenshot, changelog etc. The difference from other API methods,this does not require a key, but there’s no download / update link provided.
The following arguments are required for a call:
- woo_sl_action = ‘code_version’
- product_unique_id
key_delete
Through this API method a key can be removed from the customer dashboard. By deleting a key, a new slot will be open so another licence key can be generated. The following arguments are required for a call:
- woo_sl_action = ‘key_delete’
- product_unique_id
- licence_key