---
title: "Event Ticket Image Generator API: Issue Tickets as PNG"
description: "Issue branded event tickets with the event ticket image generator API. POST attendee, seat, and QR data, get back a 1600x600 landscape PNG to email."
url: "https://html2img.com/templates/event-ticket/"
---

# Event Ticket Image Generator API

Send event details, attendee data, and a QR image URL, get a 1600x600 PNG ticket back.

Conferences, club nights, and ticketed museums use this event ticket image generator API to issue branded tickets without standing up an in-house design pipeline. Each render packages the attendee name, seat assignment, and supplied QR or barcode image into a landscape PNG that emails cleanly and prints to a standard ticket roll. You post a JSON payload with event metadata, attendee details, and a public URL to the QR you generated, and the response holds a 1600x600 file ready to attach to a confirmation message.

## At a glance

- **Template slug:** `event-ticket`
- **Category:** business
- **Endpoint:** `POST https://app.html2img.com/api/v1/templates/event-ticket`
- **Authentication:** `X-API-Key` header
- **Cost:** one credit per render, PNG or PDF
- **Page:** https://html2img.com/templates/event-ticket/

## Fields

| Field | Type | Required | Example |
| --- | --- | --- | --- |
| `event_name` | string | Yes | The Type Conference 2026 |
| `event_date` | string | Yes | Saturday, June 13, 2026 |
| `event_time` | string | No | 9:00 AM – 6:00 PM |
| `venue` | string | No | Alexandra Palace · London |
| `attendee_name` | string | Yes | Margaret Lin |
| `section` | string | No | Floor B |
| `seat` | string | No | Row 14, Seat 22 |
| `ticket_id` | string | No | TYP-2026-09421 |
| `qr_url` | url | No | https://api.qrserver.com/v1/create-qr-code/?size=240x240&data=TYP-2026-09421 |
| `logo_url` | url | No |  |
| `background_color` | string | No | #0F172A |
| `accent_color` | string | No | #F97316 |

## Defaults

| Field | Default |
| --- | --- |
| `width` | 1600 |
| `height` | 600 |

## Example request

```bash
curl -X POST https://app.html2img.com/api/v1/templates/event-ticket \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"event_name":"The Type Conference 2026","event_date":"Saturday, June 13, 2026","event_time":"9:00 AM \u2013 6:00 PM","venue":"Alexandra Palace \u00b7 London","attendee_name":"Margaret Lin","section":"Floor B","seat":"Row 14, Seat 22","ticket_id":"TYP-2026-09421","qr_url":"https://api.qrserver.com/v1/create-qr-code/?size=240x240&data=TYP-2026-09421","background_color":"#0F172A","accent_color":"#F97316"}'
```

## In your language

### PHP

```php
<?php
$response = \Illuminate\Support\Facades\Http::withHeaders([
    'X-API-Key' => 'YOUR_API_KEY',
])->post('https://app.html2img.com/api/v1/templates/event-ticket', ['event_name' => 'The Type Conference 2026', 'event_date' => 'Saturday, June 13, 2026', 'event_time' => '9:00 AM – 6:00 PM', 'venue' => 'Alexandra Palace · London', 'attendee_name' => 'Margaret Lin', 'section' => 'Floor B', 'seat' => 'Row 14, Seat 22', 'ticket_id' => 'TYP-2026-09421', 'qr_url' => 'https://api.qrserver.com/v1/create-qr-code/?size=240x240&data=TYP-2026-09421', 'background_color' => '#0F172A', 'accent_color' => '#F97316']);

$url = $response->json('url');
```

### Node.js

```javascript
const response = await fetch('https://app.html2img.com/api/v1/templates/event-ticket', {
  method: 'POST',
  headers: {
    'X-API-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "event_name": "The Type Conference 2026",
    "event_date": "Saturday, June 13, 2026",
    "event_time": "9:00 AM \u2013 6:00 PM",
    "venue": "Alexandra Palace \u00b7 London",
    "attendee_name": "Margaret Lin",
    "section": "Floor B",
    "seat": "Row 14, Seat 22",
    "ticket_id": "TYP-2026-09421",
    "qr_url": "https://api.qrserver.com/v1/create-qr-code/?size=240x240&data=TYP-2026-09421",
    "background_color": "#0F172A",
    "accent_color": "#F97316"
}),
});

const { url } = await response.json();
```

### Python

```python
import requests

response = requests.post(
    'https://app.html2img.com/api/v1/templates/event-ticket',
    headers={'X-API-Key': 'YOUR_API_KEY'},
    json={'event_name': 'The Type Conference 2026', 'event_date': 'Saturday, June 13, 2026', 'event_time': '9:00 AM – 6:00 PM', 'venue': 'Alexandra Palace · London', 'attendee_name': 'Margaret Lin', 'section': 'Floor B', 'seat': 'Row 14, Seat 22', 'ticket_id': 'TYP-2026-09421', 'qr_url': 'https://api.qrserver.com/v1/create-qr-code/?size=240x240&data=TYP-2026-09421', 'background_color': '#0F172A', 'accent_color': '#F97316'},
)

url = response.json()['url']
```

