Skip to main content
POST
/
v1
/
licenses
TypeScript SDK
import { Solifyn } from 'solifyn';

const solifyn = new Solifyn({ apiKey: 'your_private_api_key_here' });

// Create a new license key
const license = await solifyn.licenses.create({
  productId: 'prod_019e56a1...',
  customerId: 'cust_019e56a1...',
  activationLimit: 5,
  expiryHours: 720
});
console.log('License Created:', license);
{
  "id": "lic_hyQQhhNzfEuvv",
  "key": "A184-99C2-8CBE",
  "status": "ACTIVE",
  "businessId": "biz_345TUESrCDPvrb",
  "productId": "prod_hyQQhhNzfEuvv",
  "paymentId": "pay_3r2FgHXp9",
  "customerId": "cust_3r2FgHXp9",
  "activationLimit": 3,
  "activationMessage": "Thank you! Your license is now active.",
  "instancesCount": 1,
  "expiryHours": 720,
  "expiresAt": "2027-01-01T00:00:00.000Z",
  "filters": null,
  "archived": false,
  "createdAt": "2026-05-11T01:12:25.764Z",
  "updatedAt": "2026-05-18T09:45:37.166Z"
}

Authorizations

Authorization
string
header
required

Authenticate requests using your standard bearer API key (e.g. YOUR_API_KEY).

Body

application/json
productId
string<uuid>
required

The unique product identifier (internal product ID or ID) for which the license key will be issued.

customerId
string
required

The unique customer identifier (internal customer ID or ID) who will own this license key.

activationLimit
integer

The maximum number of concurrent device or server activations allowed for this license key.

expiryHours
integer

Relative validity period of the license in hours starting from the time of creation.

key
string

Optional custom license key string. If not provided, a random uppercase cryptographic serial key (e.g., ABCD-EFGH) will be generated automatically.

Response

200 - application/json

Successfully created license.

Represents a cryptographically secure software license key issued to a customer upon purchase or manual issuance.

id
string
required

The unique prefix-based identifier of the license key.

Example:

"lic_hyQQhhNzfEuvv"

key
string
required

The cryptographically generated license key string delivered to the customer.

Example:

"A184-99C2-8CBE"

status
enum<string>
required

Lifecycle status of the license. ACTIVE = active. DISABLED = suspended. REVOKED = hard-revoked.

Available options:
ACTIVE,
DISABLED,
REVOKED
Example:

"ACTIVE"

businessId
string
required

The unique identifier associated with the business this license belongs to.

Example:

"biz_345TUESrCDPvrb"

productId
string | null
required

The unique ID of the product this license key is associated with.

Example:

"prod_hyQQhhNzfEuvv"

paymentId
string | null
required

The unique payment identifier that triggered the issuance of this license key.

Example:

"pay_3r2FgHXp9"

customerId
string | null
required

The unique customer identifier (ID) who received this license key.

Example:

"cust_3r2FgHXp9"

activationLimit
number | null
required

Maximum number of simultaneous active device instances allowed for this license. Null means unlimited.

Example:

3

activationMessage
string | null
required

Optional message displayed to the customer upon successful activation.

Example:

"Thank you! Your license is now active."

instancesCount
number
required

Running count of how many times this license key has been activated.

Example:

1

expiryHours
number | null
required

Relative expiry duration in hours from the time of issuance.

Example:

720

expiresAt
string | null
required

Absolute expiration timestamp. The license becomes invalid after this point.

Example:

"2027-01-01T00:00:00.000Z"

filters
object
required

Optional custom metadata filters associated with the license.

Example:

null

archived
boolean
required

Indicates if the license key is archived.

Example:

false

createdAt
string
required

Timestamp indicating exactly when the license key was issued.

Example:

"2026-05-11T01:12:25.764Z"

updatedAt
string
required

Timestamp indicating when the license key was last modified.

Example:

"2026-05-18T09:45:37.166Z"