Skip to content

Licenses

A License is what is granted to a customer so that they can access your product. A License's key should be protected as it is used to authenticate end-user endpoints.

Licenses can have notes. A note is a way for you to write down extra relevant information to the License itself.

You can disable a license at any time by setting it's deactivated field to true.

Get all licenses

Endpoint: GET https://api.software-licensing.io/v1/licenses

Parameters(Query)

ts
pageSize?: integer
ts
pageNumber?: integer
ts
search: {
}
ts
sort_by?: string[]
ts
productId?: string
ts
customerId?: string
ts
customerExternalId?: string

Responses

  • 200 Success

application/json

ts
{
  data: {
    id: string
    key: string
    expirationDate: string
    registrationDate: string
    deactivated: boolean
    plan: {
      id: string
      name: string
      description: string
      product: {
        id: string
        name: string
        deactivated: boolean
      }
      cost: number
      deactivated: boolean
      duration: integer
    }
    previousLicenseId?: string
    nextLicenseId?: string
    valid: string
    customer: {
      id: string
      name: string
      description: string
      externalId: string
      licenseCount: integer
    }
    licenseEntitlements: {
      id: string
      entitlement: {
        id: string
        name: string
        consumptionPeriod: {
          id: string
          name: string
        }
        activationsEnabled: boolean
        deactivated: boolean
      }
      threshold?: number
      actual: number
      refreshDate: string
      activations: {
        id: string
        value: string
        active: boolean
      }[]
    }[]
    notes: {
      id: string
      content: string
    }[]
  }[]
  pagination: {
    itemCount: integer
    totalPages: integer
    currentPage: integer
    nextPage?: integer
    previousPage?: integer
  }
}

Create a license

Endpoint: POST https://api.software-licensing.io/v1/licenses

If duration (measured in days) is provided, it must be greater or equal to 0. A duration of value 0 makes the license perpetual.

Providing a userId and and omitting the customerId field creates a new blank Customer with its externalId set to userId

RequestBody

ts
{
  planName: string
  productId: string
  customerId?: string
  userId?: string
  regDate: string
  duration?: integer
  previousLicenseId?: string
  notes?: string[]
}

Responses

  • 201 Returns created License.

application/json

ts
{
  id: string
  key: string
  expirationDate: string
  registrationDate: string
  deactivated: boolean
  plan: {
    id: string
    name: string
    description: string
    product: {
      id: string
      name: string
      deactivated: boolean
    }
    cost: number
    deactivated: boolean
    duration: integer
  }
  previousLicenseId?: string
  nextLicenseId?: string
  valid: string
  customer: {
    id: string
    name: string
    description: string
    externalId: string
    licenseCount: integer
  }
  licenseEntitlements: {
    id: string
    entitlement: {
      id: string
      name: string
      consumptionPeriod: {
        id: string
        name: string
      }
      activationsEnabled: boolean
      deactivated: boolean
    }
    threshold?: number
    actual: number
    refreshDate: string
    activations: {
      id: string
      value: string
      active: boolean
    }[]
  }[]
  notes: {
    id: string
    content: string
  }[]
}

Get a license

Endpoint: GET https://api.software-licensing.io/v1/licenses/license/{id}

Responses

  • 200 Success

application/json

ts
{
  id: string
  key: string
  expirationDate: string
  registrationDate: string
  deactivated: boolean
  plan: {
    id: string
    name: string
    description: string
    product: {
      id: string
      name: string
      deactivated: boolean
    }
    cost: number
    deactivated: boolean
    duration: integer
  }
  previousLicenseId?: string
  nextLicenseId?: string
  valid: string
  customer: {
    id: string
    name: string
    description: string
    externalId: string
    licenseCount: integer
  }
  licenseEntitlements: {
    id: string
    entitlement: {
      id: string
      name: string
      consumptionPeriod: {
        id: string
        name: string
      }
      activationsEnabled: boolean
      deactivated: boolean
    }
    threshold?: number
    actual: number
    refreshDate: string
    activations: {
      id: string
      value: string
      active: boolean
    }[]
  }[]
  notes: {
    id: string
    content: string
  }[]
}

Update a license

Endpoint: PUT https://api.software-licensing.io/v1/licenses/license/{id}

Expiration date needs to be after Registration date.

List of notes provided will replace the existing list. You do not have to provide an Id for new Notes.

RequestBody

ts
{
  expirationDate?: string
  registrationDate?: string
  deactivated?: boolean
  customerId?: string
  notes: {
    id?: string
    content?: string
  }[]
}

