# Patron Delete

Provider API v0.6.4 · 1 operation
Source: https://plasapi.com/provider/v0.6.4/patron-delete/

No description in the specification.

## Delete patron

`POST` `/patron/{patronId}/delete` · `DeletePatron`

Delete all patron data at the LMS.

The vendor should at the same time also deleted all patron data at the vendor.


### Example request

**cURL**

```bash
curl -X POST "$PLAS_BASE_URL/patron/40218873/delete?version=0.6.4" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer $PLAS_TOKEN" \
  -d '{
  "acknowledgement": {
    "code": "SplxlOBeZQQYbYS6WxSbIA"
  },
  "patron": {
    "identifier": {
      "type": "local",
      "value": "N00012345"
    },
    "password": "correct-horse-battery"
  }
}'
```

**JavaScript**

```javascript
const response = await fetch(`${process.env.PLAS_BASE_URL}/patron/40218873/delete?version=0.6.4`, {
  method: "POST",
  headers: {
    "Accept": "application/json",
    "Content-Type": "application/json",
    "Authorization": `Bearer ${process.env.PLAS_TOKEN}`,
  },
  body: JSON.stringify({
    "acknowledgement": {
      "code": "SplxlOBeZQQYbYS6WxSbIA"
    },
    "patron": {
      "identifier": {
        "type": "local",
        "value": "N00012345"
      },
      "password": "correct-horse-battery"
    }
  }),
});
const data = await response.json();
```

**Python**

```python
import os
import requests

response = requests.post(
    f"{os.environ['PLAS_BASE_URL']}/patron/40218873/delete",
    params={
        "version": "0.6.4",
    },
    headers={
        "Accept": "application/json",
        "Content-Type": "application/json",
        "Authorization": f"Bearer {os.environ['PLAS_TOKEN']}",
    },
    json={
        "acknowledgement": {
            "code": "SplxlOBeZQQYbYS6WxSbIA",
        },
        "patron": {
            "identifier": {
                "type": "local",
                "value": "N00012345",
            },
            "password": "correct-horse-battery",
        },
    },
)
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/)

### Request body

`application/json` · required

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

### Responses

#### `200` Success

`DeletePatronResponseBody`

Example (Generated from the schema):

```json
{
  "acknowledgement": {
    "code": "SplxlOBeZQQYbYS6WxSbIA",
    "message": "I accept the library’s terms of use."
  },
  "status": "waiting_for_acknowledgement"
}
```

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