Developer Guide

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 hereThen read
Building a plugin or theme that needs licensing and auto-updatesClient Library OverviewPlugin Integration or Theme Integration, then DRM
Integrating with the license server API from an external systemREST API OverviewLicense Endpoints for activation and update checks
Extending the license server itself (custom tools, modified behavior)Hooks ReferenceExtending SLSWC and Payment Gateway Development

Architecture Overview

SLSWC has three main layers:

  1. 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.
  2. 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.
  3. 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_key parameter 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_options capability).

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:

GroupDescriptionDocs
License endpointsActivate, deactivate, check, update licensesClient-facing + admin CRUD
Subscription endpointsAdmin subscription managementList, update, delete, counts
Support endpointsTicket systemTickets, categories, agents, attachments
My Account endpointsCustomer self-serviceLicenses, subscriptions, API keys, Composer config
Admin endpointsDashboard, reports, settings, migrationsAdmin-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.

GuideDescription
Client Library OverviewArchitecture and class reference
Plugin IntegrationIntegrating a WordPress plugin
Theme IntegrationIntegrating a WordPress theme
DRMGrace periods, admin notices, interstitial lock
Auto-UpdatesHow update checks work

Reference

GuideDescription
Hooks ReferenceAll slswc_* actions and filters
Payment Gateway DevelopmentBuilding custom gateways
Composer RepositoryPrivate Composer endpoint
Extending SLSWCExtension 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.

Was this article helpful?