License Key Instances

In Lemon Squeezy, a license key instance represents a single instance (or activation) of a license key that has been issued to a customer.

A license key instance belongs to a License Key.

Note, if you're looking to integrate license keys into your application (e.g. activate/validate/deactivate license keys), see our separate license API documentation.


The license key instance object

Attributes


license_key_id

The ID of the license key this instance belongs to.


identifier

The unique identifier (UUID) for this instance. This is the instance_id returned when activating a license key.


name

The name of the license key instance.


created_at

An ISO 8601 formatted date-time string indicating when the object was created.


updated_at

An ISO 8601 formatted date-time string indicating when the object was last updated.

License key instance object

{ "type": "license-key-instances", "id": "1", "attributes": { "license_key_id": 1, "identifier": "f70a79fa-6054-433e-9c1b-6075344292e4", "name": "example.com", "created_at": "2021-05-24T14:15:07.000000Z", "updated_at": "2021-05-24T14:15:07.000000Z" }, }

Retrieve a license key instance

Retrieves the license key instance with the given ID.

GET /v1/license-key-instances/:id

curl "https://api.lemonsqueezy.com/v1/license-key-instances/1" -H 'Accept: application/vnd.api+json' -H 'Content-Type: application/vnd.api+json' -H 'Authorization: Bearer {api_key}'

Returns

Returns a license key instance object.

Response

{ "jsonapi": { "version": "1.0" }, "links": { "self": "https://api.lemonsqueezy.com/v1/license-key-instances/1" }, "data": { "type": "license-key-instances", "id": "1", "attributes": { "license_key_id": 1, "identifier": "f70a79fa-6054-433e-9c1b-6075344292e4", "name": "example.com", "created_at": "2022-11-14T11:45:39.000000Z", "updated_at": "2022-11-14T11:45:39.000000Z" }, "relationships": { "license-key": { "links": { "related": "https://api.lemonsqueezy.com/v1/license-key-instances/1/license-key", "self": "https://api.lemonsqueezy.com/v1/license-key-instances/1/relationships/license-key" } } }, "links": { "self": "https://api.lemonsqueezy.com/v1/license-key-instances/1" } } }

List all license key instances

Returns a paginated list of license key instances.

Parameters


license_key_id

Only return instances belonging to the license key with this ID.

GET /v1/license-key-instances

curl "https://api.lemonsqueezy.com/v1/license-key-instances" -H 'Accept: application/vnd.api+json' -H 'Content-Type: application/vnd.api+json' -H 'Authorization: Bearer {api_key}'
curl "https://api.lemonsqueezy.com/v1/license-key-instances?filter[license_key_id]=25" -H 'Accept: application/vnd.api+json' -H 'Content-Type: application/vnd.api+json' -H 'Authorization: Bearer {api_key}'

Returns

Returns a paginated list of license key instance objects ordered by id.

Response

{ "meta": { "page": { "currentPage": 1, "from": 1, "lastPage": 1, "perPage": 10, "to": 10, "total": 10 } }, "jsonapi": { "version": "1.0" }, "links": { "first": "https://api.lemonsqueezy.com/v1/license-key-instances?page%5Bnumber%5D=1&page%5Bsize%5D=10&sort=id", "last": "https://api.lemonsqueezy.com/v1/license-key-instances?page%5Bnumber%5D=1&page%5Bsize%5D=10&sort=id" }, "data": [ { "type": "license-key-instances", "id": "1", "attributes": { "license_key_id": 1, "identifier": "f70a79fa-6054-433e-9c1b-6075344292e4", "name": "example.com", "created_at": "2022-11-14T11:45:39.000000Z", "updated_at": "2022-11-14T11:45:39.000000Z" }, "relationships": { "license-key": { "links": { "related": "https://api.lemonsqueezy.com/v1/license-key-instances/1/license-key", "self": "https://api.lemonsqueezy.com/v1/license-key-instances/1/relationships/license-key" } } }, "links": { "self": "https://api.lemonsqueezy.com/v1/license-key-instances/1" } }, {...}, {...}, ] }