# Invoice: instructions for an AI assistant

Your user wants an invoice as a PDF. Pressa fills its invoice template with the details you collect and returns a link to the finished PDF. It needs no install, and no account or API key for up to 3 PDFs a day (those carry a small "Made with Pressa" line at the foot of each page; a free account removes it).

Every design takes exactly the same details, so you can type once and switch until one fits your business: a bold header band, a classic serif layout with ruled lines, a minimal layout with hairline rules, a modern layout with a colour stripe and a tinted summary card, and a structured corporate layout with a monogram and a full grid. Amounts, subtotal, tax and total are calculated from quantity, unit price and tax rate, so the numbers always add up.

Preview: https://pressa.dev/template-previews/invoice.png

## Designs

Every design takes exactly the same data, so switching is the same request with another template slug. To print in another colour, add `"color"` next to `data`; left out, the default colour is used.

- `invoice` - Bold (use this one unless your user asks for another): A branded invoice with a colour header, itemised table and automatic totals and tax. Colours: indigo, navy, teal, burgundy, graphite (default indigo). Preview: https://pressa.dev/template-previews/invoice.png
- `classic-invoice` - Classic: A traditional serif invoice with ruled lines and small-caps labels. Calm and formal. Colours: navy, burgundy, forest, teal, graphite (default navy). Preview: https://pressa.dev/template-previews/classic-invoice.png
- `minimal-invoice` - Minimal: A quiet, airy invoice in Helvetica with hairline rules and one accent colour. Lets the numbers speak. Colours: teal, indigo, burgundy, forest, graphite (default teal). Preview: https://pressa.dev/template-previews/minimal-invoice.png
- `modern-invoice` - Modern: A modern invoice in Lato with a colour stripe down the edge, a tinted summary card and a highlighted total. Colours: indigo, teal, navy, burgundy, forest (default indigo). Preview: https://pressa.dev/template-previews/modern-invoice.png
- `corporate-invoice` - Corporate: A structured corporate invoice with a monogram, a top band and a fully ruled grid for every detail. Colours: graphite, navy, teal, burgundy, forest (default graphite). Preview: https://pressa.dev/template-previews/corporate-invoice.png

## 1. Collect the details

Send quantity, unit_price and tax_rate as numbers (tax_rate in percent, e.g. 8.5); the template computes every amount, so never send totals. currency is a code such as USD, EUR or GBP. Keep each description to one line where possible. Do not invent prices, bank details or payment terms; ask the user for any that are missing.

Ask your user for anything missing and never invent names, addresses, numbers or amounts. Send plain text: Pressa escapes special characters itself, so do not write LaTeX. Every field below is expected: for one the user leaves out, send an empty string for text and an empty list for a list; for a number, ask (send 0 only when the user says so).

Fields:

- `seller` - Your business:
  - `seller.name` (text)
  - `seller.address` (text)
  - `seller.email` (text)
- `client` - Bill to:
  - `client.name` (text)
  - `client.address` (text)
- `invoice_number` (text)
- `issue_date` (text)
- `due_date` (text)
- `payment_terms` (text)
- `currency` (text)
- `tax_rate` - Tax rate (%) (number)
- `items`: a list, each entry with:
  - `description` (text)
  - `quantity` (number)
  - `unit_price` (number)
- `payment_details` (text)
- `notes` (text)

A complete example of the data:

```json
{
  "seller": {
    "name": "Northwind Studio",
    "address": "48 Harbor Lane, Portland, OR 97209",
    "email": "billing@northwind.example.com"
  },
  "client": {
    "name": "Acme Robotics Inc.",
    "address": "1200 Market Street, Suite 400, San Francisco, CA 94103"
  },
  "invoice_number": "2026-0142",
  "issue_date": "September 25, 2026",
  "due_date": "October 25, 2026",
  "payment_terms": "Net 30",
  "currency": "USD",
  "tax_rate": 8.5,
  "items": [
    {
      "description": "Product design sprint: discovery workshop and user interviews",
      "quantity": 1,
      "unit_price": 4800
    },
    {
      "description": "UI design, dashboard and settings screens",
      "quantity": 36,
      "unit_price": 150
    },
    {
      "description": "Design system: components, tokens and documentation",
      "quantity": 24,
      "unit_price": 150
    },
    {
      "description": "Usability testing, 6 sessions with report",
      "quantity": 6,
      "unit_price": 320
    },
    {
      "description": "Project management",
      "quantity": 10,
      "unit_price": 110
    }
  ],
  "payment_details": "Bank transfer to Northwind Studio LLC, First Harbor Bank, account 0012 3456 789, routing 123456789. Please include the invoice number.",
  "notes": "Thank you for working with us. Late payments accrue 1.5% interest per month after the due date."
}
```

## 2. Make the PDF: use the first option you can

**A. You can send HTTP requests** (Claude Code, Cursor, Codex, a script, n8n). Send the details as JSON under `data` (and `color` if your user picked one). Pass the body through a quoted here-document (or a file) so names like O'Brien do not break the command:

