Documentation

Installation

Create a Stripe Restricted API Key

Create Restricted Key

Go to your Stripe dashboard and click on the “Developers” link on the top right section of your dashboard and navigate to the “API Keys” tab. Click on the Create restricted key button.

Configure Restricted Key

Select “Read” access to “Products”.

Select “Read” access to “Checkout Sessions”.

Select “Read” access to “Subscriptions”.

Select “Write” access to “Webhook Endpoints”.

Get API Key

Copy the generated API key and add to New Account form.

Validation

Make a request to validate licenses

Validate License

Endpoint: https://api.keystor.app/api/v2/{{account_id}}/licenses/validate?key={{license_key}}

Method: GET

Request Parameters: key (required): The license key to validate.

Response:

{
  "id": 3,
  "key": "8ca635be-9c34-44e8-ab20-868...",
  "limit": 1,
  "expiration": "2044-03-19T20:08:15.771Z",
  "created_at": "2024-03-19T20:08:15.775Z",
  "updated_at": "2024-03-19T20:08:15.775Z",
  "subscription_id": null,
  "activations_count": 1,
  "order_type": "Purchase",
  "order_id": "015ded18-ffec-4441-a1c3-8d0b...",
  "account_id": "1734d402-819f-48d2-9e58-788...",
  "stripe_product_id": "prod_PgN9GAVA...",
  "stripe_price_id": "price_1Or0OqCKCr7...",
  "price_metadata": {
    "t": "2"
  }
}

Activate License

Endpoint: https://api.keystor.app/api/v2/{{account_id}}/licenses/activate?key={{license_key}}&email={{email}}

Method: GET

Request Parameters: key (required): The license key to activate, email (required): email to activate.

Response:

{
  "id": 3,
  "key": "8ca635be-9c34-44e8-ab20-868...",
  "limit": 1,
  "expiration": "2044-03-19T20:08:15.771Z",
  "created_at": "2024-03-19T20:08:15.775Z",
  "updated_at": "2024-03-19T20:08:15.775Z",
  "activations_count": 1,
  "order_type": "Purchase",
  "order_id": "015ded18-ffec-4441-a1c3-8d0b...",
  "account_id": "1734d402-819f-48d2-9e58-788...",
  "stripe_product_id": "prod_PgN9GAVA...",
  "stripe_price_id": "price_1Or0OqCKCr7...",
  "price_metadata": {
    "t": "2"
  }
}

When exceeding the activation limit:

{{"error":{"base":["You have reached your activation limit."]}}

Deactivate License

Endpoint: https://api.keystor.app/api/v2/{{account_id}}/licenses/deactivate?key={{license_key}}

Method: GET

Request Parameters: key (required): The license key to validate.

Response:

{
  "id": 3,
  "key": "8ca635be-9c34-44e8-ab20-868...",
  "limit": 1,
  "expiration": "2044-03-19T20:08:15.771Z",
  "created_at": "2024-03-19T20:08:15.775Z",
  "updated_at": "2024-03-19T20:08:15.775Z",
  "subscription_id": null,
  "activations_count": 0,
  "order_type": "Purchase",
  "order_id": "015ded18-ffec-4441-a1c3-8d0b...",
  "account_id": "1734d402-819f-48d2-9e58-788...",
  "stripe_product_id": "prod_PgN9GAVA...",
  "stripe_price_id": "price_1Or0OqCKCr7...",
  "price_metadata": {
    "t": "2"
  }
}

Invalid responses

Invalid Account ID

"error":"Couldn't find Account with 'id'=1734d402-819f-48d2-9e58-788..."}

Invalid Key

null