> ## 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.

# Update Ticket Class

> Partial update of a ticket class

# Update Ticket Class

Updates one or more fields of a ticket class. `quantity_sold` is always recomputed server-side from the tickets collection and cannot be set by the client.

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>

## Request Body

All fields are optional but **at least one must be provided**. Fields not included are left unchanged.

<ParamField body="name" type="string">Ticket class name (1..120 chars).</ParamField>
<ParamField body="description" type="string">Description (max 10000 chars).</ParamField>
<ParamField body="currency" type="string">ISO 4217 currency code.</ParamField>
<ParamField body="cost" type="number">Price per ticket.</ParamField>
<ParamField body="free" type="boolean">Marks the class as free.</ParamField>
<ParamField body="quantity_total" type="integer">Total tickets available (0 = unlimited).</ParamField>
<ParamField body="sales_start" type="string">ISO 8601 datetime when sales open.</ParamField>
<ParamField body="sales_end" type="string">ISO 8601 datetime when sales close.</ParamField>
<ParamField body="minimum_per_order" type="integer">Minimum tickets per order.</ParamField>
<ParamField body="maximum_per_order" type="integer">Maximum tickets per order.</ParamField>
<ParamField body="require_approval" type="boolean">Whether new registrations require approval.</ParamField>
<ParamField body="hide_on_event_page" type="boolean">Hide from the public event page.</ParamField>

## Response

Returns `200 OK` with the updated ticket class in the same shape as [Get Ticket Class](/api-reference/ticket-classes/get-ticket-class).

## Errors

* `400 At least one field is required` — empty body.
* `400 Validation failed` — invalid body shape.
* `404 Event not found` / `Ticket class not found` — resource missing or not owned by your org.

<RequestExample>
  ```bash cURL theme={null}
  curl -X PATCH -H "X-API-KEY: your_api_key" \
    -H "Content-Type: application/json" \
    -d '{ "cost": 30, "quantity_total": 200 }' \
    https://www.gomry.com/api/v1/events/AbCdEfGhIjKlMnOpQrSt/ticket-classes/prod_AbCdEf
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    "https://www.gomry.com/api/v1/events/AbCdEfGhIjKlMnOpQrSt/ticket-classes/prod_AbCdEf",
    {
      method: "PATCH",
      headers: {
        "X-API-KEY": "your_api_key",
        "Content-Type": "application/json",
      },
      body: JSON.stringify({ cost: 30, quantity_total: 200 }),
    }
  );
  const { data } = await response.json();
  ```
</RequestExample>
