In Lemon Squeezy, a license key can be used to externally verify that customer has access to a product.
A license key belongs to a Store and is associated with an Order, an Order Item and a Product.
Note, if you’re looking to integrate license keys into your application (e.g. activate/validate/deactivate license keys), see our separate licenses API documentation.
The ID of the store this license key belongs to.
The ID of the order associated with this license key.
The ID of the order item associated with this license key.
The ID of the product associated with this license key.
The full name of the customer.
The email address of the customer.
A “short” representation of the license key, made up of the string “XXXX-” followed by the last 12 characters of the license key.
The activation limit of this license key.
A count of the number of instances this license key has been activated on.
Has the value true
if this license key has been disabled.
The status of the license key. One of inactive
, active
, expired
, disabled
.
The formatted status of the license key.
An ISO-8601 formatted date-time string indicating when the license key expires. Can be null
if the license key is perpetual.
An ISO-8601 formatted date-time string indicating when the object was created.
An ISO-8601 formatted date-time string indicating when the object was last updated.
{
"type": "license-keys",
"id": "1",
"attributes": {
"store_id": 1,
"order_id": 1,
"order_item_id": 1,
"product_id": 1,
"user_name": "Darlene Daugherty",
"user_email": "gernser@yahoo.com",
"key_short": "XXXX-81144c51d1da",
"activation_limit": 5,
"instances_count": 0,
"disabled": 0,
"status": "inactive",
"status_formatted": "Inactive",
"expires_at": null,
"created_at": "2021-05-24T14:15:07.000000Z",
"updated_at": "2021-05-24T14:15:07.000000Z"
},
}
Retrieves the license key with the given ID.
Returns a license key object.
curl "https://api.lemonsqueezy.com/v1/license-keys/1" \
-H 'Accept: application/vnd.api+json' \
-H 'Content-Type: application/vnd.api+json' \
-H 'Authorization: Bearer {api_key}'
{
"jsonapi": {
"version": "1.0"
},
"links": {
"self": "https:\/\/api.lemonsqueezy.com\/v1\/license-keys\/1"
},
"data": {
"type": "license-keys",
"id": "1",
"attributes": {
"store_id": 1,
"order_id": 1,
"order_item_id": 1,
"product_id": 1,
"user_name": "Darlene Daugherty",
"user_email": "gernser@yahoo.com",
"key_short": "XXXX-81144c51d1da",
"activation_limit": 5,
"instances_count": 0,
"disabled": 0,
"status": "inactive",
"status_formatted": "Inactive",
"expires_at": null,
"created_at": "2021-05-24T14:15:07.000000Z",
"updated_at": "2021-05-24T14:15:07.000000Z"
},
"relationships": {
"store": {
"links": {
"related": "https:\/\/api.lemonsqueezy.com\/v1\/license-keys\/1\/store",
"self": "https:\/\/api.lemonsqueezy.com\/v1\/license-keys\/1\/relationships\/store"
}
},
"order": {
"links": {
"related": "https:\/\/api.lemonsqueezy.com\/v1\/license-keys\/1\/order",
"self": "https:\/\/api.lemonsqueezy.com\/v1\/license-keys\/1\/relationships\/order"
}
},
"order-item": {
"links": {
"related": "https:\/\/api.lemonsqueezy.com\/v1\/license-keys\/1\/order-item",
"self": "https:\/\/api.lemonsqueezy.com\/v1\/license-keys\/1\/relationships\/order-item"
}
},
"product": {
"links": {
"related": "https:\/\/api.lemonsqueezy.com\/v1\/license-keys\/1\/product",
"self": "https:\/\/api.lemonsqueezy.com\/v1\/license-keys\/1\/relationships\/product"
}
}
},
"links": {
"self": "https:\/\/api.lemonsqueezy.com\/v1\/license-keys\/1"
}
}
}
Returns a paginated list of license keys.
Only return license keys belonging to the store with this ID.
Only return license keys belonging to the order with this ID.
Only return license keys belonging to the order item with this ID.
Only return license keys belonging to the product with this ID.
Returns a paginated list of license key objects ordered by id
.
curl "https://api.lemonsqueezy.com/v1/license-keys" \
-H 'Accept: application/vnd.api+json' \
-H 'Content-Type: application/vnd.api+json' \
-H 'Authorization: Bearer {api_key}'
{
"meta": {
"page": {
"currentPage": 1,
"from": 1,
"lastPage": 1,
"perPage": 10,
"to": 10,
"total": 10
}
},
"jsonapi": {
"version": "1.0"
},
"links": {
"first": "https:\/\/api.lemonsqueezy.test\/v1\/license-keys?page%5Bnumber%5D=1&page%5Bsize%5D=10&sort=id",
"last": "https:\/\/api.lemonsqueezy.test\/v1\/license-keys?page%5Bnumber%5D=1&page%5Bsize%5D=10&sort=id",
},
"data": [
{
"type": "license-keys",
"id": "1",
"attributes": {
"store_id": 1,
"order_id": 1,
"order_item_id": 1,
"product_id": 1,
"user_name": "Darlene Daugherty",
"user_email": "gernser@yahoo.com",
"key_short": "XXXX-81144c51d1da",
"activation_limit": 5,
"instances_count": 0,
"disabled": 0,
"status": "inactive",
"status_formatted": "Inactive",
"expires_at": null,
"created_at": "2021-05-24T14:15:07.000000Z",
"updated_at": "2021-05-24T14:15:07.000000Z"
},
"relationships": {
"store": {
"links": {
"related": "https:\/\/api.lemonsqueezy.test\/v1\/license-keys\/1\/store",
"self": "https:\/\/api.lemonsqueezy.test\/v1\/license-keys\/1\/relationships\/store"
}
},
"order": {
"links": {
"related": "https:\/\/api.lemonsqueezy.test\/v1\/license-keys\/1\/order",
"self": "https:\/\/api.lemonsqueezy.test\/v1\/license-keys\/1\/relationships\/order"
}
},
"order-item": {
"links": {
"related": "https:\/\/api.lemonsqueezy.test\/v1\/license-keys\/1\/order-item",
"self": "https:\/\/api.lemonsqueezy.test\/v1\/license-keys\/1\/relationships\/order-item"
}
},
"product": {
"links": {
"related": "https:\/\/api.lemonsqueezy.test\/v1\/license-keys\/1\/product",
"self": "https:\/\/api.lemonsqueezy.test\/v1\/license-keys\/1\/relationships\/product"
}
}
},
"links": {
"self": "https:\/\/api.lemonsqueezy.test\/v1\/license-keys\/1"
}
},
{...},
{...},
]
}