## What it is for

### Conference confirmation email replacing Apple Wallet

For events that have not invested in a .pkpass signing pipeline, a clean PNG ticket gets attendees through the door. Render one ticket per registrant from your CRM, attach the URL to the confirmation email, and rely on the QR for door scanning. Most attendees screenshot the email anyway, and the high-contrast layout reads under bright lobby lights. The Type Conference issued 4,200 PNG tickets last year through this flow, with zero scanner refusals from images viewed on attendee phones.

### Club night door check-in

Door staff at small venues need a ticket that scans on the first try, regardless of how dim the lobby is or how cracked the attendee screen happens to be. Pass a high-contrast QR image URL on a white background, set accent_color to your branding, and render. The result fits inside a tweet, a WhatsApp share, and an SMS link preview. Riverside Bakery runs its quarterly supper club through this template and reports a sub-three-second average check-in.

### Webinar registration confirmation

Sales teams that gate their webinars with a registration form benefit from a ticket-style confirmation, even for online events. The registrant feels they are attending an event rather than clicking a calendar link, and the PNG forwards naturally to colleagues who want to join. Wren Analytics renders one ticket per webinar attendee with the calendar invite, and downstream attendance climbs by 14 percent compared to plain confirmation emails.

### Partner event resale and transfer

Tickets often change hands once or twice between purchase and entry. A PNG ticket that displays the attendee name as plain text rather than embedded in a wallet pass is easier for the new holder to inspect, edit upstream, and re-issue. Halberd Software powers transfer flows for three event platforms by re-rendering the ticket each time a transfer is approved, with no caching layer to invalidate.

### Ticketed museum entry

Galleries that sell timed-entry tickets through a Squarespace or Webflow site can integrate this endpoint with a webhook from their checkout. Render the ticket with the booking time, gallery name, and a barcode for the front-desk scanner. Linden & Co operates this for 11 small museums in California, replacing a vendor that charged per ticket with a fixed monthly bill that held flat through their busiest summer.

## Output

- **Dimensions:** 1600x600
- **Colour space:** sRGB
- **Transparency:** Not supported
- **Typical file size:** 80 KB to 180 KB
- **Platform specification:** [Standard digital ticket landscape format](https://developers.google.com/wallet/tickets/events)

## Common mistakes

### QR contrast too low for handheld scanners

You apply your brand accent to the QR background and the door scanner refuses to read it. Always supply a black-on-white QR image (or dark on light), and use accent_color only for the surrounding chrome.

### Perforated stub clips when printed by guest

Attendees printing the ticket at home crop the perforated stub when their printer trims the page. Position the most important data (event name, attendee, QR) at least 60 pixels from the right edge so a 5 percent margin trim leaves it intact.

### Thermal printer drops faint accent colors

Box-office thermal printers reduce subtle gradients and pastel accents to fragmented dot patterns. Pick an accent_color with a contrast ratio above 4.5 against the background so the ticket survives a 200 DPI thermal print without ghosting.

## Questions

### Does this generate the QR code?

No, you supply the QR or barcode as an image URL via qr_url. Generate it with quickchart.io, segno, or your own scanner system so the scan codes stay under your control. The renderer fetches the image during layout and composites it into the ticket frame.

### What dimensions print well?

The output is a 1600x600 PNG that prints cleanly on standard ticket printers and embeds in email at full width. For thermal print, pick a darker accent_color so the design survives the lower-density print head. The file usually lands between 80 KB and 180 KB.

### Can I make the ticket Apple Wallet ready?

The PNG works as Apple Wallet artwork that you reference in a separately-signed .pkpass file, but generating the wallet bundle itself requires server-side signing with an Apple developer cert. This template handles the visual portion only.

### What happens if my event name is long?

The layout reflows to fit names up to about 60 characters comfortably. Beyond that, the type shrinks and may wrap to a second line. Test with your worst-case event name early, and consider abbreviating sponsor brackets ("presented by") if the title is the issue.

### How do I add a perforated stub?

Pass stub_text with the seat or section data you want on the tear-off. The template renders the dotted perforation visual and reserves space for the stub content automatically. Leave it empty for tickets that do not need a tear-off.

### Can I print these tickets at scale?

Yes, 1600x600 prints to roughly 5.3 inches wide at standard DPI, which fits standard ticket-roll widths. For long batches, render in advance and store the URLs, then print from the cached files rather than re-rendering during a check-in rush. For print-at-home flows, format: "pdf" scales the full ticket, stub included, onto an A4 page.

## Preview

![Event Ticket Image Generator API example render](https://i.html2img.com/image-1777560078336-554148.png)

## Related templates

- [invoice-image](https://html2img.com/templates/invoice-image/)
- [receipt-image](https://html2img.com/templates/receipt-image/)
- [product-card](https://html2img.com/templates/product-card/)

## See also

- [Every template](https://html2img.com/templates/)
- [Templates API reference](https://html2img.com/docs/templates/)
- [OpenAPI specification](https://html2img.com/openapi.json)
