---
title: "Cancels an event: it stops selling, its sessions ahead come off the schedule, and every attendee is told and refunded in full."
---

> 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 › transaction

`POST /v1/stores/{store}/products/{product}/cancel`

## Authentication

- `bearer`, http, header `Authorization`, scopes: `transaction:write`

## Path parameters

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

## Header parameters

- `Idempotency-Key` (`cancelEvent.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

_Optional._

## Example request

```json
{}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.sherpo.io/merchant/v1/stores/<store>/products/<product>/cancel' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{}'
```

### TypeScript

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

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>/cancel"

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

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

print(response.text)
```

## Responses

### 200

Cancels an event: it stops selling, its sessions ahead come off the schedule, and every attendee is told and refunded in full.

#### Example

```json
{
  "product_id": "string",
  "canceled_at": "string",
  "subscriptions": 0,
  "finished_at": "string",
  "removed": [
    {
      "id": "string",
      "starts_at": "string",
      "ends_at": "string",
      "time_zone": "string",
      "venue": "string",
      "online_label": "string"
    }
  ],
  "refunds": {
    "pending": 0,
    "failed": 0,
    "manual": 0,
    "refunded": 0
  }
}
```

- `product_id` (`cancelEvent.response.200.product_id`; string, required)
- `canceled_at` (`cancelEvent.response.200.canceled_at`; string, required)
- `subscriptions` (`cancelEvent.response.200.subscriptions`; integer, required) — Subscriptions to the event it stops billing.
  - min 0
- `finished_at` (`cancelEvent.response.200.finished_at`; any of, required) — When every holder had lost their access and was owed their mail and refunds; null while that runs.
  - any of: `string`, `null`
- `removed` (`cancelEvent.response.200.removed`; array<object>, required) — The sessions ahead it took off the schedule.
  - `id` (`cancelEvent.response.200.removed.id`; string, required) — The session's id, which a calendar knows it by.
  - `starts_at` (`cancelEvent.response.200.removed.starts_at`; string, required)
  - `ends_at` (`cancelEvent.response.200.removed.ends_at`; string, required)
  - `time_zone` (`cancelEvent.response.200.removed.time_zone`; string, required)
  - `venue` (`cancelEvent.response.200.removed.venue`; any of, required)
    - any of: `string`, `null`
  - `online_label` (`cancelEvent.response.200.removed.online_label`; any of, required)
    - any of: `string`, `null`
- `refunds` (`cancelEvent.response.200.refunds`; object, required)
  - `pending` (`cancelEvent.response.200.refunds.pending`; number, required)
  - `failed` (`cancelEvent.response.200.refunds.failed`; number, required)
  - `manual` (`cancelEvent.response.200.refunds.manual`; number, required)
  - `refunded` (`cancelEvent.response.200.refunds.refunded`; 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` (`cancelEvent.response.default.type`; string, required)
  - format `uri`
- `title` (`cancelEvent.response.default.title`; string, required)
- `status` (`cancelEvent.response.default.status`; integer, required)
- `detail` (`cancelEvent.response.default.detail`; string, required)
- `code` (`cancelEvent.response.default.code`; string, optional)
- `context` (`cancelEvent.response.default.context`; object, optional)
- `reached_core` (`cancelEvent.response.default.reached_core`; boolean, optional)
- `core_answer` (`cancelEvent.response.default.core_answer`; string, optional)


Source: https://docs.sherpo.io/merchant-api/reference/cancel-event/index.md
