Documentation
Getting Started
- Introduction
- Setup
- General Settings
- WooCommerce
- Tools
- Analytics Reports
- Dashboard
- License
- Generator
- Activations
- Applications
- Installed On
- API Logs
- WooCommerce Products
- Customer License Manager Flow
Integrations
For Developer
C# SDK
The .NET licensing SDK for SaaS, desktop, and custom software.
Stop building custom licensing integrations. This framework-agnostic SDK connects .NET applications to the License Manager for WooCommerce (Pro) REST API.
π Accelerate Your Software Monetization
If you are building a SaaS, desktop application, or custom software, your focus should be on your productβnot on writing REST API integrations for licensing.
This SDK provides native .NET access to the License Manager for WooCommerce (Pro) ecosystem, including license activation, validation, updates, downloads, and public client operations.
π‘οΈ Why Choose This SDK?
- Zero manual API coding: REST endpoints are mapped to asynchronous .NET methods.
- Framework agnostic: Works with ASP.NET, worker services, desktop applications, and standalone .NET software.
- Secure client API: Distributed applications can use the public API without shipping WooCommerce consumer secrets.
- Enterprise ready: Designed for licensing and multi-tier SaaS fulfillment.
π Professional API Support Matrix
The SDK supports the License Manager for WooCommerce (Pro) REST APIs.
π Core Licensing
| Feature | SDK Method | API Endpoint |
|---|---|---|
| List Licenses | client.Licenses.ListAsync() | GET /licenses |
| Retrieve License | client.Licenses.GetAsync(key) | GET /licenses/{key} |
| Create License | client.Licenses.CreateAsync(data) | POST /licenses |
| Update License | client.Licenses.UpdateAsync(key, data) | PUT /licenses/{key} |
| Delete License | client.Licenses.DeleteAsync(key) | DELETE /licenses/{key} |
| Activate License | client.Licenses.ActivateAsync(key) | GET /licenses/activate/{key} |
| Reactivate License | client.Licenses.ReactivateAsync(key, params) | GET /licenses/activate/{key} |
| Deactivate License | client.Licenses.DeactivateAsync(key) | GET /licenses/deactivate/{key} |
| Validate License | client.Licenses.ValidateAsync(key) | GET /licenses/validate/{key} |
βοΈ License Generators
| Feature | SDK Method | API Endpoint |
|---|---|---|
| List Generators | client.Generators.ListAsync() | GET /generators |
| Retrieve Generator | client.Generators.GetAsync(id) | GET /generators/{id} |
| Create Generator | client.Generators.CreateAsync(data) | POST /generators |
| Update Generator | client.Generators.UpdateAsync(id, data) | PUT /generators/{id} |
| Delete Generator | client.Generators.DeleteAsync(id) | DELETE /generators/{id} |
| Generate Keys (Pro) | client.Generators.GenerateAsync(id, data) | POST /generators/{id}/generate |
π Merchant & SaaS (Pro)
| Feature | SDK Method | API Endpoint |
|---|---|---|
| Customer Licenses | client.Customers.GetLicensesAsync(id) | GET /customers/{id}/licenses |
| Products/Ping | client.Products.PingAsync(data) | POST /products/ping |
| Products/Update | client.Products.UpdateAsync(key) | GET /products/update/{key} |
| Download Products | client.Products.DownloadUrl(key) | GET /products/download/latest/{key} |
| Retrieve Application | client.Applications.GetAsync(id) | GET /application/{id} |
| Download Application | client.Applications.DownloadUrl(id, token) | GET /application/download/{token} |
π Public Client API
The public client does not use WooCommerce consumer credentials and is intended for distributed applications.
| Feature | SDK Method | API Endpoint |
|---|---|---|
| Activate | publicClient.ActivateAsync(body) | POST /wp-json/lmfwc/v1/public/activate |
| Reactivate | publicClient.ReactivateAsync(body) | POST /wp-json/lmfwc/v1/public/reactivate |
| Deactivate | publicClient.DeactivateAsync(body) | POST /wp-json/lmfwc/v1/public/deactivate |
| Validate | publicClient.ValidateAsync(body) | POST /wp-json/lmfwc/v1/public/validate |
| Installed Check | publicClient.InstalledAsync(body) | POST /wp-json/lmfwc/v1/public/installed |
π The Revenue Model: Free SDK + Pro Engine
The SDK is the client-side tool bundled with your software. The merchant backend requires the Pro Engine.
| Phase | Client SDK (This Free Repo) | Pro Engine (Your WooCommerce Store) |
|---|---|---|
| Purpose | Connects your software to your store. | Handles orders, payments, and keys. |
| Availability | Free for developers. | Purchase Required Here |
π¦ 3-Minute Developer Quick Start
Step 1: Install the SDK
Requirements: .NET SDK 10.0 or newer. The library targets net10.0.
Install the package when it is available on NuGet:
dotnet add package LicenseManagerForWooCommerce.Sdk
Alternatively, clone the repository and add a project reference:
<ItemGroup> <ProjectReference Include="..\LicenseManagerForWooCommerce.Sdk\LicenseManagerForWooCommerce.Sdk.csproj" /> </ItemGroup>
Step 2: Initialization
For server-side or trusted applications, use WooCommerce REST API credentials from secure configuration:
using LicenseManagerForWooCommerce.Sdk;
var client = new LicenseManagerClient(
storeUrl: Environment.GetEnvironmentVariable("LMW_STORE_URL")!,
consumerKey: Environment.GetEnvironmentVariable("LMW_CONSUMER_KEY")!,
consumerSecret: Environment.GetEnvironmentVariable("LMW_CONSUMER_SECRET")!);
Options-based configuration is also supported:
var client = new LicenseManagerClient(new LicenseManagerClientOptions
{
StoreUrl = "https://your-store.com",
ConsumerKey = "ck_...",
ConsumerSecret = "cs_...",
Timeout = TimeSpan.FromSeconds(120),
});
Step 3: Basic Activation Pattern
try
{
var result = await client.Licenses.ActivateAsync("ABCD-1234-EFGH-5678");
// Store the activation token from result for future operations.
}
catch (LicenseManagerException ex)
{
Console.WriteLine($"Error: {ex.ApiErrorMessage}");
}
Successful calls return System.Text.Json.JsonElement. API failures throw LicenseManagerException, which exposes ApiErrorCode, ApiErrorMessage, and HttpStatusCode.
ποΈ Framework Integration
ASP.NET, Worker Services, and Trusted Applications
Use LicenseManagerClient with credentials stored in environment variables, .NET User Secrets, encrypted configuration, or a secrets manager. Register or reuse an HttpClient through your applicationβs dependency-injection container when appropriate.
Desktop, Mobile, and Distributed Software
Use LicenseManagerPublicClient with the public key from the license product. Do not ship the WooCommerce consumer secret in end-user software.
var publicClient = new LicenseManagerPublicClient(
Environment.GetEnvironmentVariable("LMW_STORE_URL")!);
await publicClient.ValidateAsync(new
{
PublicKey = Environment.GetEnvironmentVariable("LMW_PUBLIC_KEY"),
LicenseKey = "ABCD-1234-EFGH-5678",
Domain = "my-app.example.com",
});
The public client sends public_key, license_key, and domain in the JSON request body.
π§ͺ Integration Testing
The repository includes a live integration runner and mocked unit tests.
Run the unit tests without a live store:
dotnet test LicenseManagerForWooCommerce.Sdk.slnx -c Release
Configure the integration runner with environment variables, then run:
dotnet run --project LmwSdk.IntegrationRunner/LmwSdk.IntegrationRunner.csproj -c Release
| Variable | Required | Description |
|---|---|---|
| LMW_STORE_URL | Yes | WooCommerce site URL |
| LMW_CONSUMER_KEY | Yes | WooCommerce REST API key |
| LMW_CONSUMER_SECRET | Yes | WooCommerce REST API secret |
| LMW_LICENSE_KEY | For license tests | Existing license key |
| LMW_GENERATOR_ID | For generator tests | Numeric generator ID |
| LMW_CUSTOMER_ID | For customer tests | WooCommerce customer ID |
| LMW_APPLICATION_ID | For application tests | Pro application ID |
| LMW_PUBLIC_KEY | For public API tests | License product public key |
| LMW_PUBLIC_DOMAIN | No | Domain; defaults to the machine hostname |
| LMW_ACTIVATION_TOKEN | No | Existing activation token |
| LMW_RUN_MUTATIONS | No | Set to 1 only when write tests are intended |
| LMW_HTTP_TIMEOUT_SECONDS | No | HTTP timeout; defaults to 30 seconds |
| LMW_POST_LICENSE_JSON | No | Raw JSON body for license creation |
| LMW_PUT_LICENSE_JSON | No | Raw JSON body for license update |
| LMW_DELETE_LICENSE_KEY | No | Disposable license key for deletion |
Use a staging store when running mutations. Leave LMW_RUN_MUTATIONS unset for read-only endpoint checks.
π Credentials
Create WooCommerce REST API credentials under WooCommerce β Settings β Advanced β REST API.
consumer_keystarts withck_.consumer_secretstarts withcs_.- Store credentials in secure configuration, never in shared source code.
- For distributed applications, use the public client and product public key instead of shipping the consumer secret.
π Get the Pro Merchant Engine Today
Unlock the full licensing backend by upgrading to the Pro edition of License Manager for WooCommerce.