This guide covers how to integrate with and extend the SLSWC (Software License Server for WooCommerce) plugin: the REST API, the client library for plugins and themes, hooks, filters, and extensibility points.
Getting Started
Your starting point depends on what you are building:
| If you are⦠| Start here | Then read |
|---|---|---|
| Building a plugin or theme that needs licensing and auto-updates | Client Library Overview | Plugin Integration or Theme Integration, then DRM |
| Integrating with the license server API from an external system | REST API Overview | License Endpoints for activation and update checks |
| Extending the license server itself (custom tools, modified behavior) | Hooks Reference | Extending SLSWC and Payment Gateway Development |
Architecture Overview
SLSWC has three main layers:
- License Server (this plugin) β A WordPress + WooCommerce plugin that stores licenses, manages subscriptions, serves updates, and exposes a REST API. The admin UI is a Vue.js SPA that communicates with admin REST endpoints.
- Client Library β A PHP library bundled inside each distributed plugin or theme. It calls the server's public endpoints to check licenses, fetch updates, and enforce DRM.
- Composer Repository β An optional private Composer endpoint that lets customers install and update licensed software via
composer require.
API Split
The REST API is split into two groups:
- Public (client-facing) endpoints β Used by remote sites running the SLSWC Client library. These handle license activation, deactivation, status checks, and update checks. They authenticate via the
license_keyparameter and require no user session. This is what your distributed plugins and themes call. - Admin endpoints β Used by the SLSWC admin dashboard (Vue.js SPA). These handle CRUD operations for licenses, subscriptions, support tickets, settings, and reports. They require a logged-in WordPress administrator (
manage_optionscapability).
There are also My Account endpoints for customer self-service (viewing their own licenses, subscriptions, and API keys) that require any authenticated user.
Tip: If you are building a WordPress plugin or theme, you never need to call the REST API directly. The Client Library handles all communication with the server.
REST API
All endpoints live under the slswc/v1 namespace (filterable via slswc_api_namespace).
Base URL: https://your-site.com/wp-json/slswc/v1/
Endpoint groups:
| Group | Description | Docs |
|---|---|---|
| License endpoints | Activate, deactivate, check, update licenses | Client-facing + admin CRUD |
| Subscription endpoints | Admin subscription management | List, update, delete, counts |
| Support endpoints | Ticket system | Tickets, categories, agents, attachments |
| My Account endpoints | Customer self-service | Licenses, subscriptions, API keys, Composer config |
| Admin endpoints | Dashboard, reports, settings, migrations | Admin-only analytics and config |
See REST API Overview for authentication, error format, and conventions.
Client Library
The SLSWC Client library ships in libraries/slswc/client/src/ and provides automatic update checks and license management for plugins and themes that sell through an SLSWC-powered store.
| Guide | Description |
|---|---|
| Client Library Overview | Architecture and class reference |
| Plugin Integration | Integrating a WordPress plugin |
| Theme Integration | Integrating a WordPress theme |
| DRM | Grace periods, admin notices, interstitial lock |
| Auto-Updates | How update checks work |
Reference
| Guide | Description |
|---|---|
| Hooks Reference | All slswc_* actions and filters |
| Payment Gateway Development | Building custom gateways |
| Composer Repository | Private Composer endpoint |
| Extending SLSWC | Extension points summary |
Key Concepts
- License key β A unique string (e.g.,
ABCD-1234-EFGH-5678) generated at purchase. Used by the client library to authenticate with the server. - Activation β Registering a domain against a license. Each license has a max activation limit for live sites and a separate limit for staging sites.
- Product slug β An identifier for the distributed plugin/theme. Defaults to the text domain if not set in file headers. Does not need to match the WooCommerce product slug.
- Environment detection β The server determines whether a site is live or staging based on the requesting domain. Staging activations do not count toward live limits.