Developers API

Introduction

The public API lets the products you sell verify their buyers' licence codes, and lets you read your own account statistics. Paths below are relative to this site's address. Responses are JSON with a status of success or fail; a success carries a data object, a failure an error message.

Stable by design. Products installed years ago still call this API, so existing paths and fields never change. New fields may be added: read the ones you need and ignore any you do not know.

Quick start: verify a licence

No key is needed. From a terminal:

curl https://alkanyx.com/api/v1/license/YOUR-LICENCE-CODE

From PHP, for example in your product's installer:

$url = 'https://alkanyx.com/api/v1/license/' . rawurlencode($code);
$response = @file_get_contents($url);
$result = $response === false ? null : json_decode($response, true);

if ($result === null) {
    // The API could not be reached: ask the buyer to try again later.
} elseif ($result['status'] === 'success') {
    // Valid: $result['data']['itemId'] tells you which item was bought.
} else {
    // Unknown or refunded code: $result['error'] says why.
}

Check the code once at installation or activation and remember the answer, rather than calling the API on every page your product serves. Treat a network error as "try again later", not as an invalid licence.

API keys

Only your statistics need a key. Create one under Settings → API; it is shown once when created and can be revoked at any time. Send it as X-Authorization: Bearer <key> (the Authorization header is accepted too).

Public endpoints

GET /api/v1/APITest answers with a success status when the API is up.

GET /api/v1/license/{code} checks a licence code. A valid code answers:

{
  "status": "success",
  "data": {
    "itemId": 1337,
    "itemName": "Dummy App template",
    "datePurchased": "2026-06-01 23:10:50",
    "licence": "personal",
    "variant": "Personal licence"
  }
}

Refunded, pending and unknown codes answer {"status": "fail", "error": "No license found."}. The first three keys are the historical shape; licence and variant were added with item variants.

Activations per domain

A product can record where its code is in use. Both calls take a domain field (a host name or a URL) and answer in the same shape as the check above.

POST /api/v1/license/{code}/activate claims the domain for the code. Calling it again for the same domain is safe.

curl -X POST -d "domain=shop.example.com" https://alkanyx.com/api/v1/license/YOUR-LICENCE-CODE/activate

A success answers:

{
  "status": "success",
  "data": {
    "domain": "shop.example.com",
    "activations": 1,
    "limit": null
  }
}

limit is the number of domains the licence allows at once, or null when there is none. Beyond it the call answers {"status": "fail", "error": "Activation limit reached. Release a domain on your licence page first."}. Local development hosts (localhost, private addresses, .test and .local names) always succeed and never use a slot.

POST /api/v1/license/{code}/deactivate gives the domain back, for example on uninstall. Buyers can also release a domain from the licence page of the purchase. A refunded purchase loses all its activations.

Private endpoints

GET /api/v1/stats/{userId} returns the numbers of the key's owner; your user id is shown on Settings → API.

curl -H "X-Authorization: Bearer YOUR-KEY" https://alkanyx.com/api/v1/stats/YOUR-USER-ID
{
  "status": "success",
  "data": {
    "itemsPosted": 12,
    "userComments": 48,
    "userSales": 310,
    "userBadges": 4,
    "userFollowers": 95,
    "dateJoined": "2017-04-02 10:15:00"
  }
}

A user id other than the owner's answers 403 with {"status": "fail", "error": "This key cannot read stats for that user."}; a missing or revoked key answers 401.

Rate limits and errors

  • Licence checks: 120 requests a minute per IP address.
  • Activations and deactivations: 30 a minute per IP address.
  • Every other endpoint: 60 a minute per IP address.

Over a limit the API answers HTTP 429 with a Retry-After header; wait that many seconds before trying again. A licence that is not valid is not an HTTP error: the check answers 200 with "status": "fail", so always read status.

Last updated: 2026-11-23