# Movie Ticket

> A Bannx template you can render to images or PDFs via the API.

This is a [Bannx](https://bannx.com) template. Render any of its **pages** to an image (PNG, SVG, WebP) or PDF through the Bannx Render API, and customize the output by passing **tweaks** (variable overrides).

## Template

- Template ID: `movie-ticket`
- Category: event
- Pages: 1
- Open in browser: https://bannx.com/templates/movie-ticket

## How to use

1. Pick a **page** below and note its **page ID**.
2. Call the Render API with that page ID. Override text, colors, and other values via the `tweaks` map (keys are the variable names listed below).
3. Authenticate with an API key (create one under **Settings → Space → Developers**) using the `Authorization: Bearer <token>` header. GET requests for this template require a token (or the space GET render secret `gt`).

Full docs: https://bannx.com/docs/rendering · https://bannx.com/docs/variables

## Quick demo (no API key)

AI agents and curious humans can render this **public** template with tweaks without an account. Mint a short-lived **demo token** (IP-throttled, ~1h TTL, max 5 per hour per IP) and pass it as `?demo=...` (or `Authorization: Bearer <token>`):

```bash
# 1. Mint a demo token (no auth required)
curl -s -X POST https://bannx.com/api/demo-token
# → { "token": "demo_…", "expiresAt": …, "quota": { … } }

# 2. Render with the token (public templates only)
curl -L "https://bannx.com/api/render/6a1c1c63e8cf1a3d1bd53344?format=png&output=binary&demo=demo_…" --output demo.png
```

Demo tokens only work on public templates and don't consume any space's credits. For production usage, create an API key under **Settings → Space → Developers** instead.

## Variables

| Name | Type | Default | Description |
|------|------|---------|-------------|
| `movieTitle` | string | `INTERSTELLAR` |  |
| `genre` | string | `Sci-Fi · Adventure · Drama` |  |
| `rating` | string | `PG-13` |  |
| `posterImage` | string | `https://images.unsplash.com/photo-1534447677768-be436bb09401?w=400` |  |
| `cinema` | string | `GALAXY CINEMAS` |  |
| `date` | string | `Saturday, July 19, 2025` |  |
| `time` | string | `8:30 PM` |  |
| `hall` | string | `Hall 3 · IMAX` |  |
| `row` | string | `F` |  |
| `seat` | string | `12` |  |
| `price` | string | `$18.50` |  |
| `orderId` | string | `TKT-20250719-4821` |  |
| `accentColor` | string | `#f5c518` |  |

## Pages

### Page 1

- Page ID: `6a1c1c63e8cf1a3d1bd53344`
- Size: 1200×420

## Example: render "Page 1"

POST (recommended):

```bash
curl -X POST "https://bannx.com/api/render" -H "Content-Type: application/json" -H "Authorization: Bearer YOUR_API_KEY" --data "{\"templateId\":\"movie-ticket\",\"draft\":false,\"format\":\"png\",\"output\":\"binary\",\"tweaks\":{\"movieTitle\":\"INTERSTELLAR\",\"genre\":\"Sci-Fi · Adventure · Drama\",\"rating\":\"PG-13\"},\"pageId\":\"6a1c1c63e8cf1a3d1bd53344\"}" -o render.png
```

GET (embed in an `<img>` / quick link):

```bash
curl -H "Authorization: Bearer YOUR_API_KEY" "https://bannx.com/api/render/6a1c1c63e8cf1a3d1bd53344?format=png&output=binary&templateId=movie-ticket&tweaks=%7B%22movieTitle%22%3A%22INTERSTELLAR%22%2C%22genre%22%3A%22Sci-Fi+%C2%B7+Adventure+%C2%B7+Drama%22%2C%22rating%22%3A%22PG-13%22%7D" -o render.png
```
