Generate, distribute and validate license keys
Securely sell software with license keys. Checkout Page can generate and distribute unique license keys on each checkout or subscription signup.
When selling software, license keys are a simple and secure way to validate access. Checkout Page helps you with generating, distributing and validate license keys upon purchases, subscription signups and form submissions.
When turned on, Checkout Page generates one license key per checkout. These are perpetual license keys, which means they're valid forever. You can, however, still limit how, and how often the license is used, as well as what it's valid for. That implementation is up to you.
We provide a unique (version 4 uuid) license key per checkout, tied to a charge
or subscription
and a [POST]
API endpoint to validate the validity of the license.
To validate a license, your customer enters their license key in your application or website. You send a POST
request to our license key validation API endpoint. Based on the response, your system gives the user access or not.
What we'll cover:
Generating license keys
This one is easy. Head to the page you want to generate licenses for. Go to the Settings tab and toggle the option 'Generate unique license keys for each payment'.
A license key will now be generated for every checkout on this page.
Distributing license keys
There are a few options to distribute the license key generated on a checkout:
- Add the license key to Checkout confirmation message
- Add the license key to Email confirmation message
- Find the license key in Stripe metadata & distribute via Zapier
Your customers can also access their license key in their customer portal.
Validating license keys
You can validate a license key with our public POST
API endpoint. The validation implementation is up to you. Our endpoint lets you:
- increment the amount of uses with the
incrementUses
property - enable/disable a license key via the Charge/Subscription page in the dashboard. This will set
enabled
totrue
/false
POST /api/v1/license-keys/validate
curl -X POST https://api.checkoutpage.co/api/v1/license-keys/validate \
-d key="018ec4ef-4c0f-4845-bfa2-c1c7ed49d731" \
-d incrementUses=true
RESPONSE
{
"data": {
"uses": 0,
"enabled": true,
"key": "018ec4ef-4c0f-4845-bfa2-c1c7ed49d731",
"product": {
"price": "9900",
"currency": "usd",
"type": "charge",
"title": "The Art of Photography",
"slug": "the-art-of-photography",
"id": "60a4ca7ac2d2a000154644c9"
},
"charge": "60cb1b205cb2999b117cc905",
"customer": "5b1910909bcc7200149245e7",
"createdAt": "2021-06-17T09:51:32.245Z",
"updatedAt": "2021-06-17T14:20:51.458Z",
"vendor": "5aaa701149321a00145c99b9",
"id": "60cb1b245cb2999b117cc90a"
}
}
Notice the optional incrementUses
parameter in the request. If left out or to false
, we won't increment the value of uses
.
Response properties:
uses
: integer
the amount of times the license has been validated with incrementUses: true
enabled
: boolean
a license key becomes enabled once the charge or subscription succeeded. When a charge or subscription is uncompleted, enabled
will be false
. You can enable and disable license keys via the Charge or Subscription page in the dashboard.
key
: string
Unique uuidv4 string
product
: object
Details of the product purchased
charge
: string
Charge ID, exists if license belongs to a charge object
subscription
: string
Subscription ID, exists if license belongs to a subscription object
customer
: string
Customer ID
createdAt
: string
Created date in UTC
updatedAt
: string
Last updated date in UTC
vendor
: string
Your vendor ID
id
: string
License ID