# Patron

Provider API v0.6.7 · 6 operations
Source: https://plasapi.com/provider/v0.6.7/patron/

A patron's own account details. Their information such as name, addresses, email addresses and phone numbers, the consents they have given or withdrawn, and how they want to be notified. Reading and updating these needs the patron ID from a successful login.

## Get patron consents

`GET` `/patron/{patronId}/consent` · `GetPatronConsents`

This includes all the consents that are available for the patron, even if the patron has made a decision on them or not.  
This also includes all the consents the patron has made a decision on, i.e. accepted or rejected.


### Example request

**cURL**

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

**JavaScript**

```javascript
const response = await fetch(`${process.env.PLAS_BASE_URL}/patron/40218873/consent?version=0.6.7`, {
  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/consent",
    params={
        "version": "0.6.7",
    },
    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.7/)

### Responses

#### `200` Success

`PatronConsentResponseBody`

Example (Generated from the schema):

```json
{
  "available": [
    {
      "type": "loan_history",
      "version": "2025-01"
    }
  ],
  "evaluated": [
    {
      "given": true,
      "type": "loan_history",
      "version": "2025-01"
    }
  ]
}
```

#### `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.7/)

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.7/)

#### `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.7/)

## Update one or more patron consent(s)

`PATCH` `/patron/{patronId}/consent` · `UpdatePatronConsent`

Update patron consents.

Only the consents that are present in the body will be updated.  
Other consents will not be updated.

The update is an atomic operation. If one consent fails to update, all consent updates in the request will be rolled back.

All consents are returned in the response, not only the updated consents.


### Example request

**cURL**

```bash
curl -X PATCH "$PLAS_BASE_URL/patron/40218873/consent?version=0.6.7" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer $PLAS_TOKEN" \
  -d '{
  "consents": [
    {
      "given": true,
      "type": "loan_history",
      "version": "2025-01"
    }
  ]
}'
```

**JavaScript**

```javascript
const response = await fetch(`${process.env.PLAS_BASE_URL}/patron/40218873/consent?version=0.6.7`, {
  method: "PATCH",
  headers: {
    "Accept": "application/json",
    "Content-Type": "application/json",
    "Authorization": `Bearer ${process.env.PLAS_TOKEN}`,
  },
  body: JSON.stringify({
    "consents": [
      {
        "given": true,
        "type": "loan_history",
        "version": "2025-01"
      }
    ]
  }),
});
const data = await response.json();
```

**Python**

```python
import os
import requests

response = requests.patch(
    f"{os.environ['PLAS_BASE_URL']}/patron/40218873/consent",
    params={
        "version": "0.6.7",
    },
    headers={
        "Accept": "application/json",
        "Content-Type": "application/json",
        "Authorization": f"Bearer {os.environ['PLAS_TOKEN']}",
    },
    json={
        "consents": [
            {
                "given": True,
                "type": "loan_history",
                "version": "2025-01",
            },
        ],
    },
)
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.7/)

### Request body

`application/json` · required

[`UpdatePatronConsentRequestBody`](https://plasapi.com/provider/v0.6.7/schemas/#UpdatePatronConsentRequestBody)

### Responses

#### `200` Success

`UpdatePatronConsentResponseBody`

Example (Generated from the schema):

```json
{
  "available": [
    {
      "type": "loan_history",
      "version": "2025-01"
    }
  ],
  "evaluated": [
    {
      "given": true,
      "type": "loan_history",
      "version": "2025-01"
    }
  ]
}
```

#### `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.7/)

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.7/)

#### `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.7/)

## Get patron information

`GET` `/patron/{patronId}/information` · `GetPatronInformation`

Retrieve patron information

### Example request

**cURL**

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

**JavaScript**

