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

# Ticket Management

> Create ticket types, manage pricing, and control event capacity

Configure ticket types and pricing for your events with flexible options for different attendee categories.

## Capabilities

| Action              | ROLE\_CLIENT\_ADMIN | ROLE\_CLIENT\_USER |
| ------------------- | ------------------- | ------------------ |
| View ticket types   | ✅                   | ✅                  |
| Create ticket types | ✅                   | ❌                  |
| Edit pricing        | ✅                   | ❌                  |
| Set capacity        | ✅                   | ❌                  |
| View sales          | ✅                   | ✅                  |

## Features

### Ticket Types

Create multiple ticket types per event:

<Tabs>
  <Tab title="Standard Tickets">
    * **Member Ticket** - Discounted rate for members
    * **Non-Member Ticket** - Standard public rate
    * **Early Bird** - Time-limited discount
    * **Group Ticket** - Bulk purchase discount
  </Tab>

  <Tab title="Special Tickets">
    * **VIP Ticket** - Premium access with extras
    * **Student Ticket** - Reduced rate for students
    * **Complimentary** - Free tickets for speakers/sponsors
  </Tab>
</Tabs>

#### Acceptance Criteria

##### Frontend

* [ ] Ticket type list per event
* [ ] Create/edit ticket form
* [ ] Price calculator with tax preview
* [ ] Availability date pickers
* [ ] Capacity allocation interface
* [ ] Sales progress visualization
* [ ] Promo code management
* [ ] Waitlist management
* [ ] Sales export

##### Backend / API

* [ ] Backend behavior supports this feature as documented.

##### Permissions

* [ ] Access is restricted per the Capabilities matrix on this page (or equivalent role rules).

##### Business Rules

* [ ] Ticket price cannot be negative
* [ ] Cannot delete ticket type with existing sales
* [ ] Quantity must be positive integer
* [ ] Sales end date cannot be after event start
* [ ] Promo codes must be unique per event
* [ ] Waitlist entries processed FIFO when capacity opens

##### Error Handling

* [ ] Error states return clear messages and appropriate HTTP status codes.

### Ticket Configuration

<Steps>
  <Step title="Basic Details">
    * Ticket name
    * Description
    * Price (or free)
  </Step>

  <Step title="Availability">
    * Quantity available
    * Sales start date
    * Sales end date
    * Visibility (public/hidden)
  </Step>

  <Step title="Restrictions">
    * Member-only purchase
    * Maximum per order
    * Minimum per order
    * Promo code eligibility
  </Step>
</Steps>

#### Acceptance Criteria

##### Frontend

* [ ] UI supports the workflows described in this feature.

##### Backend / API

* [ ] Backend behavior supports this feature as documented.

##### Permissions

* [ ] Access is restricted per the Capabilities matrix on this page (or equivalent role rules).

##### Business Rules

* [ ] All business rules for this feature are enforced.

##### Error Handling

* [ ] Error states return clear messages and appropriate HTTP status codes.

## UI Spec (from supplied spreadsheet)

The following ticket fields are sourced from `workspace/sources/entity-registry.csv` ("Events" → ticket section).

| Field                   | Input Type  | Required     | Notes                        |
| ----------------------- | ----------- | ------------ | ---------------------------- |
| Ticket Name             | Text        | Required     | model: `ticketName`          |
| Ticket Description      | Text        | Required     | model: `ticketDescription`   |
| Ticket Price            | Number      | Required     | model: `ticketPrice`         |
| Members Only            | Checkbox    | Required     | model: `memberOnly`          |
| Members Discount        | Number      | Required     | model: `memberDiscount`      |
| Ticket Qty              | Number      | Required     | model: `ticketQuantity`      |
| Ticket Purchase Limit   | Number      | Not Required | model: `ticketPurchaseLimit` |
| GL Code                 | Text        | Required     | model: `glCode`              |
| Sales Start Date / Time | Date + Text | Not Required | model: `start`               |
| Sales End Date / Time   | Date + Text | Not Required | model: `end`                 |
| Ticket Notes            | Text        | Not Required | model: `ticketNote`          |

Spreadsheet behavior notes:

* If **Free Event** is enabled on the event, the ticket section does not appear.

