# My lists

6 of 6 supported
Source: https://plasapi.com/features/patron/my-lists/

Let patrons save material for later in lists of their own, without reserving it.

## 2.6.1 View my lists — Supported

Show the patron's lists and the material saved in each.

### What you can build

A list saves material for later without reserving it, so the patron can reserve or borrow it when they are ready. The lists are kept in the library system, so lists the patron has created elsewhere appear too.

### Typical flow

1. The client fetches the patron's lists with `GetPatronLists`.
2. The patron opens a list. The client fetches its items with `GetPatronListAndItems`.
3. Each item points to a work and the publication the patron saved. The client fetches what to show with `GetWorks`.
4. Opening an item shows the work with the saved publication (1.2.1).

### What the API provides

- `default` is the ID of the default list. For a client that only uses one list, the specification recommends that one, and the client can create it if it does not exist.
- An item has the `type` `workAndPublication`, with a `workId` and a `publicationId`.

### Calls in the API

Requires: 2.2.1

In this order

1. [GET /patron/{patronId}/list](https://plasapi.com/provider/v0.6.7/patron-list/#GetPatronLists) — Get all patron lists
2. [GET /patron/{patronId}/list/{listId}](https://plasapi.com/provider/v0.6.7/patron-list/#GetPatronListAndItems) — Get patron list and items
3. [GET /work](https://plasapi.com/provider/v0.6.7/work/#GetWorks) — Get Works

## 2.6.2 Remove from my lists — Supported

Remove material the patron no longer wants to keep from a list.

### Typical flow

1. The patron chooses one or more items in a list.
2. The client calls `DeletePatronListItem` for each item.

### What the API provides

- The call removes one item, identified by the list's `listId` and the item's `itemId`.

### Calls in the API

Requires: 2.2.1

- [DELETE /patron/{patronId}/list/{listId}/item/{itemId}](https://plasapi.com/provider/v0.6.7/patron-list/#DeletePatronListItem) — Delete item from a patron list

## 2.6.3 Move between lists — Supported

Move material from one of the patron's lists to another.

### What you can build

The patron reorganises saved material and can create the target list along the way (2.6.4).

### Typical flow

1. The patron chooses one or more items and a target list.
2. The client adds each item to the target list with `InsertItemToPatronList`.
3. When that succeeds, the client removes the item from the source list with `DeletePatronListItem`.

### What the API provides

- The specification has no operation that moves an item between lists. `MovePatronListItem` only changes an item's position within one list.
- Each item takes two calls. If the removal fails, the item is in both lists.

### Calls in the API

Requires: 2.2.1

In this order

1. [POST /patron/{patronId}/list/{listId}](https://plasapi.com/provider/v0.6.7/patron-list/#InsertItemToPatronList) — Insert an item to a patron list
2. [DELETE /patron/{patronId}/list/{listId}/item/{itemId}](https://plasapi.com/provider/v0.6.7/patron-list/#DeletePatronListItem) — Delete item from a patron list

## 2.6.4 Create list — Supported

Create a new list, with material added straight away if the patron wishes.

### What you can build

Patrons sort what they save into lists of their own, for example from the work page while they save a title.

### Typical flow

1. The patron names the new list.
2. The client creates it with `CreatePatronList`.
3. When the list is created from a work, the client adds the material with `InsertItemToPatronList`.

### What the API provides

- The client sets the list's `id` in the request. Both `id` and `name` are required.

### Calls in the API

Requires: 2.2.1

In this order

1. [POST /patron/{patronId}/list](https://plasapi.com/provider/v0.6.7/patron-list/#CreatePatronList) — Create a new patron list
2. [POST /patron/{patronId}/list/{listId}](https://plasapi.com/provider/v0.6.7/patron-list/#InsertItemToPatronList) — Insert an item to a patron list

## 2.6.5 Delete list — Supported

Delete a list the patron no longer wants to keep.

### Typical flow

1. The patron chooses the list and confirms.
2. The client calls `DeletePatronList`.

### Calls in the API

Requires: 2.2.1

- [DELETE /patron/{patronId}/list/{listId}](https://plasapi.com/provider/v0.6.7/patron-list/#DeletePatronList) — Delete patron list

## 2.6.6 Add to my lists — Supported

Save material to one of the patron's lists.

### What you can build

A save button on the work page: the patron adds the material to an existing list or a new one (2.6.4), and can reserve or borrow it later.

### Typical flow

1. The client fetches the patron's lists with `GetPatronLists`.
2. The patron chooses a list.
3. The client adds the item with `InsertItemToPatronList`, with the work and the publication the patron chose.

### What the API provides

- The client sets the item's `id`, together with `workId` and `publicationId`.
- `position` decides where the item goes, counted from 0. The default is 0, the front of the list; a position past the end adds the item last.

### Calls in the API

Requires: 2.2.1

In this order

1. [GET /patron/{patronId}/list](https://plasapi.com/provider/v0.6.7/patron-list/#GetPatronLists) — Get all patron lists
2. [POST /patron/{patronId}/list/{listId}](https://plasapi.com/provider/v0.6.7/patron-list/#InsertItemToPatronList) — Insert an item to a patron list
