> ## Documentation Index
> Fetch the complete documentation index at: https://docs.payreque.st/llms.txt
> Use this file to discover all available pages before exploring further.

# Software license keys

> Sell software with unique license keys, installation limits and a license validation API.

License keys let your software check whether a buyer has paid for access. Your application must integrate the License API to enforce access.

## Set up a product

1. Create a paid, one-time **License** or **Digital Product**.
2. Open its product detail page and find **Software license keys**.
3. Enable **Generate license keys**, choose the maximum active installations, and optionally enter validity in days. Leave validity empty for lifetime access.
4. Save before the first order is created.

One key is issued per purchased unit after confirmed payment. A digital product can deliver both its download and a license key. Keys appear in the order completion email and the primary buyer's order detail in the customer portal. Contact users cannot view keys.

License terms are fixed once the product has any order, including an unpaid checkout. Create a new product for different terms. Existing orders never acquire licenses retroactively.

## Connect your software

Send HTTPS POST requests to `https://payrequest.app/api/v1/licenses/activate`, `/validate` or `/deactivate`. Send credentials in the request body and use `Accept: application/json`. Do not put keys in URLs or logs.

Each request requires `seller_id`, `product_id`, and `license_key`. Copy the seller and product IDs from the product's license settings. Pin those IDs in your integration: a license for another seller or product must never unlock your software. There is no merchant API secret to embed in your application; the buyer's key is a bearer credential.

### Activate an installation

```bash theme={null}
curl https://payrequest.app/api/v1/licenses/activate \
  -H 'Accept: application/json' \
  --data-urlencode 'seller_id=YOUR_SELLER_ID' \
  --data-urlencode 'product_id=YOUR_PRODUCT_ID' \
  --data-urlencode 'license_key=YOUR_LICENSE_KEY' \
  --data-urlencode 'installation_id=YOUR_STABLE_RANDOM_INSTALLATION_ID' \
  --data-urlencode 'instance_name=My laptop'
```

Generate a random installation ID of 16–200 characters once and persist it locally. Do not use a hardware fingerprint or personal information. Repeating activation with the same installation ID returns the existing active instance without using another slot. Store the returned `instance.id` for validation and deactivation.

A successful response contains `valid: true`, `activated: true`, an `instance` with its ID and name, and a `license` object with seller/product IDs, activation limit, current usage and expiry (`null` for lifetime).

### Validate access

POST to `/api/v1/licenses/validate` with `seller_id`, `product_id`, `license_key` and `instance_id`. A successful response has `valid: true` and `validated: true`.

Checking only a key is also supported by omitting `instance_id`; this checks the license, without proving an installation is activated. Applications enforcing installation limits must always pass the instance ID.

Treat `valid: false`, network failures, malformed responses and unexpected seller/product IDs as no confirmed access. Any optional offline grace period must be explicitly implemented in your software; it delays enforcement of refunds and revocation.

### Deactivate an installation

POST to `/api/v1/licenses/deactivate` with the same seller/product/key fields and `instance_id`. Success returns `deactivated: true` and frees that slot. Reactivating a released installation returns a new instance ID; the previous proof remains invalid.

## Manage licenses

Open the product detail page to disable or re-enable a license and release individual installations. Re-enabling does not override expiry, payment reversal or seller suspension. Validation freshly checks paid ledger coverage, order/customer ownership, refunds, credit notes, chargebacks and disputes. A refund or dispute blocks all licenses on the affected order; partial refunds do not automatically allocate access between individual units.

Invalid licenses and full activation limits return `valid: false` with an error. Invalid input returns HTTP 422; throttling returns HTTP 429. The three API operations share limits of 60 requests per minute per IP and per key. Back off on HTTP 429; do not call on every UI render.

## Current scope

This version supports one-time purchases, 1–100 installations per key, up to 100 purchased units per order line, and lifetime or fixed validity. Subscription licenses, imports of existing Lemon Squeezy keys, automatic software updates and offline signed licenses are not included. Existing Lemon Squeezy integrations require an API integration change; this is not a drop-in replacement.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.