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

# Create Ticket Class

> Create a new ticket class (tier) on an event

# Create Ticket Class

Creates a new ticket class (a tier — General Admission, VIP, Early Bird, …) on an event your API key's organization owns.

Requires the `ticket_classes:write` scope.

## Idempotency

Pass an `Idempotency-Key` header (max 255 chars) to make POST retries safe. The first request executes the create; subsequent requests with the same key within 24 hours replay the original response verbatim — including the original status code — and add an `Idempotent-Replay: true` response header. Keys are scoped per API key.

Two concurrent requests with the same key return `409 idempotent_request_in_progress` to the second caller.

## Path Parameters

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

## Request Body

<ParamField body="name" type="string" required>
  Ticket class name (1..120 chars). Must be unique among active ticket classes on the event.
</ParamField>

<ParamField body="description" type="string">
  Optional description shown to attendees (max 10000 chars).
</ParamField>

<ParamField body="currency" type="string" required>
  ISO 4217 currency code (`USD`, `EUR`, …).
</ParamField>

<ParamField body="cost" type="number" required>
  Price per ticket. Pass `0` for free tickets.
</ParamField>

<ParamField body="free" type="boolean">
  Marks the class as free. Defaults to `true` when `cost` is `0`.
</ParamField>

<ParamField body="quantity_total" type="integer">
  Total tickets available. Pass `0` (default) for unlimited.
</ParamField>

<ParamField body="sales_start" type="string">
  ISO 8601 datetime when ticket sales open.
</ParamField>

<ParamField body="sales_end" type="string">
  ISO 8601 datetime when ticket sales close.
</ParamField>

<ParamField body="minimum_per_order" type="integer">
  Minimum tickets per order (default `1`).
</ParamField>

<ParamField body="maximum_per_order" type="integer">
  Maximum tickets per order (default `10`).
</ParamField>

<ParamField body="require_approval" type="boolean">
  When `true`, new registrations land in `pending_approval` instead of `valid`. Default `false`.
</ParamField>

<ParamField body="hide_on_event_page" type="boolean">
  Hide this ticket class from the public event page. Default `false`.
</ParamField>

## Response

Returns `201 Created` with the newly created ticket class in the same shape as [Get Ticket Class](/api-reference/ticket-classes/get-ticket-class).

## Errors

* `400 Validation failed` — invalid body shape (see `details` for the Zod error).
* `404 Event not found` — the event does not belong to your organization, or does not exist.
* `409 A ticket class with this name already exists` — another active class on this event already uses this name.

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST -H "X-API-KEY: your_api_key" \
    -H "Content-Type: application/json" \
    -H "Idempotency-Key: ticket-class-$(uuidgen)" \
    -d '{
      "name": "Early Bird",
      "description": "Limited release",
      "currency": "USD",
      "cost": 25,
      "quantity_total": 100,
      "minimum_per_order": 1,
      "maximum_per_order": 4
    }' \
    https://www.gomry.com/api/v1/events/AbCdEfGhIjKlMnOpQrSt/ticket-classes
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    "https://www.gomry.com/api/v1/events/AbCdEfGhIjKlMnOpQrSt/ticket-classes",
    {
      method: "POST",
      headers: {
        "X-API-KEY": "your_api_key",
        "Content-Type": "application/json",
        "Idempotency-Key": crypto.randomUUID(),
      },
      body: JSON.stringify({
        name: "Early Bird",
        currency: "USD",
        cost: 25,
        quantity_total: 100,
      }),
    }
  );
  const { data } = await response.json();
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "data": {
      "id": "prod_AbCdEf",
      "name": "Early Bird",
      "description": "Limited release",
      "status": "active",
      "currency": "USD",
      "cost": 25,
      "free": false,
      "quantity_total": 100,
      "quantity_sold": 0,
      "sales_start": null,
      "sales_end": null,
      "minimum_per_order": 1,
      "maximum_per_order": 4,
      "require_approval": false,
      "created_at": "2026-05-26T12:00:00.000Z",
      "updated_at": "2026-05-26T12:00:00.000Z"
    }
  }
  ```
</ResponseExample>
