1
Turn it on
In the product editor, open License keys, switch on Generate a
license key for each sale and, optionally, set an activation limit
(leave it blank for unlimited).
2
Sell
Each new sale of the product gets one key, like
7KQ2M-X9D4R-T3VWB-8HNPC. It is in the buyer’s receipt email, in their
purchases, on the order in your dashboard and in the order.completed
webhook.3
Check it from your app
Call
POST /licenses/activate when the user enters the key, and
POST /licenses/validate on launch.License keys are for one-time products. Keys are issued for sales made after
you turn the setting on. A refunded or disputed order’s key stops
validating automatically.
How keys work
- Format. Keys issued by Pocketsflow are four groups of five characters
(
XXXXX-XXXXX-XXXXX-XXXXX) drawn from a cryptographically secure random source — 100 bits, so keys can’t be guessed. Input is forgiving: case, spaces and dashes are ignored, andOis read as0,I/Las1. - Imported keys keep their own format. A key you import from another platform can be any string. It is stored exactly as you sent it and looked up exactly (case-sensitive, surrounding whitespace ignored). The lookup tries the exact string first, then the forgiving form above, so issued keys still accept sloppy input.
- One key per order. Payment retries never create a second key.
- Activations. An activation is one install or device, identified by an
instanceIdyou choose (or one we generate). The activation limit you set on the product is copied onto each key when it is issued, so changing the product later never takes seats away from buyers who already paid. - Product-bound. Every call needs the product id and the key. A key of
another product gets the same
404as a key that doesn’t exist.
Public endpoints (called from your software)
Base URLhttps://api.pocketsflow.com. No Authorization header. JSON body:
snake_case spellings (product_id, license_key, instance_id,
instance_name) are accepted too. The same routes also answer under
/v1/licenses/....
Every answer has the same shape — read valid, and code when it is false:
All three return
400 invalid_request without productId or licenseKey,
and 429 (code: rate_limited) past 60 requests per minute per IP. They
answer any origin, so a web app can call them from the browser.
Managing keys (your API key)
These need your API key (Authorization: Bearer pk_live_… / pk_test_…)
and only ever touch your own keys in that key’s mode.
The same actions are on the order page in your dashboard (Orders → an
order → License key), and as MCP tools (
list_license_keys,
get_license_key, disable_license_key, enable_license_key,
reset_license_key_activations, import_license_keys).
A key’s source is sale (issued on a Pocketsflow order, orderId set) or
import (brought over, orderId is null; importedOrderId and
customerId link it to the imported purchase and customer when known).
Import existing keys
Moving your app from another platform? Your buyers can’t type in new keys, so bring the ones they have. Each key keeps its exact text, its activation limit and the devices it is already activated on, and then works with validate / activate / deactivate exactly like a key issued here.POST /licenses/import (also /v1/licenses/import) needs your API key, like
the other management routes. Send a JSON array of up to 1000 keys (or the
same array as { "keys": [...] }):
The keys are created in the mode of the API key (
pk_test_… → test,
pk_live_… → live; in the dashboard, the test-mode toggle). testMode in the
body is ignored. Imported keys have no Pocketsflow order, so a refund here
never touches them; disable one yourself if you need to.
The answer is 200 whenever the request itself is valid, with one result per
row (index is the row’s 0-based position) and the totals:
created— the key is ready to validate.exists— the same key was already imported on the same product (same business and mode). It is left exactly as it is, activations, limit and status included, so running the same import twice is safe.error— that row was not imported, with the reason: a missing or malformed field, a product that isn’t yours, more seeded activations than the limit, or a key that already exists on another product or store (key text is unique across Pocketsflow). The other rows are still imported.
400.
Refunds and disputes
When an order is refunded or disputed, its key is disabled with the reason (refunded / disputed), so validate answers valid: false with
code: license_disabled and activate answers 403. The buyer’s purchases
no longer show the key. You can still re-enable it from the order page.
Per-seat subscriptions can issue one key per subscriber (see
usage-based and per-seat pricing). That key is
disabled with the reason subscription_ended while the subscription is
canceled or expired, and switched back on automatically if it resumes.
Webhooks
order.completed for a product with license keys carries the key: