---
title: "Requires a tier to unlock a resource."
---

> 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 › product

`PUT /v1/stores/{store}/{kind}/{id}/access_requirements`

## Authentication

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

## Path parameters

- `store` (`setAccessRequirement.path.store`; string, required) — The store's id.
- `kind` (`setAccessRequirement.path.kind`; string, required) — The target's kind, in the plural.
  - minLength 1
- `id` (`setAccessRequirement.path.id`; string, required)
  - minLength 1

## Request body

_Required._

- `channel` (`setAccessRequirement.channel`; string, required)
  - one of `"api"`, `"web"`, `"mcp"`, `"feed"`, `"any"`
- `tier` (`setAccessRequirement.tier`; any of, required)
  - any of: `object`, `null`
- `closed` (`setAccessRequirement.closed`; boolean, optional) — Shuts a product to everyone over MCP, all it heads included; it takes no tier.
- `from` (`setAccessRequirement.from`; object, optional)
  - `preview_only` (`setAccessRequirement.from.preview_only`; boolean, optional)
  - `asset` (`setAccessRequirement.from.asset`; object, optional)
    - `id` (`setAccessRequirement.from.asset.id`; string, required)
      - minLength 1; maxLength 512
- `if_none` (`setAccessRequirement.if_none`; boolean, optional) — Refused when the resource already has a row on the channel, as a rule put back over one set since.

## Example request

```json
{
  "channel": "api",
  "tier": {
    "id": "string"
  },
  "closed": true,
  "from": {
    "preview_only": true,
    "asset": {
      "id": "string"
    }
  },
  "if_none": true
}
```

## Code samples

### cURL

```bash
curl --request PUT \
  --url 'https://api.sherpo.io/merchant/v1/stores/<store>/<kind>/<id>/access_requirements' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "channel": "api",
  "tier": {
    "id": "string"
  },
  "closed": true,
  "from": {
    "preview_only": true,
    "asset": {
      "id": "string"
    }
  },
  "if_none": true
}
'
```

### TypeScript

```typescript
const url = 'https://api.sherpo.io/merchant/v1/stores/<store>/<kind>/<id>/access_requirements';
const options = {
  method: 'PUT',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({
    channel: 'api',
    tier: {id: 'string'},
    closed: true,
    from: {preview_only: true, asset: {id: 'string'}},
    if_none: true
  })
};

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>/<kind>/<id>/access_requirements"

payload = {
    "channel": "api",
    "tier": { "id": "string" },
    "closed": True,
    "from": {
        "preview_only": True,
        "asset": { "id": "string" }
    },
    "if_none": True
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

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

print(response.text)
```

## Responses

### 200

Requires a tier to unlock a resource.

#### Example

```json
[
  {
    "resource": {
      "kind": "string",
      "id": "string"
    },
    "channel": "string",
    "tier_id": "string",
    "closed": true
  }
]
```

- `resource` (`setAccessRequirement.response.200.resource`; object, required)
  - `kind` (`setAccessRequirement.response.200.resource.kind`; string, required)
  - `id` (`setAccessRequirement.response.200.resource.id`; string, required)
- `channel` (`setAccessRequirement.response.200.channel`; string, required)
- `tier_id` (`setAccessRequirement.response.200.tier_id`; any of, required)
  - any of: `string`, `null`
- `closed` (`setAccessRequirement.response.200.closed`; boolean, required)

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


Source: https://docs.sherpo.io/merchant-api/reference/set-access-requirement/index.md
