Licenses

The Licenses API endpoints helps you manage licenses purchased through your store. You can activate licenses for specific instances, validate existing instances, and manage the associated instances. This is useful for integrating license checks directly into your software or external systems.

The license key model

The license key model represents a single license key purchased by a customer.

Properties

  • Name
    id
    Type
    integer
    Description

    (read-only) The unique identifier for the license key.

  • Name
    key
    Type
    string
    Description

    (read-only) The actual license key string

  • Name
    limit
    Type
    integer | null
    Description

    The maximum number of instances this key can be activated on. null means unlimited activations.

  • Name
    active
    Type
    boolean
    Description

    Whether the license key is currently active which you can modify via the API and which is unrelated to the status. Inactive keys cannot be activated or validated successfully.

  • Name
    status
    Type
    string
    Description

    (read-only) The status of the license key, one of: ACTIVE, INACTIVE, EXPIRED

  • Name
    expires_at
    Type
    timestamp | null
    Description

    The timestamp when the license key expires. null means the license will never expire.

  • Name
    is_expired
    Type
    boolean
    Description

    Whether the license key is expired.

  • Name
    store_id
    Type
    integer
    Description

    (read-only) The ID of the store this license key belongs to.

  • Name
    order_id
    Type
    integer | null
    Description

    (read-only) The ID of the order associated with this license key.

  • Name
    invoice_id
    Type
    integer | null
    Description

    (read-only) The ID of the associated invoice V2, if applicable.

  • Name
    product_id
    Type
    integer
    Description

    (read-only) The ID of the product this license is for.

  • Name
    variant_id
    Type
    integer
    Description

    (read-only) The ID of the specific product variant this license is for.

  • Name
    customer_id
    Type
    integer
    Description

    (read-only) The ID of the customer that purchased this license key.

  • Name
    subscription_id
    Type
    integer | null
    Description

    (read-only) The ID of the associated subscription, if applicable.

  • Name
    created_at
    Type
    timestamp
    Description

    (read-only) Time at which the license key was created.

  • Name
    updated_at
    Type
    timestamp
    Description

    (read-only) Time at which the license key was last updated.

The license instance model

The license instance model represents a single activation of a license key on a specific device or identifier.

Properties

  • Name
    id
    Type
    string (uuid)
    Description

    (read-only) The unique identifier (UUID) of the license instance. This is the instance_id used for validation.

  • Name
    license_key_id
    Type
    integer
    Description

    (read-only) The unique identifier for the parent license key which this instance is linked to.

  • Name
    name
    Type
    string
    Description

    (read-only) The name provided during activation, which you can use to identify this instance (e.g., the customer's email or HWID).

  • Name
    store_id
    Type
    integer
    Description

    (read-only) The ID of the store this instance belongs to.

  • Name
    created_at
    Type
    timestamp
    Description

    (read-only) Time at which the instance was created (activation time).

  • Name
    updated_at
    Type
    timestamp
    Description

    (read-only) Time at which the instance was last updated.


GET/v2/license-keys/:id/instances

List license instances

Retrieves a paginated list of all active instances (activations) associated with a specific license key.

Refer to the license instance model section for details on the returned object structure.

Required attributes

  • Name
    id
    Type
    integer
    Description

    The ID of the license key whose instances you want to list.

Optional Query Parameters

  • Name
    limit
    Type
    integer
    Description

    Limit the number of instances returned per page.

  • Name
    page
    Type
    integer
    Description

    The page number to retrieve.

Request

GET
/v2/license-keys/:id/instances

$request = new HttpRequest();
$request->setUrl('https://sell.app/api/v2/license-keys/1/instances'); // Add ?limit=10&page=1
$request->setMethod(HTTP_METH_GET);

$request->setHeaders([
 'accept' => 'application/json',
 'Authorization' => 'Bearer YOUR_API_TOKEN'
]);

try {
 $response = $request->send();
 echo $response->getBody();
} catch (HttpException $ex) {
 echo $ex;
}

Response

{
  "data": [
    {
      "id": "01965f1d-f038-7116-b57f-9e7ecb4e7b8f",
      "name": "zezima@osrs.com",
      "license_key_id": 1,
      "store_id": 1,
      "created_at": "2025-04-22T20:08:39.000000Z",
      "updated_at": "2025-04-22T20:08:39.000000Z"
    }
    // ... other instances for license key 1
  ],
   "links": { /* ... pagination links ... */ },
   "meta": { /* ... pagination meta ... */ }
}

GET/v2/license-keys/:license_key_id/instances/:instance_id

Retrieve a license instance

Retrieves the details of a specific license instance using the license key ID and the instance's unique UUID.

Refer to the license instance model section for details on the returned object structure.

Required attributes

  • Name
    license_key_id
    Type
    integer
    Description

    The ID of the parent license key.

  • Name
    instance_id
    Type
    string (uuid)
    Description

    The unique UUID of the instance to retrieve.

Request

GET
/v2/license-keys/:id/instances/:id

$request = new HttpRequest();
// Note: Ensure instance_id is the UUID
$request->setUrl('https://sell.app/api/v2/license-keys/1/instances/9ebd2de0-61fb-4966-a319-2a75b27f5ddf');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders([
 'accept' => 'application/json',
 'Authorization' => 'Bearer YOUR_API_TOKEN'
]);

try {
 $response = $request->send();
 echo $response->getBody();
} catch (HttpException $ex) {
 echo $ex;
}

Response

{
    "data": {
        "id": "9ebd37af-2077-42f9-9f88-d96cfc6ef1a8",
        "license_key_id": 1,
        "name": "zezima@osrs.com",
        "store_id": 1,
        "created_at": "2025-04-22T20:53:22.000000Z",
        "updated_at": "2025-04-22T20:53:22.000000Z"
    }
}