---
title: "Counts a device toward a software product's license from the seller's server, or refreshes one it already counts, and answers a signed token the software checks offline; past the license's activation limit (10,000 when nothing limits it) it answers `conflict` on `items`, and a license that is not active `conflict` on `status`."
---

> 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/activate`

## Authentication

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

## Path parameters

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

## Request body

_Required._

- `key` (`activateLicense.key`; string, required) — The key as the customer typed it.
  - minLength 1; maxLength 128
- `instance` (`activateLicense.instance`; string, required) — A stable id of the device or seat, chosen by the software; only its keyed digest is kept.
  - minLength 1; maxLength 256
- `name` (`activateLicense.name`; string, optional) — What the holder and the merchant see it as, such as the device's name.
  - minLength 1; maxLength 480

## Example request

```json
{
  "key": "string",
  "instance": "string",
  "name": "string"
}
```

## Code samples

### cURL

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

### TypeScript

```typescript
const url = 'https://api.sherpo.io/merchant/v1/stores/<store>/products/<product>/licenses/activate';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({key: 'string', instance: 'string', name: '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/activate"

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

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

print(response.text)
```

## Responses

### 200

Counts a device toward a software product's license from the seller's server, or refreshes one it already counts, and answers a signed token the software checks offline; past the license's activation limit (10,000 when nothing limits it) it answers `conflict` on `items`, and a license that is not active `conflict` on `status`.

#### Example

```json
{
  "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"
  },
  "token": "string",
  "token_expires_at": "string"
}
```

- `activations` (`activateLicense.response.200.activations`; object, required)
  - `count` (`activateLicense.response.200.activations.count`; number, required)
  - `limit` (`activateLicense.response.200.activations.limit`; any of, required)
    - any of: `number`, `null`
- `activation` (`activateLicense.response.200.activation`; object, required)
  - `id` (`activateLicense.response.200.activation.id`; string, required)
  - `license_id` (`activateLicense.response.200.activation.license_id`; string, required)
  - `name` (`activateLicense.response.200.activation.name`; any of, required)
    - any of: `string`, `null`
  - `status` (`activateLicense.response.200.activation.status`; string, required) — `active` counts toward the limit; `inactive` went unseen past the product's inactive days; `deactivated` was freed.
  - `created_at` (`activateLicense.response.200.activation.created_at`; string, required)
  - `activated_at` (`activateLicense.response.200.activation.activated_at`; string, required)
  - `last_seen_at` (`activateLicense.response.200.activation.last_seen_at`; string, required)
  - `deactivated_at` (`activateLicense.response.200.activation.deactivated_at`; any of, required)
    - any of: `string`, `null`
  - `deactivated_by` (`activateLicense.response.200.activation.deactivated_by`; any of, required) — Who freed it: `customer`, `merchant` or `software`; null while not freed.
    - any of: `string`, `null`
- `token` (`activateLicense.response.200.token`; string, required) — A compact JWS (EdDSA) the software checks offline against the store's published signing keys.
- `token_expires_at` (`activateLicense.response.200.token_expires_at`; string, required) — When the token stops verifying: the earliest of the product's offline window and the end of the access it carries.

### 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` (`activateLicense.response.default.type`; string, required)
  - format `uri`
- `title` (`activateLicense.response.default.title`; string, required)
- `status` (`activateLicense.response.default.status`; integer, required)
- `detail` (`activateLicense.response.default.detail`; string, required)
- `code` (`activateLicense.response.default.code`; string, optional)
- `context` (`activateLicense.response.default.context`; object, optional)
- `reached_core` (`activateLicense.response.default.reached_core`; boolean, optional)
- `core_answer` (`activateLicense.response.default.core_answer`; string, optional)


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