---
title: "Clears a customer's attempts at an entry's quizzes."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.sherpo.io/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Sherpo merchant API › quiz

`POST /v1/stores/{store}/products/{product}/entries/{entry}/attempts/clear`

## Authentication

- `bearer`, http, header `Authorization`, scopes: `quiz:delete`

## Path parameters

- `store` (`clearAttempts.path.store`; string, required) — The store's id.
- `product` (`clearAttempts.path.product`; string, required) — An id, or `slug:<slug>`.
  - minLength 1
- `entry` (`clearAttempts.path.entry`; string, required)
  - minLength 1

## Header parameters

- `Idempotency-Key` (`clearAttempts.header.Idempotency-Key`; string, optional) — Repeats within 24 hours answer the first result; the same key with other arguments is a conflict.
  - minLength 1; maxLength 255; pattern `^[\x21-\x7E]+$`

## Request body

_Required._

- `customer` (`clearAttempts.customer`; object, required)
  - `id` (`clearAttempts.customer.id`; string, required)
    - minLength 1; maxLength 512

## Example request

```json
{
  "customer": {
    "id": "string"
  }
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.sherpo.io/merchant/v1/stores/<store>/products/<product>/entries/<entry>/attempts/clear' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "customer": {
    "id": "string"
  }
}
'
```

### TypeScript

```typescript
const url = 'https://api.sherpo.io/merchant/v1/stores/<store>/products/<product>/entries/<entry>/attempts/clear';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({customer: {id: 'string'}})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.sherpo.io/merchant/v1/stores/<store>/products/<product>/entries/<entry>/attempts/clear"

payload = { "customer": { "id": "string" } }
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

Clears a customer's attempts at an entry's quizzes.

#### Example

```json
{
  "deleted": 0
}
```

- `deleted` (`clearAttempts.response.200.deleted`; number, required)

### default

A problem; see https://api.sherpo.io/merchant/docs/errors.

#### Example

```json
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "context": {},
  "reached_core": true,
  "core_answer": "string"
}
```

- `type` (`clearAttempts.response.default.type`; string, required)
  - format `uri`
- `title` (`clearAttempts.response.default.title`; string, required)
- `status` (`clearAttempts.response.default.status`; integer, required)
- `detail` (`clearAttempts.response.default.detail`; string, required)
- `code` (`clearAttempts.response.default.code`; string, optional)
- `context` (`clearAttempts.response.default.context`; object, optional)
- `reached_core` (`clearAttempts.response.default.reached_core`; boolean, optional)
- `core_answer` (`clearAttempts.response.default.core_answer`; string, optional)


Source: https://docs.sherpo.io/merchant-api/reference/clear-attempts/index.md
