WooCommerce License Keys comes built-in with a RESTFul API validator that will allow validating licensed products remotely using HTTP requests.
How it works?
By default, the API is mounted using WordPress AJAX core functionality as a handler, which allows for background requests and responses between applications.
Configure the API handler at the License Keys API settings, “Dashboard” -> “WooCommerce” -> “Settings” -> “Advanced” -> “License Keys API”.
The following handlers can be selected:
- WP Ajax (default)
- WP Rest API
This handler runs using old and robust WordPress AJAX, which process calls at an admin layer. This option allows the plugin to override headers.
WordPress Ajax, will run the API under a base url, which can be obtain in the documentation section of “Dashboard” -> “WooCommerce” -> “Settings” -> “Advanced” -> “License Keys API”:
WP Rest API
REST API was introduced in WordPress version 4.7.0. It runs independently, not at an admin layer, which can improve response times.
When this handler is selected, the plugin will add a new namespace and endpoint routes to WordPress REST API.
Read the full handler documentation here.
WooCommerce License Keys provides 3 endpoints, one for remote activations, another for remote validations and the last one for remote deactivations.
The plugin comes with small documentation that can be accessible in the License Key API settings.
Use the API’s base URL, described above, to call to any of these endpoints:
NOTE: Documentation and samples are using the WP Ajax handler.