---
title: "Checks a software product's license key from the seller's server: its status, why it is not active, when it ends, its tier and features, its uses, its devices and the subscription behind it; with `count_use` an active one counts a use, and with `instance` it reads and stamps that device. An unknown key, or another product's, answers `not_found`."
---

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

Path: Sherpo merchant API › customer

`POST /v1/stores/{store}/products/{product}/licenses/verify`

## Authentication

- `bearer`, http, header `Authorization`, scopes: `customer:read`

## Path parameters

- `store` (`verifyLicense.path.store`; string, required) — The store's id.
- `product` (`verifyLicense.path.product`; string, required) — An id, or `slug:<slug>`.
  - minLength 1

## Request body

_Required._

- `key` (`verifyLicense.key`; string, required) — The key as the customer typed it: case, hyphens, spaces and Crockford's look-alikes don't matter, except for an imported key that is not hex, which matches exactly.
  - minLength 1; maxLength 128
- `count_use` (`verifyLicense.count_use`; boolean, optional) — Count this check as a use of the software; only an active license counts. Defaults to false.
- `instance` (`verifyLicense.instance`; string, optional) — The device the software runs on, as it activated it, to read and stamp that activation.
  - minLength 1; maxLength 256

## Example request

```json
{
  "key": "string",
  "count_use": true,
  "instance": "string"
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.sherpo.io/merchant/v1/stores/<store>/products/<product>/licenses/verify' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "key": "string",
  "count_use": true,
  "instance": "string"
}
'
```

### TypeScript

```typescript
const url = 'https://api.sherpo.io/merchant/v1/stores/<store>/products/<product>/licenses/verify';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({key: 'string', count_use: true, instance: 'string'})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.sherpo.io/merchant/v1/stores/<store>/products/<product>/licenses/verify"

payload = {
    "key": "string",
    "count_use": True,
    "instance": "string"
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

Checks a software product's license key from the seller's server: its status, why it is not active, when it ends, its tier and features, its uses, its devices and the subscription behind it; with `count_use` an active one counts a use, and with `instance` it reads and stamps that device. An unknown key, or another product's, answers `not_found`.

#### Example

```json
{
  "id": "string",
  "status": "string",
  "reason": "string",
  "expires_at": "string",
  "tier": {
    "id": "string",
    "name": "string",
    "rank": 0
  },
  "features": [
    "string"
  ],
  "uses": 0,
  "activations": {
    "count": 0,
    "limit": 0
  },
  "activation": {
    "id": "string",
    "license_id": "string",
    "name": "string",
    "status": "string",
    "created_at": "string",
    "activated_at": "string",
    "last_seen_at": "string",
    "deactivated_at": "string",
    "deactivated_by": "string"
  },
  "customer": {
    "id": "string"
  },
  "subscription": {
    "id": "string",
    "status": "string",
    "current_period_end": "string",
    "cancel_at_period_end": true,
    "ended_at": "string"
  },
  "latest_release": {
    "id": "string",
    "version": "string",
    "occurred_at": "string"
  }
}
```

- `id` (`verifyLicense.response.200.id`; string, required)
- `status` (`verifyLicense.response.200.status`; string, required) — Where it stands now: `active`, `expired`, `revoked`, `disabled` or `replaced`.
- `reason` (`verifyLicense.response.200.reason`; any of, required) — Why it is not active: `replaced`, `disabled`, `lapse`, `refund` or `revoke`; null while active, or before any access began.
  - any of: `string`, `null`
- `expires_at` (`verifyLicense.response.200.expires_at`; any of, required) — When all of the holder's access ends, whatever its tier; null while it never does.
  - any of: `string`, `null`
- `tier` (`verifyLicense.response.200.tier`; any of, required) — The tier its access opens, else the one it last opened; null for access with no tier.
  - any of: `object`, `null`
- `features` (`verifyLicense.response.200.features`; array<string>, required) — What that tier unlocks with every tier below it, as their settings list them; none unless active.
- `uses` (`verifyLicense.response.200.uses`; number, required) — How many checks counted it as a use, this one included.
- `activations` (`verifyLicense.response.200.activations`; object, required) — The devices it counts now and the most it may hold; `limit` null when nothing limits it.
  - `count` (`verifyLicense.response.200.activations.count`; number, required)
  - `limit` (`verifyLicense.response.200.activations.limit`; any of, required)
    - any of: `number`, `null`
- `activation` (`verifyLicense.response.200.activation`; any of, required) — The device `instance` names, its last seen stamped while it counts and the license is active; null without `instance`, or when it holds none.
  - any of: `object`, `null`
- `customer` (`verifyLicense.response.200.customer`; object, required)
  - `id` (`verifyLicense.response.200.customer.id`; string, required)
- `subscription` (`verifyLicense.response.200.subscription`; any of, required) — The subscription behind that access; null for a one-time purchase or a grant.
  - any of: `object`, `null`
- `latest_release` (`verifyLicense.response.200.latest_release`; any of, required) — The product's newest release whose files are all in, whatever tier opens them, so the software can tell an update is out; null before its first.
  - any of: `object`, `null`

### default

A problem; see https://api.sherpo.io/merchant/docs/errors.

#### Example

```json
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "context": {},
  "reached_core": true,
  "core_answer": "string"
}
```

- `type` (`verifyLicense.response.default.type`; string, required)
  - format `uri`
- `title` (`verifyLicense.response.default.title`; string, required)
- `status` (`verifyLicense.response.default.status`; integer, required)
- `detail` (`verifyLicense.response.default.detail`; string, required)
- `code` (`verifyLicense.response.default.code`; string, optional)
- `context` (`verifyLicense.response.default.context`; object, optional)
- `reached_core` (`verifyLicense.response.default.reached_core`; boolean, optional)
- `core_answer` (`verifyLicense.response.default.core_answer`; string, optional)


Source: https://docs.sherpo.io/merchant-api/reference/verify-license/index.md
