# Patron List

Provider API v0.6.4 · 8 operations
Source: https://plasapi.com/provider/v0.6.4/patron-list/

No description in the specification.

## Get all patron lists

`GET` `/patron/{patronId}/list` · `GetPatronLists`

### Example request

**cURL**

```bash
curl -X GET "$PLAS_BASE_URL/patron/40218873/list?version=0.6.4" \
  -H 'Accept: application/json' \
  -H "Authorization: Bearer $PLAS_TOKEN"
```

**JavaScript**

```javascript
const response = await fetch(`${process.env.PLAS_BASE_URL}/patron/40218873/list?version=0.6.4`, {
  method: "GET",
  headers: {
    "Accept": "application/json",
    "Authorization": `Bearer ${process.env.PLAS_TOKEN}`,
  },
});
const data = await response.json();
```

**Python**

```python
import os
import requests

response = requests.get(
    f"{os.environ['PLAS_BASE_URL']}/patron/40218873/list",
    params={
        "version": "0.6.4",
    },
    headers={
        "Accept": "application/json",
        "Authorization": f"Bearer {os.environ['PLAS_TOKEN']}",
    },
)
data = response.json()
```

The host and token are environment variables: `PLAS_BASE_URL` the provider’s base URL · `PLAS_TOKEN` an access token.

### Parameters

- `patronId` (In `path`, `string`, required) — Patron ID from authentication

