Hagfish API
Hagfish brings professional invoicing into your products and automations. Create a client, create an invoice, and ask Hagfish to deliver it without reimplementing invoice math, billing entitlement, PDF generation, or email.
Available API
The client, onboarding, invoice, template, delivery, usage and webhook API is available at the production base URL below. Use disposable accounts when testing. See client onboarding to create links, review sends and inspect durable delivery outcomes.
Base URL
text
https://hagfish.app/api/v1The OpenAPI 3.1 document is the machine-readable reference for clients and tools.
Core workflow
- Create a scoped API key in Hagfish under Settings → Developers.
POST /clientsto save the client.POST /invoicesto create a draft with Hagfish-calculated totals.GET /invoices/{id}/previewto review the revision, totals, and applicable credits.- Generate a PDF or explicitly request a delivery with the reviewed revision and credit ceiling.
- Subscribe to signed webhooks such as
invoice.sent.
Every POST or PATCH uses Idempotency-Key, so a network retry cannot create a second resource or billing reservation.
Conventions
- Requests and responses use JSON with
snake_casefields. - Resource IDs are opaque strings. Store them; do not parse them.
- Monetary amounts in responses are decimal strings in the invoice's major currency unit.
- Lists use cursor pagination with
limitandafter. - Errors use
application/problem+jsonand include arequest_id. - Invoice deliveries return
202 Acceptedbecause sending is asynchronous.
Continue to Getting started for a complete first invoice.