Validate License Endpoint #
Public endpoint to validate a license key.
Endpoint Details #
| Property | Value |
|---|---|
| Method | POST |
| Endpoint | /licenses/validate |
| Auth | None (public) |
| Rate Limit | Strict (60/hour) |
Request Body #
| Field | Type | Required | Description |
|---|---|---|---|
| license_key | string | Yes | The license key to validate |
| product_id | integer | Yes | Product ID the license should belong to (enforced in v2.0.0) |
| site_url | string | No | Site URL for activation status check |
Product ID Validation (v2.0.0) #
The product_id parameter is required and validated against the license record. If the license does not belong to the specified product, the endpoint returns dmsilm_product_mismatch (400) regardless of whether the license key is otherwise valid.
This prevents a license key issued for Product A from being used to validate access on Product B.
Success Response #
| Field | Description |
|---|---|
| valid | true |
| activated | Whether this site_url is currently activated |
| activations_remaining | Activation slots available |
| expires_date | Expiration date (null for lifetime licenses) |
| status | License status string |
| license_type | Slug of the License Type applied (v1.2.0) |
| activation_limit | Effective activation limit (v1.2.0) |
| license_duration | Effective duration, “lifetime” or months as integer string (v1.2.0) |
About variation metadata fields: license_type, activation_limit, and license_duration reflect the resolved effective settings from resolve_effective_settings(). For variable products, these values come from the purchased variation’s settings, falling back to product settings, then License Type defaults.
Invalid Response #
| Field | Description |
|---|---|
| valid | false |
| error | Error code |
| message | Human-readable message |
Common Errors #
| Error | Meaning |
|---|---|
| license_not_found | Key does not exist |
| license_expired | License has expired |
| license_suspended | License is suspended |
| dmsilm_product_mismatch | License does not belong to the provided product_id |
