# List licenses

`GET https://api.anyshop.io/v1/licenses`

Licenses in your API key's mode, newest first, each key masked.

- Part of the [API reference](https://docs.anyshop.io/reference.md), [Licenses](https://docs.anyshop.io/reference.md#licenses).
- Scope: `licenses:read`.

## Query parameters

- `limit` (integer): How many to return: 1 to 100, default 20. 1 to 100.
- `starting_after` (string): The last ID of the previous page; the next page starts after it. Up to 64 characters.
- `order` (string): Only the licenses sold in this order. Up to 64 characters.
- `product` (string): Only the licenses of this product. Up to 64 characters.

## Returns

A list of **license** objects, newest first: `{ "object": "list", "data", "has_more" }`.

## Errors

| Status | error.type | When |
| --- | --- | --- |
| 400 | `invalid_request` | The request is not valid; `error.param` names the field |
| 401 | `authentication` | No API key, or it is not valid |
| 403 | `permission` | The key does not have the scope this needs, or the store is suspended (store_suspended) |
| 404 | `not_found` | Not found in the key's store and mode |
| 409 | `conflict` | Conflicts with the object's state (type conflict), or an Idempotency-Key reused for another request (type idempotency, code idempotency_key_reused) |
| 429 | `rate_limited` | Too many requests; see Retry-After |

## Example

curl:

```bash
curl https://api.anyshop.io/v1/licenses \
  -H "Authorization: Bearer $ANYSHOP_API_KEY"
```

Node:

```js
const response = await fetch("https://api.anyshop.io/v1/licenses", {
  headers: {
    Authorization: `Bearer ${process.env.ANYSHOP_API_KEY}`,
  },
});
const answer = await response.json();
```

Python:

```python
import os
import requests

response = requests.get(
    "https://api.anyshop.io/v1/licenses",
    headers={
        "Authorization": f"Bearer {os.environ['ANYSHOP_API_KEY']}",
    },
)
answer = response.json()
```

Answer (200):

```json
{
  "object": "list",
  "data": [
    {
      "object": "license",
      "id": "lic_01m3rv2f8k1q7w3e5r9t0y4u6i",
      "livemode": true,
      "status": "active",
      "key_masked": "PXF-••••-••••-7Q2M",
      "product": {
        "id": "prod_01m3rr5kmbeb2s18x1kpntjxqb",
        "name": "Lumen Studio Pro"
      },
      "order": "ord_01m3rt5x2c7q9f0a4d6k8h1n3p",
      "devices": {
        "used": 1,
        "limit": 2
      },
      "expires_at": "2026-10-02T14:21:07.000Z",
      "updates_until": "2026-10-02T14:21:07.000Z",
      "last_checked_at": "2026-10-02T14:21:07.000Z",
      "created_at": "2026-10-02T14:21:07.000Z",
      "activations": [
        {
          "id": "lact_01m3rv4k2m6p8r0t2v4x6z8b0d",
          "name": "Studio Mac",
          "platform": "macOS",
          "activated_at": "2026-10-02T14:21:07.000Z",
          "last_seen_at": "2026-10-02T14:21:07.000Z"
        }
      ]
    }
  ],
  "has_more": false
}
```

Answer (400):

```json
{
  "error": {
    "type": "invalid_request",
    "code": "invalid_query",
    "message": "The request is not valid; `error.param` names the field",
    "param": null
  }
}
```

Answer (409):

```json
{
  "error": {
    "type": "conflict",
    "code": "conflict",
    "message": "Conflicts with the object's state (type conflict), or an Idempotency-Key reused for another request (type idempotency, code idempotency_key_reused)",
    "param": null
  }
}
```

The IDs and keys in these examples are made up. Every schema is in the OpenAPI document, https://api.anyshop.io/v1/openapi.json.