#### Data Model Cross‑Reference (Entities)

* Event definition: [`Event`](/entities/core/event)
* Purchased tickets / registrations and check-in state: [`Event Ticket`](/entities/core/event-ticket)

### Pricing Options

| Feature             | Description                        |
| ------------------- | ---------------------------------- |
| **Base Price**      | Standard ticket price              |
| **Member Discount** | Automatic discount for members     |
| **Early Bird**      | Time-limited reduced price         |
| **Promo Codes**     | Discount codes for special offers  |
| **Group Pricing**   | Bulk discount for multiple tickets |
| **Tax**             | Add tax to ticket price            |

#### Acceptance Criteria

##### Frontend

* [ ] Pricing Options workflow is implemented in the UI as described.

##### Backend / API

* [ ] Backend behavior supports Pricing Options as documented.

##### Permissions

* [ ] Access is restricted per the Capabilities matrix on this page (or equivalent role rules).

##### Business Rules

* [ ] All business rules for this feature are enforced.

##### Error Handling

* [ ] Error states return clear messages and appropriate HTTP status codes.

### Capacity Management

* Set total event capacity
* Allocate capacity per ticket type
* Waitlist when sold out
* Real-time availability updates

#### Acceptance Criteria

##### Frontend

* [ ] Capacity Management workflow is implemented in the UI as described.

##### Backend / API

* [ ] Backend behavior supports Capacity Management as documented.

##### Permissions

* [ ] Access is restricted per the Capabilities matrix on this page (or equivalent role rules).

##### Business Rules

* [ ] All business rules for this feature are enforced.

##### Error Handling

* [ ] Error states return clear messages and appropriate HTTP status codes.

## Implementation Contracts

### Backend (API)

```
GET    /api/events/{id}/tickets              # List ticket types
POST   /api/events/{id}/tickets              # Create ticket type
GET    /api/events/{id}/tickets/{ticketId}   # Get ticket details
PUT    /api/events/{id}/tickets/{ticketId}   # Update ticket
DELETE /api/events/{id}/tickets/{ticketId}   # Delete ticket type

GET    /api/events/{id}/tickets/sales        # Sales summary
GET    /api/events/{id}/tickets/attendees    # List attendees

POST   /api/events/{id}/promo-codes          # Create promo code
GET    /api/events/{id}/promo-codes          # List promo codes
DELETE /api/events/{id}/promo-codes/{code}   # Delete promo code

GET    /api/events/{id}/waitlist             # Waitlist entries
POST   /api/events/{id}/waitlist/notify      # Notify waitlist
```

### Data Model

```typescript theme={null}
interface TicketType {
  id: string;
  eventId: string;
  name: string;
  description: string;
  price: number;
  quantity: number;
  quantitySold: number;
  
  // Availability
  salesStartDate: string;
  salesEndDate: string;
  visible: boolean;
  
  // Restrictions
  memberOnly: boolean;
  maxPerOrder: number;
  minPerOrder: number;
  
  createdAt: string;
  updatedAt: string;
}

interface PromoCode {
  id: string;
  eventId: string;
  code: string;
  discountType: 'percentage' | 'fixed';
  discountValue: number;
  maxUses?: number;
  usedCount: number;
  validFrom: string;
  validTo: string;
  ticketTypes?: string[]; // Applicable ticket types
}

interface TicketPurchase {
  id: string;
  ticketId: string;
  eventId: string;
  purchaserId: string;
  purchaserName: string;
  purchaserEmail: string;
  quantity: number;
  unitPrice: number;
  totalPrice: number;
  promoCode?: string;
  discountAmount: number;
  qrCode: string;
  status: 'valid' | 'used' | 'refunded' | 'cancelled';
  purchasedAt: string;
}
```

### Error Handling

| Error            | HTTP Status | Message                                         |
| ---------------- | ----------- | ----------------------------------------------- |
| Sold out         | 400         | "Tickets are sold out"                          |
| Invalid quantity | 400         | "Exceeds maximum tickets per order"             |
| Invalid promo    | 400         | "Promo code is invalid or expired"              |
| Sales closed     | 400         | "Ticket sales have ended"                       |
| Has sales        | 400         | "Cannot delete ticket type with existing sales" |
