Sell on Cothery

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

POST /licenses/verify
Requires API Key

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

ParameterTypeRequiredDescription
license_keystringYesThe license key to verify
domainstringNoDomain where the product is installed (for domain-locked licenses)
product_idintegerNoEnsure 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
POST /licenses/activate
Requires API Key

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

ParameterTypeRequiredDescription
license_keystringYesThe license key to activate
domainstringYesDomain to activate for (e.g., "mysite.com")
environmentstringNo"production" or "staging" (default: "production")

Success Response (200)

{
  "activated": true,
  "activation_count": 2,
  "activation_limit": 3,
  "domain": "mysite.com",
  "message": "License activated successfully."
}
POST /licenses/deactivate
Requires API Key

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

ParameterTypeRequiredDescription
license_keystringYesThe license key to deactivate
domainstringYesDomain to deactivate

Success Response (200)

{
  "deactivated": true,
  "activation_count": 1,
  "message": "License deactivated for mysite.com."
}
GET /licenses/{license_key}
Requires API 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