Authors keep 78% of every sale. No exclusivity, no listing fee.

For authors

License API

Every purchase issues a key. Your product can ask this install three things: activate a site, check that a site is still allowed to run, and free the seat again. No SDK is needed — it is one JSON endpoint.

What your item must do if we handle licensing

This is the requirement behind leaving the box on the item form unticked. If you would rather do licensing yourself, tick I handle the license inside my item instead and none of this applies.

1. Ask for the key and activate the site

When the buyer installs the item or opens it for the first time, ask for their license key and have them confirm the address the item will run on. From your server, send action=activate with that key and the domain. If the answer has ok and valid both true, save the key on the server and let the item run. If it does not, show the message in the answer and do not treat the item as licensed.

Activating the same domain again is safe and does not use a second seat. A new domain uses a seat: when every seat is taken the answer says limit_reached, and the buyer has to release another site first.

2. Check the site again, at least once a day

On a schedule — once a day is the minimum, and also whenever the item checks for updates — send action=validate with the key and the same domain. A true ok and valid means the site may keep running. Anything else means it may not: close the licensed parts of the item or show a clear notice that the license is not valid, and record the error code. Do not ignore a failed check.

Validation covers the cases that change after purchase: a refunded order answers refunded, a site whose seat was released answers deactivated, and an unpaid order answers inactive. The item stays off until a valid answer comes back.

3. Give the owner a way to release the site

Put a button in the item's admin called something like Release this site. It sends action=deactivate with the key and domain, from your server, only when the owner chooses it. That frees the seat so the key can be used on another address. Calling it twice is safe — the second answer adds already_deactivated: true.

Deactivating from your own code without the owner asking is not allowed. A buyer who moves a site should be able to do it themselves.

Rules for all three calls

An item that cannot activate a site, cannot report that a license has stopped being valid, or gives the owner no way to release a site does not meet the requirement, whatever else it does.

Endpoint

POST https://codescripts.dev/api/license.php

Send JSON (or a normal form post). The key is the credential, so the call is made from your server, never from a browser where the key would be visible.

Actions

ActionWhat it doesSeat used
activate Registers the domain against the key. Calling it again from the same domain is safe. Yes, if the domain is new
validate Answers whether this domain may run the item right now. Call it on update checks or daily. No
deactivate Releases the domain's seat so it can be used elsewhere. Safe to call twice. Frees one
updates For an activated site: the newest version, the last five changelog entries, and whether the version you send is behind. Read-only. No

A request

curl -s -X POST 'https://codescripts.dev/api/license.php' \
  -H 'Content-Type: application/json' \
  -d '{"action":"activate","key":"CS-XXXX-XXXX-XXXX","domain":"example.com"}'

The update feed

Send the version the site runs and the answer says whether there is a newer one. The file is not streamed here: the buyer downloads it from their purchases page.

curl -s -X POST 'https://codescripts.dev/api/license.php' \
  -H 'Content-Type: application/json' \
  -d '{"action":"updates","key":"CS-XXXX-XXXX-XXXX","domain":"example.com","version":"1.2.0"}'
{
  "ok": true,
  "valid": true,
  "status": "active",
  "latest": "1.4.0",
  "released_on": "2026-11-18",
  "update_available": true,
  "download_available": true,
  "changelog": [
    { "version": "1.4.0", "released_on": "2026-11-18", "note": "Fixes the queue worker" }
  ],
  "signature": "…"
}

A successful answer

{
  "ok": true,
  "valid": true,
  "status": "active",
  "key": "CS-XXXX-XXXX-XXXX",
  "item": "Your item",
  "slug": "your-item",
  "license": "personal",
  "domain": "example.com",
  "activations": { "used": 1, "limit": 1 },
  "issued_at": "2026-11-18T09:00:00+00:00",
  "checked_at": "2026-11-18T09:05:00+00:00",
  "signature": "…"
}

When it is not valid

The body is still JSON, ok is false, and error says why. A license failure answers HTTP 422; a malformed request answers 400, and a site whose database has not been upgraded answers 503 with not_installed. Treat every error as "do not run".

errorMeaning
invalid_keyNo license has that key on this install.
domain_requiredThe request had no usable domain.
inactiveThe order has not been paid yet.
refundedThe order was refunded; the license is dead.
limit_reachedEvery seat is in use. Deactivate a site first.
not_activatedValidation asked about a domain that never activated.
deactivatedThat domain's seat was released.

Verifying the signature

Every answer is signed with HMAC-SHA256 over its own sorted JSON body (without the signature field), using the license API secret shown under Admin → Licenses. Run this on your server so a forged reply from a modified host does not pass:

$body = json_decode($reply, true);
$signature = $body['signature'] ?? '';
unset($body['signature']);
ksort($body);
$expected = hash_hmac('sha256', json_encode($body, JSON_UNESCAPED_SLASHES), $secret);
$trusted = hash_equals($expected, $signature);

Good to know

Your purchases