License Endpoints

Client-Facing Endpoints

These endpoints are called by remote sites running the SLSWC Client library. Authentication is via license_key parameter validation.

EndpointMethodPurposeDetails
/activatePOSTActivate a license on a domain.Activate a License
/deactivatePOSTDeactivate a license from a domain.Deactivate a License
/check_licensePOSTCheck the current status of a license.Check a License
/check_updatePOSTCheck for software updates.Check for Updates
/add_domainPOSTAdd a domain to an existing license without full activation.Add a Domain
/remove_domainPOSTRemove a domain from a license.Remove a Domain
/connectPOSTConnect a customer account to the store using API keys.Connect an Account
/productGETGet details for a single product by slug.Get a Product
/productsGETGet a list of products.List Products
/recover-licensesPOSTLet customers recover their license keys by email.Recover License Keys
/infoGETGet public server info for client capability discovery.Get Server Info

Admin Endpoints

These endpoints require manage_options capability (WordPress administrator).


GET /licenses

List all licenses with pagination, search, and filtering.

Authentication: manage_options

Parameters:

NameTypeRequiredDescription
pageintNoPage number (default: 1)
per_pageintNoItems per page (default: 20)
searchstringNoSearch by license key, product, or customer
statusstringNoFilter by license status
customer_idintNoFilter by customer ID
product_idintNoFilter by product ID
order_bystringNoColumn to sort by
orderstringNoASC or DESC

Example Request:

curl https://your-site.com/wp-json/slswc/v1/licenses \
  -H "X-WP-Nonce: YOUR_NONCE" \
  --cookie "wordpress_logged_in_xxx=..."

Success Response (200):

{
    "total": 150,
    "total_pages": 8,
    "page": 1,
    "per_page": 20,
    "items": [
        {
            "id": 1,
            "license_key": "ABCD-1234-EFGH-5678",
            "product_id": 123,
            "customer_id": 5,
            "license_status": "active",
            "activations": 2,
            "max_activations": 5,
            "expiration_date": "2027-01-15 00:00:00"
        }
    ]
}

PUT /licenses

Bulk update licenses.

Authentication: manage_options

DELETE /licenses

Bulk delete licenses.

Authentication: manage_options

Parameters:

NameTypeRequiredDescription
idsarrayYesArray of license IDs to delete

GET /license/{license_id}

Get a single license by ID.

Authentication: manage_options

Example Request:

curl https://your-site.com/wp-json/slswc/v1/license/42 \
  -H "X-WP-Nonce: YOUR_NONCE" \
  --cookie "wordpress_logged_in_xxx=..."

PUT /license/{license_id}

Update a single license.

Authentication: manage_options

DELETE /license/{license_id}

Delete a single license.

Authentication: manage_options


POST /license/{license_id}/remove-domain

Remove a domain from a license (admin action).

Authentication: manage_options

Parameters:

NameTypeRequiredDescription
domainstringYesDomain to remove

Example Request:

curl -X POST https://your-site.com/wp-json/slswc/v1/license/42/remove-domain \
  -H "X-WP-Nonce: YOUR_NONCE" \
  --cookie "wordpress_logged_in_xxx=..." \
  -d domain=https://old-site.com

GET /stats

Get license statistics summary.

Authentication: manage_options

Example Request:

curl https://your-site.com/wp-json/slswc/v1/stats \
  -H "X-WP-Nonce: YOUR_NONCE" \
  --cookie "wordpress_logged_in_xxx=..."

GET /license-counts

Get license counts grouped by status.

Authentication: manage_options

Example Request:

curl https://your-site.com/wp-json/slswc/v1/license-counts \
  -H "X-WP-Nonce: YOUR_NONCE" \
  --cookie "wordpress_logged_in_xxx=..."

GET /logs

Get activity logs with filtering.

Authentication: manage_options

Parameters:

NameTypeRequiredDescription
pageintNoPage number (default: 1)
per_pageintNoItems per page (default: 20)
license_idintNoFilter by license ID
actionstringNoFilter by action type
searchstringNoSearch log entries

Example Request:

curl "https://your-site.com/wp-json/slswc/v1/logs?per_page=50&action=activate_license" \
  -H "X-WP-Nonce: YOUR_NONCE" \
  --cookie "wordpress_logged_in_xxx=..."

GET /license/{license_id}/logs

Get logs for a specific license.

Authentication: manage_options

Parameters:

NameTypeRequiredDescription
pageintNoPage number (default: 1)
per_pageintNoItems per page (default: 20)

Example Request:

curl "https://your-site.com/wp-json/slswc/v1/license/42/logs?per_page=10" \
  -H "X-WP-Nonce: YOUR_NONCE" \
  --cookie "wordpress_logged_in_xxx=..."

Was this article helpful?