Skip to main content
Chariow provides built-in license key management for software products. Licenses are automatically generated when customers purchase license-type products and can be activated, validated, and revoked through the API.

License Object

A license contains comprehensive information about its status, activation history, and validity:

Key Fields

  • license.key: The unique license key string (e.g., ABC-123-XYZ-789)
  • license.masked_key: Masked version for display (e.g., ABC-***-***-789)
  • status: Current license status (see table below)
  • is_active: Boolean indicating if the license is currently active and usable
  • is_expired: Boolean indicating if the license has expired
  • can_activate: Boolean indicating if the license can be activated (has remaining slots)
  • activations.count: Current number of device activations
  • activations.max: Maximum allowed activations
  • activations.remaining: Number of activation slots remaining
  • certificate_url: URL to download the license certificate (if available)
  • activated_at: When the license was first activated (null if never activated)
  • expires_at: When the license will expire (null for lifetime licenses)
  • revoked_at: When the license was revoked (null if not revoked)

License Statuses

Listing Licenses

Retrieve all issued licenses for your store:

Query Parameters

Filtering Examples

Getting a License by Key

Retrieve a specific license using its license key:

Validating a License

To validate a license in your application, retrieve it and check the status:

Activating a License

Activate a license on a device. The system automatically captures IP address and user agent:

First Activation Behaviour

On the first activation:
  • Status changes from pending_activation to active
  • activated_at timestamp is set
  • expires_at is calculated based on product validity period
  • activation_count increments to 1

Subsequent Activations

On additional activations:
  • activation_count is incremented
  • A new activation record is created
  • License status remains active

Licences That Need No Activation

A product can be configured so that its licences never require an activation call. Set requires_activation to false in the product’s licence settings from your Chariow dashboard. This is the mode for SaaS products and services that police their own devices and have no reason to call back into Chariow. From then on, every licence the product issues:
  • is created already active — the status is active, never pending_activation;
  • has activated_at stamped at issuance;
  • starts its validity period at issuance, so expires_at is computed from the purchase date rather than from a first activation;
  • emits both the license.issued and the license.activated Pulse events at once.
Licences issued before the setting was turned off keep their current state. One that is still pending_activation can be activated as usual.
Calling the activation endpoint on a licence that is already active under this mode returns 400:
Validate such licences with GET /v1/licenses/{licenseKey} instead of activating them.

Activation Limits

Each license has a maximum number of activations (max_activations). When the limit is reached, further activations will fail:
Check can_activate and activations.remaining before attempting activation.

Revoking a License

Revoke a license to prevent further use:
Revoking a license is permanent. The license cannot be reactivated after revocation.

Getting Activation History

View all activations for a specific license with detailed device tracking:

Response

What’s Tracked

Each activation record contains:
  • IP Address: Automatically captured from the activation request, with geolocation
  • User Agent: Parsed browser and platform information
  • Device Identifier: Optional identifier you provide (MAC address, UUID, etc.)
  • Timestamp: When the activation occurred
  • Metadata: Optional custom data
This is useful for:
  • Auditing license usage
  • Detecting suspicious activity
  • Providing customers with device management
  • Debugging activation issues

Implementation Example

Here’s a complete example of license validation in a desktop application:

API Endpoints Summary

Best Practices

Security

  • Never expose your API key in client-side code
  • Use API keys server-side only
  • Validate licenses server-side before granting access
  • Store license keys securely on the customer’s device

Device Identification

  • Use unique, persistent device identifiers (MAC address, hardware UUID)
  • Don’t use user-changeable identifiers (computer name, username)
  • Consider platform-specific identifiers (Windows: machine GUID, macOS: hardware UUID)

Activation Management

  • Check can_activate before attempting activation
  • Display activations_remaining to users
  • Implement device management UI for customers
  • Handle activation errors gracefully

Validation Frequency

  • Validate on application startup
  • Re-validate periodically (e.g., every 24 hours)
  • Cache validation results locally
  • Implement offline grace period

Error Handling

  • Handle network errors gracefully
  • Provide clear error messages to users
  • Implement retry logic with exponential backoff
  • Log activation attempts for debugging

Products Guide

Create license-type products

Licenses API

View the complete Licenses API reference

Get License

Retrieve license details

Activate License

Activate on a device