```javascript
const response = await fetch(`${process.env.PLAS_BASE_URL}/patron/40218873/information?version=0.6.7`, {
  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/information",
    params={
        "version": "0.6.7",
    },
    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.7/)

### Responses

#### `200` Success

`PatronInformationResponseBody`

Example (Generated from the schema):

```json
{
  "patron": {
    "address": {
      "city": "Nordby",
      "country": "Norway",
      "postalCode": "0182",
      "street": "Storgata 12"
    },
    "emails": [
      {
        "default": true,
        "email": "kari.nordmann@example.no",
        "verified": "yes"
      }
    ],
    "fullName": "Kari Nordmann",
    "givenName": "Kari",
    "identifiers": [
      {
        "type": "local",
        "value": "N00012345"
      }
    ],
    "patronId": "40218873",
    "permissions": [
      {
        "reason": "The patron has unpaid fees above the library’s limit.",
        "status": "allowed",
        "type": "off_hours"
      }
    ],
    "phoneNumbers": [
      {
        "default": true,
        "number": "+4791234567",
        "type": "mobile",
        "verified": "yes"
      }
    ],
    "pickupLocation": {
      "branchId": "nordby-main",
      "branchName": "Nordby Main Library",
      "sections": [
        {
          "id": "nordby-main-children",
          "name": "Children’s department",
          "type": "department"
        }
      ]
    },
    "reservation": {
      "postpone": {
        "fromDate": "2025-03-01",
        "toDate": "2025-03-31"
      }
    },
    "surname": "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.7/)

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.7/)

#### `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.7/)

## Update patron information

`PATCH` `/patron/{patronId}/information` · `UpdatePatronInformation`

Update patron information.

Important: If a field is missing on the outermost level of the json body (like `pickupLocation`, `emails`, `phoneNumbers`, etc.), the field value is not updated in the LMS.


### Example request

**cURL**

```bash
curl -X PATCH "$PLAS_BASE_URL/patron/40218873/information?version=0.6.7" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer $PLAS_TOKEN" \
  -d '{
  "address": {
    "city": "Nordby",
    "country": "Norway",
    "postalCode": "0182",
    "street": "Storgata 12"
  },
  "emails": [
    {
      "default": true,
      "email": "kari.nordmann@example.no"
    }
  ],
  "phoneNumbers": [
    {
      "default": true,
      "number": "+4791234567",
      "type": "mobile"
    }
  ],
  "pickupLocation": {
    "branchId": "nordby-main",
    "sections": [
      {
        "id": "nordby-main-children",
        "type": "department"
      }
    ]
  },
  "reservation": {
    "postpone": {
      "fromDate": "2025-03-01",
      "toDate": "2025-03-31"
    }
  }
}'
```

**JavaScript**

```javascript
const response = await fetch(`${process.env.PLAS_BASE_URL}/patron/40218873/information?version=0.6.7`, {
  method: "PATCH",
  headers: {
    "Accept": "application/json",
    "Content-Type": "application/json",
    "Authorization": `Bearer ${process.env.PLAS_TOKEN}`,
  },
  body: JSON.stringify({
    "address": {
      "city": "Nordby",
      "country": "Norway",
      "postalCode": "0182",
      "street": "Storgata 12"
    },
    "emails": [
      {
        "default": true,
        "email": "kari.nordmann@example.no"
      }
    ],
    "phoneNumbers": [
      {
        "default": true,
        "number": "+4791234567",
        "type": "mobile"
      }
    ],
    "pickupLocation": {
      "branchId": "nordby-main",
      "sections": [
        {
          "id": "nordby-main-children",
          "type": "department"
        }
      ]
    },
    "reservation": {
      "postpone": {
        "fromDate": "2025-03-01",
        "toDate": "2025-03-31"
      }
    }
  }),
});
const data = await response.json();
```

**Python**

```python
import os
import requests

response = requests.patch(
    f"{os.environ['PLAS_BASE_URL']}/patron/40218873/information",
    params={
        "version": "0.6.7",
    },
    headers={
        "Accept": "application/json",
        "Content-Type": "application/json",
        "Authorization": f"Bearer {os.environ['PLAS_TOKEN']}",
    },
    json={
        "address": {
            "city": "Nordby",
            "country": "Norway",
            "postalCode": "0182",
            "street": "Storgata 12",
        },
        "emails": [
            {
                "default": True,
                "email": "kari.nordmann@example.no",
            },
        ],
        "phoneNumbers": [
            {
                "default": True,
                "number": "+4791234567",
                "type": "mobile",
            },
        ],
        "pickupLocation": {
            "branchId": "nordby-main",
            "sections": [
                {
                    "id": "nordby-main-children",
                    "type": "department",
                },
            ],
        },
        "reservation": {
            "postpone": {
                "fromDate": "2025-03-01",
                "toDate": "2025-03-31",
            },
        },
    },
)
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.7/)

### Request body

`application/json` · required

[`UpdatePatronInformationRequestBody`](https://plasapi.com/provider/v0.6.7/schemas/#UpdatePatronInformationRequestBody)

### Responses

#### `200` Success

`UpdatePatronInformationResponseBody`

Example (Generated from the schema):

```json
{
  "patron": {
    "address": {
      "city": "Nordby",
      "country": "Norway",
      "postalCode": "0182",
      "street": "Storgata 12"
    },
    "emails": [
      {
        "default": true,
        "email": "kari.nordmann@example.no",
        "verified": "yes"
      }
    ],
    "fullName": "Kari Nordmann",
    "givenName": "Kari",
    "identifiers": [
      {
        "type": "local",
        "value": "N00012345"
      }
    ],
    "patronId": "40218873",
    "permissions": [
      {
        "reason": "The patron has unpaid fees above the library’s limit.",
        "status": "allowed",
        "type": "off_hours"
      }
    ],
    "phoneNumbers": [
      {
        "default": true,
        "number": "+4791234567",
        "type": "mobile",
        "verified": "yes"
      }
    ],
    "pickupLocation": {
      "branchId": "nordby-main",
      "branchName": "Nordby Main Library",
      "sections": [
        {
          "id": "nordby-main-children",
          "name": "Children’s department",
          "type": "department"
        }
      ]
    },
    "reservation": {
      "postpone": {
        "fromDate": "2025-03-01",
        "toDate": "2025-03-31"
      }
    },
    "surname": "Nordmann"
  }
}
```

#### `202` Accepted, meaning that the request of a patron update was received, but processing will be done (or completed) later.

`UpdatePatronInformationRequestAcceptedResponseBody`

Example (Generated from the schema):

```json
{
  "ticket": "4f1c2e9a"
}
```

#### `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.7/)

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.7/)

