Client-Facing Endpoints
These endpoints are called by remote sites running the SLSWC Client library. Authentication is via license_key parameter validation.
| Endpoint | Method | Purpose | Details |
|---|---|---|---|
/activate | POST | Activate a license on a domain. | Activate a License |
/deactivate | POST | Deactivate a license from a domain. | Deactivate a License |
/check_license | POST | Check the current status of a license. | Check a License |
/check_update | POST | Check for software updates. | Check for Updates |
/add_domain | POST | Add a domain to an existing license without full activation. | Add a Domain |
/remove_domain | POST | Remove a domain from a license. | Remove a Domain |
/connect | POST | Connect a customer account to the store using API keys. | Connect an Account |
/product | GET | Get details for a single product by slug. | Get a Product |
/products | GET | Get a list of products. | List Products |
/recover-licenses | POST | Let customers recover their license keys by email. | Recover License Keys |
/info | GET | Get 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:
| Name | Type | Required | Description |
|---|---|---|---|
page | int | No | Page number (default: 1) |
per_page | int | No | Items per page (default: 20) |
search | string | No | Search by license key, product, or customer |
status | string | No | Filter by license status |
customer_id | int | No | Filter by customer ID |
product_id | int | No | Filter by product ID |
order_by | string | No | Column to sort by |
order | string | No | ASC 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:
| Name | Type | Required | Description |
|---|---|---|---|
ids | array | Yes | Array 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:
| Name | Type | Required | Description |
|---|---|---|---|
domain | string | Yes | Domain 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:
| Name | Type | Required | Description |
|---|---|---|---|
page | int | No | Page number (default: 1) |
per_page | int | No | Items per page (default: 20) |
license_id | int | No | Filter by license ID |
action | string | No | Filter by action type |
search | string | No | Search 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:
| Name | Type | Required | Description |
|---|---|---|---|
page | int | No | Page number (default: 1) |
per_page | int | No | Items 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=..."