canonical: https://jentic.com/apis/magic-heidi.cloudfunctions.net/magic-heidi

# Magic Heidi Swiss Invoice QR Code API

Jentic publishes the only available OpenAPI specification for Magic Heidi Swiss Invoice QR Code API, keeping it validated and agent-ready. Magic Heidi exposes a single Cloud Function endpoint that generates a fully formatted Swiss invoice - including the Swiss QR-bill payment slip - as a downloadable PDF. The API targets freelancers, accountants and SMB billing tools that need to issue compliant Swiss invoices without integrating against a full accounting platform.

## For AI agents

Generate a Swiss-compliant invoice PDF with embedded QR-bill payment slip from a single POST request.

## Scope

Does not handle invoice delivery, payment reconciliation, or recurring billing - use for one-shot Swiss QR-bill PDF generation only.

## Capabilities

- Generate a Swiss-compliant invoice PDF including the official QR-bill slip via POST /create_invoice_abstract_v1d
- Embed payer and creditor address blocks formatted to Swiss invoicing standards
- Encode the IBAN, reference number and amount inside the QR-bill so payers can scan and pay in their banking app
- Return the rendered PDF binary so the caller can email or archive it directly
- Customise line items, currency and VAT lines on the issued invoice

## Use cases

### Freelancer Invoice Generation

Generate a polished Swiss invoice without operating a full accounting suite. POST /create_invoice_abstract_v1d takes payer details, line items, IBAN and reference, and returns a PDF with the official QR-bill section. Suitable for freelancers, consultants and small studios that bill a handful of Swiss clients each month and want a programmatic alternative to manual invoice templates.

Example prompt: POST /create_invoice_abstract_v1d with the client's billing address, IBAN, reference number and line items, then save the returned PDF

### Embedded Billing in SMB Tools

Wire Swiss-compliant invoicing into an existing SaaS without building QR-bill rendering from scratch. The POST /create_invoice_abstract_v1d endpoint handles the precise positioning, font and reference-number rules required by SIX, returning a print-ready PDF the host app can attach to an email or store on the customer record. Useful for project tools and CRMs adding invoicing as a sidecar feature.

Example prompt: On project completion, POST /create_invoice_abstract_v1d with the project's totals and the client's billing block to attach a Swiss invoice PDF to the closeout email

### AI Agent Invoice Issuance

Let an AI billing assistant issue a compliant Swiss invoice on demand. Through Jentic the agent searches for the invoice operation, loads the input schema for /create_invoice_abstract_v1d, and executes with credentials brokered by the vault. The agent never handles the Magic Heidi API key directly, which keeps the credential out of conversational context.

Example prompt: Search Jentic for 'generate a swiss invoice pdf', load /create_invoice_abstract_v1d, and execute with the user's project totals and IBAN

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | `/create_invoice_abstract_v1d` | Generate a Swiss invoice PDF with QR-bill |

## Key resources

- **Invoice** — Generate a Swiss-compliant invoice PDF with QR-bill via /create_invoice_abstract_v1d

## Why Jentic

- **Setup:** Wiring the Magic Heidi Swiss Invoice QR Code API by hand means sending its API key to the europe-west6 cloud-functions host and handling the single PDF-generation call yourself. Through Jentic you install once, import the Magic Heidi Swiss Invoice QR Code API from the API Directory, store the key once, and your agent calls it.
- **Permission scoping:** This API exposes a single operation, generating a Swiss QR-bill PDF, so you allow that one operation and the agent can do nothing beyond it. You keep the choice of whether the agent may call it at all.
- **Credential handling:** Your Magic Heidi key is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'generate a Swiss invoice PDF', and Jentic returns the create-invoice operation with its input schema so the agent calls it without reading the GitHub README.

## Related APIs

- **Invoice Ninja API** — Full invoicing platform with clients, payments and recurring schedules
- **Space Invoices API** — Embeddable invoicing API with multi-country tax compliance
- **PDFMonkey API** — Template-driven PDF generation for cover letters and supporting documents
- **SendGrid Mail API** — Transactional email delivery to send the generated invoice to clients

## FAQ

### Why is there no official OpenAPI spec for Magic Heidi Swiss Invoice QR Code API?

Magic Heidi publishes the function on GitHub but does not ship a formal OpenAPI specification. Jentic generates and maintains this spec so that AI agents and developers can call the Swiss invoice generator via structured tooling. It is validated against the live Cloud Function and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the Magic Heidi Swiss Invoice API use?

The API uses an API key passed as a request header (the ApiKeyAuth scheme in the spec). Through Jentic the key is held encrypted in your Jentic One instance, so an agent calls /create_invoice_abstract_v1d with a scoped token rather than handling the raw credential.

### Does the Magic Heidi API generate the official Swiss QR-bill?

Yes. POST /create_invoice_abstract_v1d returns a PDF that includes the SIX-compliant QR-bill payment slip with the IBAN, amount and reference number encoded so payers can scan and pay it directly inside their banking app.

### What are the rate limits for the Magic Heidi Swiss Invoice API?

Per-endpoint rate limits are not declared in the spec. Because the endpoint runs on Google Cloud Functions in europe-west6, throughput follows that platform's per-function concurrency settings. For high-volume billing use, coordinate with the Magic Heidi maintainers on dedicated quota.

### How do I generate a Swiss invoice PDF through Jentic?

Run pip install jentic, search for 'generate a swiss invoice', and Jentic surfaces POST /create_invoice_abstract_v1d with its input schema. Execute with payer details, IBAN, reference number and line items, then persist the returned PDF binary to disk or storage.

### Can the Magic Heidi API also send the invoice to the customer?

No. The API only generates the PDF. To deliver it, pair it with an email API such as SendGrid Mail, attaching the returned PDF to a transactional email message. The agent flow is to call Magic Heidi first, then route the binary to the chosen delivery channel.

### Can I limit what my agent is allowed to do with the Magic Heidi Swiss Invoice QR Code API?

Yes. This API exposes a single operation, POST /create_invoice_abstract_v1d, which generates a Swiss QR-bill invoice PDF, so with your self-hosted Jentic One instance you decide whether your agent is allowed to call it at all. Because your own rules govern which operations and credentials the agent may use, you can permit only this invoice-generation call and the agent can do nothing beyond it. Your Magic Heidi API key is injected at execution time under those rules, so the agent generates the PDF without ever handling the raw credential.
