Cothery Developer Portal
Integrate Cothery licensing into your products. Verify purchases, manage activations, and automate your workflow with our API and webhooks.
License API Reference
Endpoints for verifying, activating, and managing license keys
/licenses/verify
Verify that a license key is valid and active. This is the primary endpoint you'll call from your script to check if a customer has a legitimate license.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| license_key | string | Yes | The license key to verify |
| domain | string | No | Domain where the product is installed (for domain-locked licenses) |
| product_id | integer | No | Ensure key belongs to a specific product |
Success Response (200)
{
"valid": true,
"license": {
"key": "XXXX-XXXX-XXXX-XXXX",
"status": "active",
"license_type": "regular",
"activation_count": 1,
"activation_limit": 3,
"domain": "example.com",
"expires_at": "2027-03-01T00:00:00Z",
"product": {
"id": 42,
"name": "My Awesome Script",
"version": "2.1.0"
}
}
}
Error Response (422)
{
"valid": false,
"error": "license_expired",
"message": "This license has expired."
}
Possible error codes:
license_not_found
license_expired
license_suspended
license_revoked
activation_limit_reached
domain_mismatch
/licenses/activate
Activate a license key for a specific domain. This increments the activation count and optionally locks the key to a domain. Call this during your product's setup or first-run flow.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| license_key | string | Yes | The license key to activate |
| domain | string | Yes | Domain to activate for (e.g., "mysite.com") |
| environment | string | No | "production" or "staging" (default: "production") |
Success Response (200)
{
"activated": true,
"activation_count": 2,
"activation_limit": 3,
"domain": "mysite.com",
"message": "License activated successfully."
}
/licenses/deactivate
Deactivate a license key for a specific domain. This decrements the activation count and allows the customer to move the license to another domain.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| license_key | string | Yes | The license key to deactivate |
| domain | string | Yes | Domain to deactivate |
Success Response (200)
{
"deactivated": true,
"activation_count": 1,
"message": "License deactivated for mysite.com."
}
/licenses/{license_key}
Retrieve full details about a license key including its status, activation history, and associated product information.
Success Response (200)
{
"license": {
"key": "XXXX-XXXX-XXXX-XXXX",
"status": "active",
"license_type": "extended",
"activation_count": 2,
"activation_limit": 5,
"domain": "example.com",
"created_at": "2026-01-15T10:30:00Z",
"expires_at": "2027-01-15T10:30:00Z",
"product": {
"id": 42,
"name": "My Awesome Script",
"version": "2.1.0"
},
"customer": {
"name": "John Doe",
"email": "john@example.com"
}
}
}
Rate Limiting
The API is rate-limited to protect against abuse. Current limits:
60
requests per minute
1,000
requests per hour
10,000
requests per day
Rate limit headers are included in every response: X-RateLimit-Remaining, X-RateLimit-Limit