Deactivate a License Key

POST

/v1/licenses/deactivate

Deactivate a license key instance.


Parameters

license_key Required

The license key to deactivate.

instance_id Required

The instance ID returned when activating a license key.


curl -X POST https://api.lemonsqueezy.com/v1/licenses/deactivate \
  -H "Accept: application/json" \
  -d "license_key=38b1460a-5104-4067-a91d-77b872934d51" \
  -d "instance_id=f90ec370-fd83-46a5-8bbd-44a241e78665"

Returns

deactivated

A boolean indicating whether the license key was successfully deactivated.

error

An error message if the license key could not be deactivated. This will be null if the license key was deactivated successfully.

license_key

The information about the license key that was deactivated.

meta

Additional information about the license key, including the order, product, variant, and customer information.


ID fields in the meta object can be used to fetch data related to the license key, such as relevant order/product information, from the Lemon Squeezy API. The meta object also contains convenience information from the license key, including product and variant names, and the customer’s name and email address.

{
  "deactivated": true,
  "error": null,
  "license_key": {
    "id": 1,
    "status": "inactive",
    "key": "38b1460a-5104-4067-a91d-77b872934d51",
    "activation_limit": 5,
    "activation_usage": 0,
    "created_at": "2021-01-24T14:15:07.000000Z",
    "expires_at": null
  },
  "meta": {
    "store_id": 1,
    "order_id": 2,
    "order_item_id": 3,
    "product_id": 4,
    "product_name": "Lemonade",
    "variant_id": 5,
    "variant_name": "Citrus Burst",
    "customer_id": 6,
    "customer_name": "John Doe",
    "customer_email": "[email protected]"
  }
}

Was this page helpful?