# Patron Configuration

Provider API v0.6.7 · 1 operasjon
Kilde: https://plasapi.com/no/provider/v0.6.7/patron-configuration/

The rules and limits that apply to one particular patron rather than to the library as a whole. For example how many reservations the patron may have, which pickup locations they may choose, and whether making a reservation costs them a fee.

## Get patron configuration

`GET` `/patron/{patronId}/configuration` · `GetPatronConfiguration`

### Eksempel på kall

**cURL**

```bash
curl -X GET "$PLAS_BASE_URL/patron/40218873/configuration?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/configuration?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/configuration",
    params={
        "version": "0.6.7",
    },
    headers={
        "Accept": "application/json",
        "Authorization": f"Bearer {os.environ['PLAS_TOKEN']}",
    },
)
data = response.json()
```

Verten og tokenet er miljøvariabler: `PLAS_BASE_URL` providerens adresse · `PLAS_TOKEN` et access token.

### Parametere

- `patronId` (i `path`, `string`, påkrevd) — Patron ID from authentication

Felles for operasjonene: `version`. [Se den felles kontrakten på versjonssiden.](https://plasapi.com/no/provider/v0.6.7/)

### Svar

#### `200` Success

`PatronConfigurationResponseBody`

Eksempel (Generert fra skjemaet):

```json
{
  "configuration": {
    "reservation": {
      "fee": {
        "amount": 15000,
        "chargedAt": "reservation",
        "currency": "NOK"
      },
      "limits": [
        {
          "limit": 10,
          "type": "daily"
        }
      ],
      "pickupLocations": [
        {
          "branchId": "nordby-main",
          "branchName": "Nordby Main Library",
          "sections": [
            {
              "id": "nordby-main-children",
              "name": "Children’s department",
              "type": "department"
            }
          ]
        }
      ]
    }
  }
}
```

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

`Errors`

Felles svar, definert én gang for hele API-et. [Se den felles kontrakten på versjonssiden.](https://plasapi.com/no/provider/v0.6.7/)

Eksempel (Generert fra skjemaet):

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

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

Ikke noe innhold i svaret.

Felles svar, definert én gang for hele API-et. [Se den felles kontrakten på versjonssiden.](https://plasapi.com/no/provider/v0.6.7/)

#### `404` Resource not found.

Ikke noe innhold i svaret.

Felles svar, definert én gang for hele API-et. [Se den felles kontrakten på versjonssiden.](https://plasapi.com/no/provider/v0.6.7/)