#### `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.7/)

## Get patron notifications settings

`GET` `/patron/{patronId}/notification-settings` · `GetPatronNotificationSettings`

Retrieve the patron's notification settings

### Example request

**cURL**

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

**JavaScript**

```javascript
const response = await fetch(`${process.env.PLAS_BASE_URL}/patron/40218873/notification-settings?version=0.6.7`, {
  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/notification-settings",
    params={
        "version": "0.6.7",
    },
    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.7/)

### Responses

#### `200` Success

`PatronNotificationSettingsResponseBody`

Example (Generated from the schema):

```json
{
  "notificationSettings": [
    {
      "category": "reservations",
      "delivery": {
        "chosen": [
          {
            "method": "sms"
          }
        ],
        "methods": [
          {
            "method": "sms"
          }
        ]
      },
      "name": "Kari Nordmann",
      "type": "reservation_ready"
    }
  ]
}
```

#### `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.7/)

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.7/)

#### `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.7/)

## Update one or more patron notification settings

`PATCH` `/patron/{patronId}/notification-settings` · `UpdatePatronNotificationSettings`

Update patron notification settings.

Only the notification settings that are present in the body will be updated.  
Other notification settings will not be updated.

The update is an atomic operation. If one notification setting fails to update, all notification settings updates in the request will be rolled back.

All notification settings are returned in the response, not only the updated notification settings.


### Example request

**cURL**

```bash
curl -X PATCH "$PLAS_BASE_URL/patron/40218873/notification-settings?version=0.6.7" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer $PLAS_TOKEN" \
  -d '{
  "notificationSettings": [
    {
      "chosen": [
        {
          "method": "sms"
        }
      ],
      "type": "reservation_ready"
    }
  ]
}'
```

**JavaScript**

```javascript
const response = await fetch(`${process.env.PLAS_BASE_URL}/patron/40218873/notification-settings?version=0.6.7`, {
  method: "PATCH",
  headers: {
    "Accept": "application/json",
    "Content-Type": "application/json",
    "Authorization": `Bearer ${process.env.PLAS_TOKEN}`,
  },
  body: JSON.stringify({
    "notificationSettings": [
      {
        "chosen": [
          {
            "method": "sms"
          }
        ],
        "type": "reservation_ready"
      }
    ]
  }),
});
const data = await response.json();
```

**Python**

```python
import os
import requests

response = requests.patch(
    f"{os.environ['PLAS_BASE_URL']}/patron/40218873/notification-settings",
    params={
        "version": "0.6.7",
    },
    headers={
        "Accept": "application/json",
        "Content-Type": "application/json",
        "Authorization": f"Bearer {os.environ['PLAS_TOKEN']}",
    },
    json={
        "notificationSettings": [
            {
                "chosen": [
                    {
                        "method": "sms",
                    },
                ],
                "type": "reservation_ready",
            },
        ],
    },
)
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.7/)

### Request body

`application/json` · required

[`UpdatePatronNotificationSettingsRequestBody`](https://plasapi.com/provider/v0.6.7/schemas/#UpdatePatronNotificationSettingsRequestBody)

### Responses

#### `200` Success

`UpdatePatronNotificationSettingsResponseBody`

Example (Generated from the schema):

```json
{
  "notificationSettings": [
    {
      "category": "reservations",
      "delivery": {
        "chosen": [
          {
            "method": "sms"
          }
        ],
        "methods": [
          {
            "method": "sms"
          }
        ]
      },
      "name": "Kari Nordmann",
      "type": "reservation_ready"
    }
  ]
}
```

#### `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.7/)

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.7/)

#### `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.7/)