Responses

  • 204 License was updated successfully

Delete a license

Endpoint: DELETE https://api.software-licensing.io/v1/licenses/license/{id}

Responses

  • 204 License was updated successfully

Get recreated license

Endpoint: POST https://api.software-licensing.io/v1/licenses/license/recreated

Used to help manage the scenario where a license has ended and been recreated (renewed).

If the posted licenseKey belongs to a license that has been recreated,

this endpoint returns the recreated license key. If a chain of recreated licenses exists

this returns the latest valid license. You can only use this with a license that has ended

in the past 10 days.

RequestBody

ts
{
  licenseKey: string
}

Responses

  • 200 Success

application/json

ts
{
  licenseKey: string
}

Validate a license by key

Endpoint: POST https://api.software-licensing.io/v1/licenses/license/validate

RequestBody

ts
{
  licenseKey: string
}

Responses

  • 200 Success

application/json

ts
{
  id: string
  key: string
  expirationDate: string
  registrationDate: string
  deactivated: boolean
  plan: {
    id: string
    name: string
    description: string
    product: {
      id: string
      name: string
      deactivated: boolean
    }
    cost: number
    deactivated: boolean
    duration: integer
  }
  previousLicenseId?: string
  nextLicenseId?: string
  valid: string
  licenseEntitlements: {
    id: string
    entitlement: {
      id: string
      name: string
      consumptionPeriod: {
        id: string
        name: string
      }
      activationsEnabled: boolean
      deactivated: boolean
    }
    threshold?: number
    actual: number
    refreshDate: string
    activations: {
      id: string
      value: string
      active: boolean
    }[]
  }[]
}

Recreate a license

Endpoint: POST https://api.software-licensing.io/v1/licenses/recreate

Creates a new license with the same parameters as a previous license.

RequestBody

ts
{
  previousLicenseId?: string
  regDate: string
  duration?: integer
  keepActivations?: boolean
}

Responses

  • 201 Returns created License.

application/json

ts
{
  id: string
  key: string
  expirationDate: string
  registrationDate: string
  deactivated: boolean
  plan: {
    id: string
    name: string
    description: string
    product: {
      id: string
      name: string
      deactivated: boolean
    }
    cost: number
    deactivated: boolean
    duration: integer
  }
  previousLicenseId?: string
  nextLicenseId?: string
  valid: string
  customer: {
    id: string
    name: string
    description: string
    externalId: string
    licenseCount: integer
  }
  licenseEntitlements: {
    id: string
    entitlement: {
      id: string
      name: string
      consumptionPeriod: {
        id: string
        name: string
      }
      activationsEnabled: boolean
      deactivated: boolean
    }
    threshold?: number
    actual: number
    refreshDate: string
    activations: {
      id: string
      value: string
      active: boolean
    }[]
  }[]
  notes: {
    id: string
    content: string
  }[]
}

Check if a license with a specific key and activation exists

Endpoint: POST https://api.software-licensing.io/v1/licenses/license/activation

RequestBody

ts
{
  licenseKey: string
  activationValue: string
}

Responses

  • 200 Returns specified license

application/json

ts
{
  id: string
  key: string
  expirationDate: string
  registrationDate: string
  deactivated: boolean
  plan: {
    id: string
    name: string
    description: string
    product: {
      id: string
      name: string
      deactivated: boolean
    }
    cost: number
    deactivated: boolean
    duration: integer
  }
  previousLicenseId?: string
  nextLicenseId?: string
  valid: string
  customer: {
    id: string
    name: string
    description: string
    externalId: string
    licenseCount: integer
  }
  licenseEntitlements: {
    id: string
    entitlement: {
      id: string
      name: string
      consumptionPeriod: {
        id: string
        name: string
      }
      activationsEnabled: boolean
      deactivated: boolean
    }
    threshold?: number
    actual: number
    refreshDate: string
    activations: {
      id: string
      value: string
      active: boolean
    }[]
  }[]
  notes: {
    id: string
    content: string
  }[]
}

Update the actual value of a license

Endpoint: PUT https://api.software-licensing.io/v1/licenses/license/actual

New actual value has to be higher than the previous value.

RequestBody

ts
{
  actual: integer
  licenseKey: string
  entitlementName: string
}

Responses

  • 204 License was updated successfully

Deactivate a license

Endpoint: PUT https://api.software-licensing.io/v1/licenses/license/{key}/deactivate

This endpoint exists for testing, and only exists when running the API in development

Responses

  • 204 License was deactivated successfully