Shared across operations: `version`. [See the shared contract on the version page.](https://plasapi.com/provider/v0.6.4/)

### Responses

#### `200` Success

`PatronListsResponseBody`

Example (Generated from the schema):

```json
{
  "default": "12",
  "lists": [
    {
      "id": "94549",
      "name": "Kari Nordmann"
    }
  ]
}
```

#### `400` The list of errors.

`Errors`

Shared response, defined once for the whole API. [See the shared contract on the version page.](https://plasapi.com/provider/v0.6.4/)

Example (Generated from the schema):

```json
{
  "errors": [
    {
      "code": 200103,
      "info": "200103: invalid/unsupported query parameter value"
    }
  ]
}
```

#### `401` Bearer token invalid, missing, or expired.

No response body.

Shared response, defined once for the whole API. [See the shared contract on the version page.](https://plasapi.com/provider/v0.6.4/)

#### `404` Resource not found.

No response body.

Shared response, defined once for the whole API. [See the shared contract on the version page.](https://plasapi.com/provider/v0.6.4/)

## Create a new patron list

`POST` `/patron/{patronId}/list` · `CreatePatronList`

Create a new patron list, the list id is determined by the id in the request.

If there exist no patron list with the default ID, the default list can be created.


### Example request

**cURL**

```bash
curl -X POST "$PLAS_BASE_URL/patron/40218873/list?version=0.6.4" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer $PLAS_TOKEN" \
  -d '{
  "id": "94549",
  "name": "Kari Nordmann"
}'
```

**JavaScript**

```javascript
const response = await fetch(`${process.env.PLAS_BASE_URL}/patron/40218873/list?version=0.6.4`, {
  method: "POST",
  headers: {
    "Accept": "application/json",
    "Content-Type": "application/json",
    "Authorization": `Bearer ${process.env.PLAS_TOKEN}`,
  },
  body: JSON.stringify({
    "id": "94549",
    "name": "Kari Nordmann"
  }),
});
```

**Python**

```python
import os
import requests

response = requests.post(
    f"{os.environ['PLAS_BASE_URL']}/patron/40218873/list",
    params={
        "version": "0.6.4",
    },
    headers={
        "Accept": "application/json",
        "Content-Type": "application/json",
        "Authorization": f"Bearer {os.environ['PLAS_TOKEN']}",
    },
    json={
        "id": "94549",
        "name": "Kari Nordmann",
    },
)
response.raise_for_status()
```

The host and token are environment variables: `PLAS_BASE_URL` the provider’s base URL · `PLAS_TOKEN` an access token.

### Parameters

- `patronId` (In `path`, `string`, required) — Patron ID from authentication

Shared across operations: `version`. [See the shared contract on the version page.](https://plasapi.com/provider/v0.6.4/)

### Request body

`application/json` · required

[`CreatePatronListRequestBody`](https://plasapi.com/provider/v0.6.4/schemas/#CreatePatronListRequestBody)

### Responses

#### `204` Success

No response body.

#### `400` The list of errors.

`Errors`

Shared response, defined once for the whole API. [See the shared contract on the version page.](https://plasapi.com/provider/v0.6.4/)

Example (Generated from the schema):

```json
{
  "errors": [
    {
      "code": 200103,
      "info": "200103: invalid/unsupported query parameter value"
    }
  ]
}
```

#### `401` Bearer token invalid, missing, or expired.

No response body.

Shared response, defined once for the whole API. [See the shared contract on the version page.](https://plasapi.com/provider/v0.6.4/)

#### `404` Resource not found.

No response body.

Shared response, defined once for the whole API. [See the shared contract on the version page.](https://plasapi.com/provider/v0.6.4/)

## Get patron list and items

`GET` `/patron/{patronId}/list/{listId}` · `GetPatronListAndItems`

### Example request

**cURL**

```bash
curl -X GET "$PLAS_BASE_URL/patron/40218873/list/12?version=0.6.4" \
  -H 'Accept: application/json' \
  -H "Authorization: Bearer $PLAS_TOKEN"
```

**JavaScript**

```javascript
const response = await fetch(`${process.env.PLAS_BASE_URL}/patron/40218873/list/12?version=0.6.4`, {
  method: "GET",
  headers: {
    "Accept": "application/json",
    "Authorization": `Bearer ${process.env.PLAS_TOKEN}`,
  },
});
const data = await response.json();
```

**Python**

```python
import os
import requests

response = requests.get(
    f"{os.environ['PLAS_BASE_URL']}/patron/40218873/list/12",
    params={
        "version": "0.6.4",
    },
    headers={
        "Accept": "application/json",
        "Authorization": f"Bearer {os.environ['PLAS_TOKEN']}",
    },
)
data = response.json()
```

The host and token are environment variables: `PLAS_BASE_URL` the provider’s base URL · `PLAS_TOKEN` an access token.

### Parameters

- `patronId` (In `path`, `string`, required) — Patron ID from authentication
- `listId` (In `path`, `string`, required) — Patron list ID

Shared across operations: `version`. [See the shared contract on the version page.](https://plasapi.com/provider/v0.6.4/)

### Responses

#### `200` Success

`PatronListResponseBody`

Example (Generated from the schema):

```json
{
  "id": "94549",
  "name": "Kari Nordmann",
  "items": [
    {
      "id": "94549",
      "publicationId": "310552",
      "type": "workAndPublication",
      "workId": "882107"
    }
  ]
}
```

#### `400` The list of errors.

`Errors`

Shared response, defined once for the whole API. [See the shared contract on the version page.](https://plasapi.com/provider/v0.6.4/)

Example (Generated from the schema):

```json
{
  "errors": [
    {
      "code": 200103,
      "info": "200103: invalid/unsupported query parameter value"
    }
  ]
}
```

#### `401` Bearer token invalid, missing, or expired.

No response body.

Shared response, defined once for the whole API. [See the shared contract on the version page.](https://plasapi.com/provider/v0.6.4/)

#### `404` Resource not found.

No response body.

Shared response, defined once for the whole API. [See the shared contract on the version page.](https://plasapi.com/provider/v0.6.4/)

## Insert an item to a patron list

`POST` `/patron/{patronId}/list/{listId}` · `InsertItemToPatronList`

Insert an item anywhere into the patron list.

### Example request

**cURL**

```bash
curl -X POST "$PLAS_BASE_URL/patron/40218873/list/12?version=0.6.4" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer $PLAS_TOKEN" \
  -d '{
  "id": "94549",
  "publicationId": "310552",
  "type": "workAndPublication",
  "workId": "882107"
}'
```

**JavaScript**

```javascript
const response = await fetch(`${process.env.PLAS_BASE_URL}/patron/40218873/list/12?version=0.6.4`, {
  method: "POST",
  headers: {
    "Accept": "application/json",
    "Content-Type": "application/json",
    "Authorization": `Bearer ${process.env.PLAS_TOKEN}`,
  },
  body: JSON.stringify({
    "id": "94549",
    "publicationId": "310552",
    "type": "workAndPublication",
    "workId": "882107"
  }),
});
```

**Python**

```python
import os
import requests

response = requests.post(
    f"{os.environ['PLAS_BASE_URL']}/patron/40218873/list/12",
    params={
        "version": "0.6.4",
    },
    headers={
        "Accept": "application/json",
        "Content-Type": "application/json",
        "Authorization": f"Bearer {os.environ['PLAS_TOKEN']}",
    },
    json={
        "id": "94549",
        "publicationId": "310552",
        "type": "workAndPublication",
        "workId": "882107",
    },
)
response.raise_for_status()
```

The host and token are environment variables: `PLAS_BASE_URL` the provider’s base URL · `PLAS_TOKEN` an access token.

### Parameters

- `patronId` (In `path`, `string`, required) — Patron ID from authentication
- `listId` (In `path`, `string`, required) — Patron list ID
- `position` (In `query`, `integer`, optional) — Used to decide where to insert the item, zero based. Default value is 0.

If position is greater than the number of items in the list, the item will be added to the end of the list.  
If position is less than zero, the item will be added to the front of the list.

If an item already exists at the position, the new item will be inserted before (at the specified position), and the existing item will be shifted one position down the list.


Shared across operations: `version`. [See the shared contract on the version page.](https://plasapi.com/provider/v0.6.4/)

### Request body

`application/json` · required

[`AddItemToPatronListRequestBody`](https://plasapi.com/provider/v0.6.4/schemas/#AddItemToPatronListRequestBody)

### Responses

#### `204` Success

No response body.

#### `400` The list of errors.

`Errors`

Shared response, defined once for the whole API. [See the shared contract on the version page.](https://plasapi.com/provider/v0.6.4/)

Example (Generated from the schema):

```json
{
  "errors": [
    {
      "code": 200103,
      "info": "200103: invalid/unsupported query parameter value"
    }
  ]
}
```

#### `401` Bearer token invalid, missing, or expired.

No response body.

Shared response, defined once for the whole API. [See the shared contract on the version page.](https://plasapi.com/provider/v0.6.4/)

#### `404` Resource not found.

No response body.

Shared response, defined once for the whole API. [See the shared contract on the version page.](https://plasapi.com/provider/v0.6.4/)

## Delete patron list

`DELETE` `/patron/{patronId}/list/{listId}` · `DeletePatronList`

### Example request

**cURL**

```bash
curl -X DELETE "$PLAS_BASE_URL/patron/40218873/list/12?version=0.6.4" \
  -H 'Accept: application/json' \
  -H "Authorization: Bearer $PLAS_TOKEN"
```

**JavaScript**

```javascript
const response = await fetch(`${process.env.PLAS_BASE_URL}/patron/40218873/list/12?version=0.6.4`, {
  method: "DELETE",
  headers: {
    "Accept": "application/json",
    "Authorization": `Bearer ${process.env.PLAS_TOKEN}`,
  },
});
```

**Python**

```python
import os
import requests

response = requests.delete(
    f"{os.environ['PLAS_BASE_URL']}/patron/40218873/list/12",
    params={
        "version": "0.6.4",
    },
    headers={
        "Accept": "application/json",
        "Authorization": f"Bearer {os.environ['PLAS_TOKEN']}",
    },
)
response.raise_for_status()
```

The host and token are environment variables: `PLAS_BASE_URL` the provider’s base URL · `PLAS_TOKEN` an access token.

### Parameters

- `patronId` (In `path`, `string`, required) — Patron ID from authentication
- `listId` (In `path`, `string`, required) — Patron list ID

Shared across operations: `version`. [See the shared contract on the version page.](https://plasapi.com/provider/v0.6.4/)

### Responses

#### `204` Success

No response body.

#### `400` The list of errors.

`Errors`

Shared response, defined once for the whole API. [See the shared contract on the version page.](https://plasapi.com/provider/v0.6.4/)

Example (Generated from the schema):

```json
{
  "errors": [
    {
      "code": 200103,
      "info": "200103: invalid/unsupported query parameter value"
    }
  ]
}
```

#### `401` Bearer token invalid, missing, or expired.

No response body.

Shared response, defined once for the whole API. [See the shared contract on the version page.](https://plasapi.com/provider/v0.6.4/)

#### `404` Resource not found.

No response body.

Shared response, defined once for the whole API. [See the shared contract on the version page.](https://plasapi.com/provider/v0.6.4/)

## Update patron list

`PATCH` `/patron/{patronId}/list/{listId}` · `UpdatePatronList`

### Example request

**cURL**

```bash
curl -X PATCH "$PLAS_BASE_URL/patron/40218873/list/12?version=0.6.4" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer $PLAS_TOKEN" \
  -d '{
  "name": "Kari Nordmann"
}'
```

**JavaScript**

```javascript
const response = await fetch(`${process.env.PLAS_BASE_URL}/patron/40218873/list/12?version=0.6.4`, {
  method: "PATCH",
  headers: {
    "Accept": "application/json",
    "Content-Type": "application/json",
    "Authorization": `Bearer ${process.env.PLAS_TOKEN}`,
  },
  body: JSON.stringify({
    "name": "Kari Nordmann"
  }),
});
```

**Python**

```python
import os
import requests

response = requests.patch(
    f"{os.environ['PLAS_BASE_URL']}/patron/40218873/list/12",
    params={
        "version": "0.6.4",
    },
    headers={
        "Accept": "application/json",
        "Content-Type": "application/json",
        "Authorization": f"Bearer {os.environ['PLAS_TOKEN']}",
    },
    json={
        "name": "Kari Nordmann",
    },
)
response.raise_for_status()
```

The host and token are environment variables: `PLAS_BASE_URL` the provider’s base URL · `PLAS_TOKEN` an access token.

### Parameters

- `patronId` (In `path`, `string`, required) — Patron ID from authentication
- `listId` (In `path`, `string`, required) — Patron list ID

Shared across operations: `version`. [See the shared contract on the version page.](https://plasapi.com/provider/v0.6.4/)

### Request body

`application/json` · required

[`UpdatePatronListRequestBody`](https://plasapi.com/provider/v0.6.4/schemas/#UpdatePatronListRequestBody)

### Responses

#### `204` Success

No response body.

#### `400` The list of errors.

`Errors`

Shared response, defined once for the whole API. [See the shared contract on the version page.](https://plasapi.com/provider/v0.6.4/)

Example (Generated from the schema):

```json
{
  "errors": [
    {
      "code": 200103,
      "info": "200103: invalid/unsupported query parameter value"
    }
  ]
}
```

#### `401` Bearer token invalid, missing, or expired.

No response body.

Shared response, defined once for the whole API. [See the shared contract on the version page.](https://plasapi.com/provider/v0.6.4/)

#### `404` Resource not found.

No response body.

Shared response, defined once for the whole API. [See the shared contract on the version page.](https://plasapi.com/provider/v0.6.4/)

## Delete item from a patron list

`DELETE` `/patron/{patronId}/list/{listId}/item/{itemId}` · `DeletePatronListItem`

### Example request

**cURL**

```bash
curl -X DELETE "$PLAS_BASE_URL/patron/40218873/list/12/item/03011042557129?version=0.6.4" \
  -H 'Accept: application/json' \
  -H "Authorization: Bearer $PLAS_TOKEN"
```

**JavaScript**

```javascript
const response = await fetch(`${process.env.PLAS_BASE_URL}/patron/40218873/list/12/item/03011042557129?version=0.6.4`, {
  method: "DELETE",
  headers: {
    "Accept": "application/json",
    "Authorization": `Bearer ${process.env.PLAS_TOKEN}`,
  },
});
```

**Python**

```python
import os
import requests

response = requests.delete(
    f"{os.environ['PLAS_BASE_URL']}/patron/40218873/list/12/item/03011042557129",
    params={
        "version": "0.6.4",
    },
    headers={
        "Accept": "application/json",
        "Authorization": f"Bearer {os.environ['PLAS_TOKEN']}",
    },
)
response.raise_for_status()
```

The host and token are environment variables: `PLAS_BASE_URL` the provider’s base URL · `PLAS_TOKEN` an access token.

### Parameters

- `patronId` (In `path`, `string`, required) — Patron ID from authentication
- `listId` (In `path`, `string`, required) — Patron list ID
- `itemId` (In `path`, `string`, required) — Item ID from a patron list

Shared across operations: `version`. [See the shared contract on the version page.](https://plasapi.com/provider/v0.6.4/)

### Responses

#### `204` Success

No response body.

#### `400` The list of errors.

`Errors`

Shared response, defined once for the whole API. [See the shared contract on the version page.](https://plasapi.com/provider/v0.6.4/)

Example (Generated from the schema):

```json
{
  "errors": [
    {
      "code": 200103,
      "info": "200103: invalid/unsupported query parameter value"
    }
  ]
}
```

#### `401` Bearer token invalid, missing, or expired.

No response body.

Shared response, defined once for the whole API. [See the shared contract on the version page.](https://plasapi.com/provider/v0.6.4/)

#### `404` Resource not found.

No response body.

Shared response, defined once for the whole API. [See the shared contract on the version page.](https://plasapi.com/provider/v0.6.4/)

## Move item position on patron list

`PATCH` `/patron/{patronId}/list/{listId}/item/{itemId}` · `MovePatronListItem`

This moves the item to the specified position on the patron list, the same rules applies here as when
inserting an item to a patron list (POST /patron/{patronId}/list/{listId}).


### Example request

**cURL**

```bash
curl -X PATCH "$PLAS_BASE_URL/patron/40218873/list/12/item/03011042557129?version=0.6.4&position=0" \
  -H 'Accept: application/json' \
  -H "Authorization: Bearer $PLAS_TOKEN"
```

**JavaScript**

```javascript
const response = await fetch(`${process.env.PLAS_BASE_URL}/patron/40218873/list/12/item/03011042557129?version=0.6.4&position=0`, {
  method: "PATCH",
  headers: {
    "Accept": "application/json",
    "Authorization": `Bearer ${process.env.PLAS_TOKEN}`,
  },
});
```

**Python**

```python
import os
import requests

response = requests.patch(
    f"{os.environ['PLAS_BASE_URL']}/patron/40218873/list/12/item/03011042557129",
    params={
        "version": "0.6.4",
        "position": "0",
    },
    headers={
        "Accept": "application/json",
        "Authorization": f"Bearer {os.environ['PLAS_TOKEN']}",
    },
)
response.raise_for_status()
```

The host and token are environment variables: `PLAS_BASE_URL` the provider’s base URL · `PLAS_TOKEN` an access token.

### Parameters

- `patronId` (In `path`, `string`, required) — Patron ID from authentication
- `listId` (In `path`, `string`, required) — Patron list ID
- `itemId` (In `path`, `string`, required) — Item ID from a patron list
- `position` (In `query`, `integer`, required) — Used to decide where to move an item to, zero based.

Shared across operations: `version`. [See the shared contract on the version page.](https://plasapi.com/provider/v0.6.4/)

### Responses

#### `204` Success

No response body.

#### `400` The list of errors.

`Errors`

Shared response, defined once for the whole API. [See the shared contract on the version page.](https://plasapi.com/provider/v0.6.4/)

Example (Generated from the schema):

```json
{
  "errors": [
    {
      "code": 200103,
      "info": "200103: invalid/unsupported query parameter value"
    }
  ]
}
```

#### `401` Bearer token invalid, missing, or expired.

No response body.

Shared response, defined once for the whole API. [See the shared contract on the version page.](https://plasapi.com/provider/v0.6.4/)

#### `404` Resource not found.

No response body.

Shared response, defined once for the whole API. [See the shared contract on the version page.](https://plasapi.com/provider/v0.6.4/)
