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

# Delete Ticket Class

> Soft-delete a ticket class

# Delete Ticket Class

Soft-deletes a ticket class. The class is hidden from listing endpoints but remains queryable by ID for historical purposes. The class is also removed from the event's display ordering.

**A ticket class with sold tickets cannot be deleted** — refund or move attendees first.

Requires the `ticket_classes:write` scope.

## Path Parameters

<ParamField path="eventId" type="string" required>
  The unique identifier of the event.
</ParamField>

<ParamField path="ticketClassId" type="string" required>
  The unique identifier of the ticket class.
</ParamField>

## Response

Returns `200 OK` with:

```json theme={null}
{ "deleted": true, "id": "prod_AbCdEf" }
```

## Errors

* `404 Event not found` / `Ticket class not found` — resource missing or not owned by your org.
* `409 Cannot delete a ticket class with sold tickets` — at least one ticket exists in `valid` or `checked_in` state for this class. Response body includes `sold_count`.

<RequestExample>
  ```bash cURL theme={null}
  curl -X DELETE -H "X-API-KEY: your_api_key" \
    https://www.gomry.com/api/v1/events/AbCdEfGhIjKlMnOpQrSt/ticket-classes/prod_AbCdEf
  ```

  ```javascript JavaScript theme={null}
  await fetch(
    "https://www.gomry.com/api/v1/events/AbCdEfGhIjKlMnOpQrSt/ticket-classes/prod_AbCdEf",
    { method: "DELETE", headers: { "X-API-KEY": "your_api_key" } }
  );
  ```
</RequestExample>

<ResponseExample>
  ```json 200 OK theme={null}
  { "deleted": true, "id": "prod_AbCdEf" }
  ```

  ```json 409 Conflict theme={null}
  {
    "error": "Cannot delete a ticket class with sold tickets",
    "sold_count": 7
  }
  ```
</ResponseExample>
