REST API Doc
Client endpoint
This endpoint should be integrated in the plugin (the one you're selling) to be able to receive the update notifications. When you deploy an update notification from License Manager interface it will actually send a HTTP request to the client's shop by using this endpoint.
POST /software/update
URI:
https://{client_shop}/wp-json/{package}/v1/software/update
Content-Type: application/json
Body:
{ "url": "https://example.com/software/page-id", "version": "1.0.0", "author": "Woosa", "last_release": "2022-03-24", "docs_url": "https://example.com/doc/your-software", "file": "test-plugin.zip", "requirements": { "php": "7.2", "wordpress": "5.0" }, "short_description": "", "changelog": "Some changes go here...", }
To display the notification in the WordPress plugins page we suggest to check these Wordpress filters transient_update_plugins
and site_transient_update_plugins
.
To download the zip file you need to use these endpoints from License Manager plugin /software/update/prepare
and software/update/download
and to integrate this in the WordPress upgrading flow we suggest to check this Wordpress hook upgrader_pre_download
Supplier endpoints
These endpoints are available once the License Manager plugin is installed and active on your shop. Use these endpoints to build your own integration logic for checking license and getting updates.
GET /license/info
This endpoint allows you to retrieve information about the license key.
URI:
https://{supplier_shop}/wp-json/lmn/v1/license/info
Query parameters:
Parameter | Required | Description |
key |
yes | the license key |
package |
yes | the slug of the plugin |
Response:
Status 200{ "license": { "status": "active", "activations": 1, "activation_limit": 12 }, "sites": [ { "site_url": "https://example.com", "activation_date": 1649339236 } ] }Status 400 | 403 | 404
{ "code": "invalid_license_key" "message": "The license key is invalid.", "data": { "status": 403 } }
POST /license/activate
This endpoint allows you to activate the license key for the given domain.
URI:
https://{supplier_shop}/wp-json/lmn/v1/license/activate
Content-Type: application/json
Body:
Parameter | Required | Description |
key |
yes | the license key |
package |
yes | the slug of the plugin |
site_url |
yes | the site URL which should be registered on the license key |
{ "key": "ABD8791E75BC1425314DF428D5883E0530489FD1EA2D023B09EDC70FFF3962F537D13B3890E38D765873E2F99E3346FDDFDFA2", "package": "test-plugin", "site_url": "https://example.com" }
Response:
Status 200{ "license": { "status": "active", "activations": 1, "activation_limit": 12 }, "sites": [ { "site_url": "https://example.com", "activation_date": 1649260892 } ] }Status 400 | 403 | 404
{ "code": "invalid_license_key" "message": "The license key is invalid.", "data": { "status": 403 } }
POST /license/deactivate
This endpoint allows you to deactivate the license key for the given domain.
URI:
https://{supplier_shop}/wp-json/lmn/v1/license/deactivate
Content-Type: application/json
Body:
Parameter | Required | Description |
key |
yes | the license key |
package |
yes | the slug of the plugin |
site_url |
yes | the site URL which should be removed from the license key |
{ "key": "ABD8791E75BC1425314DF428D5883E0530489FD1EA2D023B09EDC70FFF3962F537D13B3890E38D765873E2F99E3346FDDFDFA2", "package": "test-plugin", "site_url": "https://example.com" }
Response:
Status 200{ "license": { "status": "active", "activations": 1, "activation_limit": 12 }, "sites": [] }Status 400 | 403 | 404
{ "code": "invalid_license_key" "message": "The license key is invalid.", "data": { "status": 403 } }
GET /software/info
This endpoint allows you to retrieve information about the software assigned to the license key and for the given site URL.
URI:
https://{supplier_shop}/wp-json/lmn/v1/software/info
Query parameters:
Parameter | Required | Description |
key |
yes | the license key |
package |
yes | the slug of the plugin |
site_url |
yes | the site URL which was registered on the license key |
Response:
Status 200{ "url": "https://example.com/software/page-id", "version": "1.0.0", "author": "Woosa", "last_release": "2022-03-24", "docs_url": "https://example.com/doc/your-software", "file": "test-plugin.zip", "requirements": { "php": "7.2", "wordpress": "5.0" }, "short_description": "", "changelog": "Some changes go here...", }Status 400 | 403 | 404
{ "code": "invalid_license_key" "message": "The license key is invalid.", "data": { "status": 403 } }
POST /software/update/prepare
This endpoint allows you to initiate the process of getting the software update. I will give you an access token which can be used to download the update.
URI:
https://{supplier_shop}/wp-json/lmn/v1/software/update/prepare
Content-Type: application/json
Body:
Parameter | Required | Description |
key |
yes | the license key |
package |
yes | the slug of the plugin |
site_url |
yes | the site URL which was registered on the license key |
{ "key": "ABD8791E75BC1425314DF428D5883E0530489FD1EA2D023B09EDC70FFF3962F537D13B3890E38D765873E2F99E3346FDDFDFA2", "package": "test-plugin", "site_url": "https://example.com" }
Response:
Status 201{ "access_token": "NGRJ2HSlgPNBMkHR0nAVGpf9KbdyfMXRRg6wSpOIMnJzqIqy8djEZbk8ws7bMHxfh8VPtv1HS5cm0BS01BxbrhMy6PKCJntPWiDm", "expires_in": 300 }Status 400 | 403 | 404
{ "code": "invalid_license_key" "message": "The license key is invalid.", "data": { "status": 403 } }
GET /software/update/download
This endpoint allows you to download the zip file of the software.
URI:
https://{supplier_shop}/wp-json/lmn/v1/software/update/download
Query parameters:
Parameter | Required | Description |
key |
yes | the license key |
access_token |
yes | the token received at endpoint /software/update/prepare |
Response:
Status 200 - Content-Type: application/octet-stream
Status 400 | 403 | 404{ "code": "invalid_license_key" "message": "The license key is invalid.", "data": { "status": 403 } }