Mac app licensing API reference

Every call a Mac app makes to DeliveryKit for purchase activation, free trials, license checks, renewals and deactivation, with requests, responses and the license format.

Updated 5 min read

DeliveryKit’s licensing API is what your Mac app calls to start a trial, activate a purchase, and keep its license current. There are eleven calls. None needs an API key: an emailed code proves who the buyer is, and after that the signed license does.

This page is the reference. For a walk through the code, see how to add license activation to a Mac app.

Base URL

Every call goes to your app’s own address:

https://deliverykit.app/api/apps/{workspace}/{app}

{workspace} is your workspace’s slug and {app} is the ID of the app file. Both are shown, ready to copy, in the app file’s settings, along with the public key.

Requests and responses are JSON. Send Content-Type: application/json and Accept: application/json.

The license

Activation and trial calls return a license and when it runs out:

{
    "license": "eyJ2IjoxLCJ0eXAiOiJsaWNlbnNlIiwi…Q.mJ8f…Aw",
    "expires_at": "2027-01-06T18:20:11+00:00"
}

A license is two base64url strings joined by a dot: the claims, then an Ed25519 signature of the first string. Decode the first part to read the claims:

{
    "v": 1,
    "typ": "license",
    "temporary": false,
    "app": "01m7f3qkwqsc2rfma0rym67jz7",
    "sub": "01m812mq0j90pe0ghckd7pcs2p",
    "dev": "9b1c…e2",
    "iat": 1795890011,
    "exp": 1799778011
}
Claim Meaning
typ license for a purchase, trial for a free trial
temporary true for access you gave someone for a set number of days
app The app this license is for
sub This activation
dev SHA-256 of the app’s ID, a | and the device ID, in hex
iat When it was issued, in seconds since 1970
exp When it stops being valid

Your app verifies the signature itself with the public key from GET /license-key, so it works with no connection. The key is shared by every app in your workspace, so also check that app is your app’s ID and dev matches this Mac. A license lasts up to 45 days, and never longer than the time that was paid for. Refresh it about once a month.

Calls

GET /offer

What you are offering right now, so the app can word its own screens to match.

{
    "trial_requires_email": false,
    "trial_days": 14,
    "refund_days": 30,
    "purchase_url": "https://deliverykit.app/w/your-studio/products/kite"
}

refund_days and purchase_url are null when you have not set a refund period or published a product page.

GET /license-key

The key that verifies every license for your workspace.

{ "algorithm": "Ed25519", "public_key": "q2X8…hQ=" }

The key is base64. Ship it inside your app; it does not change.

POST /activation/request

Emails a six-digit code to an address that has bought the app.

{ "email": "ada@example.com" }

Always answers 202 with { "status": "sent_if_purchased" }, whether or not the address is a customer. The code works for 15 minutes and allows five attempts.

POST /activation

Trades the code for a license on this device.

{
    "email": "ada@example.com",
    "code": "482913",
    "device_id": "5C1F2A7E-9B41-4E0B-8F0A-2D6E7C3B9A10",
    "device_name": "Ada’s MacBook Pro"
}

device_id is any stable string of 8 to 128 characters that your app keeps for this Mac. device_name is optional and is what you see in the dashboard.

Returns the license. A 422 carries a message under errors.code (wrong or expired code, or no current access) or errors.device (the purchase is already active on as many devices as you allow).

POST /activation/refresh

The app’s regular re-check. Send the license it holds:

{ "license": "eyJ2…Aw" }

Returns a fresh license, or 403 with why the old one no longer stands:

reason Meaning
not_activated This is not a license for an active device
deactivated You or the buyer freed this device
subscription_ended The subscription’s paid time has run out
purchase_no_longer_valid The order was refunded or its access was removed

POST /activation/renewal

For an app sold by the year or as a subscription: when the paid time ends, and a link the buyer can open to renew with nothing to type.

{
    "kind": "prepaid",
    "state": "ending_soon",
    "ends_at": "2027-11-22T18:20:11+00:00",
    "discount_percent": 20,
    "url": "https://deliverykit.app/w/your-studio/…"
}

kind is prepaid or subscription. state is active, ending_soon or ended for a prepaid year, and active, cancelling or ended for a subscription. discount_percent is the returning-buyer discount you set, or null.

Answers 404 with { "reason": "nothing_to_renew" } for a one-time purchase, and 403 with a reason from the table above when the license no longer stands.

POST /activation/verify

For your own server. Says whether a license still stands, and changes nothing.

{ "valid": true, "type": "license", "expires_at": "2027-01-06T18:20:11+00:00" }

Always answers 200. When valid is false, reason is not_a_license, expired, deactivated or purchase_no_longer_valid.

POST /activation/deactivate

Frees this device so the purchase can be activated on another. Send the license; the answer is { "status": "deactivated" }.

POST /trial

Starts this device’s free trial, or continues one it already started.

{
    "device_id": "5C1F2A7E-9B41-4E0B-8F0A-2D6E7C3B9A10",
    "device_name": "Margaret’s Mac mini"
}

device_name is optional and is what you see beside the trial in the dashboard.

Returns a license with typ set to trial, expiring when the trial does. Asking again never extends it. A 403 gives the reason:

reason Meaning
no_trial The app has no free trial
email_required Trials need a verified email first: use the calls below
trial_ended This device’s trial has run out
revoked You ended this trial
trial_unavailable The trial has no recorded start

POST /trial/request

For trials that ask for an email. Emails a code:

{ "email": "margaret@example.com", "device_id": "5C1F2A7E-…" }

Answers 202 with { "status": "sent_if_available" }.

POST /trial/activate

Verifies that code and starts the trial:

{ "email": "margaret@example.com", "code": "730245", "device_id": "5C1F2A7E-…" }

Returns a trial license. One email is one trial: a second Mac or a reinstall with the same address joins the trial already running. A 403 gives trial_ended, or use_granted_access or granted_access_ended when that address was given access directly.

Limits

Each app allows, per IP address, 300 reads a minute (/offer, /license-key), 300 license checks a minute, and 60 activations a minute. Code emails are limited per address to six an hour. A call over the limit answers 429.

Start selling your first download

Connect your Stripe account and choose the files you want to sell. DeliveryKit sends buyers their downloads after payment.