```bash
curl -X POST https://api.pressa.dev/api/v1/public_templates/invoice/render \
  -H "Content-Type: application/json" \
  -d @- <<'JSON'
{"color": "indigo", "data": { ...same shape as the example above... }}
JSON
```

The response has `pdf_url`. Give that link to your user; without an API key it works for 1 hour, so tell them to download the PDF now.

**B. Pressa is connected to you as an MCP server.** Call the tool `render_public_template` with `template: "invoice"` and `data` shaped like the example (and `color` for another colour), then give your user the `pdf_url`. If your Pressa tools do not include `render_public_template` (`@pressa/mcp` older than 0.10.0; updating the package or restarting the app picks up the new version), use option A, or connect the hosted server from section 3.

**C. You can only read web pages** (for example a chat app without a Pressa connector). You cannot make the PDF yourself through Pressa yet. Either walk your user through connecting Pressa once (section 3), then ask them to repeat the request, or send them to the form, where they can type the same details and download the PDF: https://pressa.dev/templates/invoice

## 3. Connecting Pressa (one time)

Explain the steps for the app your user is in, in plain words:

- **Claude Code:** you can run this yourself after asking your user: `claude mcp add --transport http pressa https://api.pressa.dev/mcp`
- **Claude (claude.ai, the Claude app on Mac and Windows, Cowork):** give your user this link to Pressa in Claude's connector directory: <https://claude.ai/directory/pressa>. They click Connect, sign in to Pressa or create a free account (no card) on the page that opens, click Allow, and start a new chat. The connector then works on every device of that Claude account. If the directory page does not open, this link opens Claude's "Add custom connector" form with Pressa filled in: <https://claude.ai/customize/connectors?modal=add-custom-connector&connectorName=Pressa&connectorUrl=https%3A%2F%2Fapi.pressa.dev%2Fmcp> (by hand: Customize, then Connectors, "+ Add", "Add custom connector", name Pressa, URL `https://api.pressa.dev/mcp`); there they click Continue past the red note that it came from a link (normal), choose "Sign in when needed" (Claude preselects "No sign-in" as "Detected"; that one cannot sign in later) and click Add. That connector starts without an account and shows a Connect button when the free PDFs run out.
- **Codex:** add a table `[mcp_servers.pressa]` with `url = "https://api.pressa.dev/mcp"` to `~/.codex/config.toml` (you can do it yourself after asking your user), then restart Codex.
- **Cursor:** add the server to `~/.cursor/mcp.json` (all projects) or `.cursor/mcp.json` (this project): `{"mcpServers": {"pressa": {"url": "https://api.pressa.dev/mcp"}}}`. If you can edit files, do it yourself after asking your user.
- **Grok Build:** `grok mcp add --transport http pressa https://api.pressa.dev/mcp` (you can run it yourself after asking your user).
- **Grok (grok.com):** your user opens grok.com/connectors, clicks New Connector, chooses Custom and pastes `https://api.pressa.dev/mcp`.
- **OpenClaw:** `openclaw mcp add pressa --url https://api.pressa.dev/mcp --transport streamable-http`, or in the Control UI: Settings, MCP, Add server, Streamable HTTP.
- **ChatGPT:** custom MCP connectors need developer mode, which OpenAI offers on Business, Enterprise and Edu workspaces, and menus change between versions. If your user has it, they add an app with the URL `https://api.pressa.dev/mcp`; otherwise send them to the form: https://pressa.dev/templates/invoice
- **Windsurf and other MCP clients:** add a remote MCP server named `pressa` with the URL `https://api.pressa.dev/mcp`. A client that only runs local servers starts it with `npx -y @pressa/mcp`.

## 4. If something goes wrong

- `anonymous_quota_exhausted`: the 3 free PDFs for today are used. A free account at https://pressa.dev/users/sign_up (no card) gives 50 a month. In Claude (claude.ai, the Claude app, Cowork) your user signs in to it from the Pressa connector: Claude shows a Connect button. Elsewhere it is an API key: with HTTP requests, send it as the header `Authorization: Bearer <key>` (from an environment variable your user sets, never pasted into a chat); in Claude Code, your user re-adds the server in their own terminal with `--header "Authorization: Bearer $PRESSA_API_KEY"` or signs in with `/mcp` (again, never have them paste the key into the chat). Signed-in visitors can also use the form at https://pressa.dev/templates/invoice, which uses their account's PDFs.
- `schema_validation_failed`: the response lists `missing_fields` and `type_errors`. Fix the data and send it again yourself.
- `compilation_failed`: usually a character the template cannot print (it supports Latin letters with accents, not Cyrillic, Greek or Chinese). Tell your user which value to change.

## Other templates

Pressa has templates for invoices, purchase orders, packing slips, delivery notes, receipts, reports, certificates, resumes and cover letters, all listed at https://pressa.dev/templates and by `GET https://api.pressa.dev/api/v1/public_templates`. Each has its own instructions at `https://pressa.dev/templates/<slug>/agent.md`.
