# Simple Invoice

> A clean, professional invoice template with automatic totals computation.

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: `simple-invoice`
- Category: finance
- Pages: 1
- Open in browser: https://bannx.com/templates/simple-invoice

## 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/page-invoice-v2?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 |
|------|------|---------|-------------|
| `title` | string | `Hello World` |  |
| `companyName` | string | `Acme Studio` |  |
| `companyTagline` | string | `Creative Solutions` |  |
| `companyEmail` | string | `hello@acmestudio.com` |  |
| `companyPhone` | string | `+1 (555) 000-1234` |  |
| `logoUrl` | string | — |  |

## Pages

### Invoice

- Page ID: `page-invoice-v2`
- Size: 900×1200
- Variables: `v2`

## Example: render "Invoice"

POST (recommended):

```bash
curl -X POST "https://bannx.com/api/render" -H "Content-Type: application/json" -H "Authorization: Bearer YOUR_API_KEY" --data "{\"templateId\":\"simple-invoice\",\"draft\":false,\"format\":\"png\",\"output\":\"binary\",\"tweaks\":{\"title\":\"Hello World\",\"companyName\":\"Acme Studio\",\"companyTagline\":\"Creative Solutions\"},\"pageId\":\"page-invoice-v2\"}" -o render.png
```

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

```bash
curl -H "Authorization: Bearer YOUR_API_KEY" "https://bannx.com/api/render/page-invoice-v2?format=png&output=binary&templateId=simple-invoice&tweaks=%7B%22title%22%3A%22Hello+World%22%2C%22companyName%22%3A%22Acme+Studio%22%2C%22companyTagline%22%3A%22Creative+Solutions%22%7D" -o render.png
```
