Event Ticket template
The event-ticket template renders a business image as a PNG. POST a JSON payload to the endpoint below and you receive a CDN URL in the response.
Endpoint
POST https://html2img.com/api/v1/templates/event-ticket
X-API-Key: <your-api-key>
Content-Type: application/json
Authentication uses the X-API-Key header. See the
authentication docs
for details on issuing and rotating keys.
Inputs
The full set of inputs the template accepts:
| Name | Type | Required | Description | Example |
|---|---|---|---|---|
event_name | string | Yes | Text value for the event name. | The Type Conference 2026 |
event_date | string | Yes | Text value for the event date. | Saturday, June 13, 2026 |
event_time | string | No | Text value for the event time. | 9:00 AM – 6:00 PM |
venue | string | No | Text value for the venue. | Alexandra Palace · London |
attendee_name | string | Yes | Text value for the attendee name. | Margaret Lin |
section | string | No | Text value for the section. | Floor B |
seat | string | No | Text value for the seat. | Row 14, Seat 22 |
ticket_id | string | No | Text value for the ticket id. | TYP-2026-09421 |
qr_url | url | No | URL of the qr to include in the rendered image. | https://api.qrserver.com/v1/create-qr-code/?size=240x240&data=TYP-2026-09421 |
logo_url | url | No | URL of the logo to include in the rendered image. | — |
background_color | string | No | Hex colour code for the background. | #0F172A |
accent_color | string | No | Hex colour code for the accent. | #F97316 |
Defaults
Defaults applied automatically when not overridden in the request:
| Option | Default value |
|---|---|
width | 1600 |
height | 600 |
Code examples
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"}' <?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'); 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(); 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'] Looking for a fuller integration sketch in your language? The usage guides cover PHP, Laravel, Rails, Python, JavaScript, React and Vue.
Response
A successful render returns:
{
"success": true,
"id": "abc123",
"url": "https://i.html2img.com/abc123.png",
"credits_remaining": 1234,
"template": "event-ticket"
}
The url field is a CDN URL for the rendered PNG. credits_remaining tracks your monthly quota. Shared response fields are documented in the
API parameters reference.
Errors
The template endpoint returns the following error responses:
422 Validation failed
Returned when one or more inputs fail validation. The errors object lists field-specific messages.
{
"success": false,
"error": "validation_failed",
"errors": {
"title": ["The title field is required."]
}
} 404 Template not found
Returned with {"code": "template_not_found"} if the slug is not registered. Check the template list for current slugs.
401 Unauthorised
Missing or invalid API key. See the authentication docs.
429 Too many requests
You have hit the rate limit or used your monthly credits. The pricing page covers higher-volume plans.
Related templates
- Invoice Image — Render full invoices as PNG images for emails, dashboards, and exports
- Receipt Image — Compact order receipts for confirmation emails and thank-you screens
- Product Card — E-commerce product cards with price, optional sale price, and CTA
See the Event Ticket template in our gallery for sample renders and use cases.