API Documentation

Create, validate, render, and manage invoices programmatically. REST is for direct app integration; MCP and WebMCP are for agents that need safe tools around the same builder humans use.

Authentication

Private invoice reads, exports, saved clients and writes require an API key or a connected account. OAuth clients need registration and explicit permissions. Public tools expose public or caller-provided information; ownership and scope checks still apply.

1. Get an API key

Go to Settings and generate an API key. Keys start with iv_.

2. Include in requests

Pass it as a Bearer token in the Authorization header:

Authorization: Bearer iv_your_api_key_here

Endpoints

GET /api/health

Health check. No auth required.

Example response
{
  "status": "ok",
  "version": "0.1.0",
  "d1": true,
  "r2": true,
  "kv": true,
  "timestamp": "2026-04-07T12:00:00.000Z"
}
GET /api/invoices

List invoices with optional filters.

Query parameters

status draft | review | approved | sent | viewed | paid | overdue | void
type invoice | credit_note | quote | purchase_order
client_id Filter by client ID
from_date ISO date (YYYY-MM-DD)
to_date ISO date (YYYY-MM-DD)
limit 1-100, default 20
offset default 0
POST /api/invoices

Create a new invoice. Totals are calculated automatically from line items.

Example request
{
  "from_name": "Acme Corp",
  "bill_to_name": "Client Inc",
  "currency": "USD",
  "locale": "en",
  "issue_date": "2026-04-07",
  "due_date": "2026-05-07",
  "payment_terms": "Net 30",
  "items": [
    { "description": "Web development", "quantity": 40, "rate": 15000 },
    { "description": "Design review", "quantity": 5, "rate": 12000 }
  ],
  "tax_rate": 8.5,
  "notes": "Thank you for your business!"
}
Required fields
from_name Your name or company (1-500 chars)
bill_to_name Client name (1-500 chars)
currency ISO 4217 code (e.g. USD, EUR)
locale BCP 47 locale (e.g. en, es, fr)
issue_date ISO date (YYYY-MM-DD)
GET /api/invoices/:id

Get full invoice details including all line items.

PUT /api/invoices/:id

Read the invoice first, then send its revision as base_revision with a new operation_id. Invoice fields are optional; totals are recalculated.

{
  "base_revision": 3,
  "operation_id": "c6146f62-9ec6-4b17-b811-780df654078e",
  "notes": "Payment by bank transfer."
}

Retry a lost response with the same identifier, base and payload. Keep the working draft when a conflict returns; fetch the online version and review it before saving again. Use null to clear a due date, client or template.

DELETE /api/invoices/:id

Permanently delete an invoice.

GET /api/invoices/:id/export?format=pdf

Download the saved invoice as a PDF file. Requires access to this invoice.

POST /api/invoices/:id/share

Generate a shareable link for the invoice.

GET /api/clients

List clients. Optional ?q= search by name or email.

POST /api/clients

Create a client. Only name is required.

GET /api/templates

List available invoice templates (built-in and custom).

POST /api/brand-extract

Extract brand colors, fonts, and logo from a website URL.

Requires an available extraction service. Check the endpoint response before submitting content.
GET /api/dashboard

Get dashboard statistics: total invoices, revenue, outstanding, overdue.

Error format

All errors follow a consistent structure with machine-readable codes:

{
  "error": "Human-readable message",
  "code": "MACHINE_READABLE_CODE",
  "details": { "field": "from_name", "issue": "required" }
}

Common error codes

UNAUTHORIZED Missing or invalid API key (401)
FORBIDDEN Not your resource (403)
NOT_FOUND Resource does not exist (404)
VALIDATION_ERROR Invalid request body (422)
REVISION_REQUIRED Missing base revision or operation identifier (428)
REVISION_CONFLICT A newer invoice version needs review (409)
OPERATION_REUSED A save identifier was reused with different changes (409)
INVALID_AMOUNT Invalid whole minor-unit amount or unsafe calculated total (422)
PAYMENT_SERVICE_UNAVAILABLE Per-call payments unavailable; use an API key (503)
INTERNAL_ERROR Server error (500)

Service availability

Invoice creation, editing, PDF downloads and basic personal sync and history are free without a document-count cap across the website, API and MCP. Personal sync and history require an account. Authentication, permissions, abuse rate limits and operation-specific service availability still apply. Per-call payments are not available. Import, extraction and server rendering depend on account access and configured services. Check the actual response before relying on a result. Limits vary by operation and account; when a response includes Retry-After, wait before retrying. Do not automatically retry creation or other operations that may already have changed data.

Browser PDF downloads are free and need no account. Paid users, document workflows and the ChatGPT integration stay ad-free.

Optional REST endpoints may return payment instructions when configured. An API price does not grant access to private account records or make an unavailable service available. The MCP endpoint does not offer payment or subscription checkout.

MCP setup

Connect a compatible MCP client to https://freeinvoicemaker.app/api/mcp. Public discovery needs no account. Private invoice reads, exports and writes require an API key or a connected account with the required permissions.

Use the developer guide’s read-only examples to check discovery and account access. OAuth clients need registration; a manifest alone does not install or authorize an integration.

Available MCP tools (25)

Generated from the server’s available-tool registry. Read the live catalog and schemas.

Invoices

  • invoices.createAccount required

    Create a draft. Positive openings require prepared id, base_revision:null and operation_id. Replay identical requests; issue/settle separately with a dated command. Returns revision and write_ack.

  • invoices.queryAccount required

    Read an owned invoice or list by status, type, client and dates. Pagination and public field selection work on both. Items require an id. Text search is unavailable.

  • invoices.historyAccount required

    Read bounded owner-recorded history with provenance, preserved import evidence and an exact sequence cursor. Internal reasons stay in this owner view.

  • invoices.resolveOperationAccount required

    Check the original operation_id/request_hash: accepted, accepted_deleted, accepted_unavailable, not_applied or unknown. Preserve the request; unknown never permits a replacement.

  • invoices.prepareCreationAccount required

    Retain a fresh identity-free intent, then its issued request before create/DSL/copy. Replay lost replies with the same intent. Never prepare an existing unknown creation as a new intent.

  • invoices.closeOperationAccount required

    Close an unknown operation for good when saved records prove it never applied. Returns not_applied, or its accepted outcome. Only then prepare a replacement.

  • invoices.mutateAccount required

    Edit, record a ledger command, or delete with base_revision and operation_id. Money needs currency, effective_on and time_zone; no money moves. Preserve financial history and retry identities.

  • invoices.exportAccount required

    Export owned invoice file bytes, including the saved PDF. Decode and save those exact bytes; never rebuild the document or claim delivery before the host saves or attaches the file.

  • invoices.automateAccount required

    Retain commands for exact draft-schedule retries. Webhook secrets appear once; registration is not repeat-safe or delivery. REST lifecycle events only. No invoice sending or charges.

  • invoices.duplicateAccount required

    Copy one unpaid draft from source_revision. Prepare destination_id, issue_date and operation_id; retain exact input after unknown outcomes. Retry returns original write_ack and current revision.

  • invoices.summarizeAccount required

    Read cash, credits and balances for up to 50 owned documents. Review-required money is null and excluded; missing IDs are explicit. Totals stay separate by currency/type. Saves nothing.

  • invoices.suggestAccount required

    Suggest items from 20 recent issued invoices. Rates have currencies; pass currency for one rate and optional text suggestions. Check coverage and review before use. Nothing is saved.

  • invoices.createFromDslAccount required

    Keep the mcp_dsl request issued by invoices.prepareCreation before creating a text draft. Copy via prepared invoices.duplicate. SEND and FINALIZE are unavailable before any write.

  • invoices.analyticsAccount required

    Read stats by currency and UTC issue-date period. Cash, refunds, corrections, imports and credits stay separate. Excludes review money; 1000-row coverage. Not bank cash flow or verified revenue.

Templates

  • templates.queryPublic access

    Browse summaries by type, limit and offset; lists include total and next_offset. Read a full design and its conditional version by id. Preview formats return a browser review link.

  • templates.mutateAccount required

    Publish a conditional command with stable template/operation IDs and an exact expected version. Operations commit atomically. Keep and retry the identical command until acknowledged.

  • templates.applyAccount required

    Apply a reviewed template_snapshot with matching template_id, invoice_id, base_revision and operation_id. Reuse exact intent for retries; changed designs need review. Content stays intact.

Clients and products

  • entities.queryAccount required

    Read saved clients or products. Set type, then id for one record, or q to search names. A list returns clients or products with has_more. Results belong to the connected account.

  • entities.mutateAccount required

    Create, update or permanently delete an owned client or product. Set type and operation. Create and update return the stored record. Repeating creation makes another record.

Account, imports and help

  • iv.profileAccount required

    Return the account selected by these credentials, with its stable opaque ID and optional name/email. Takes no account selector.

  • importAccount required

    Read files or formatted text with a filename hint (e.g. items.csv), or save clients from vCards. Review results before use. URL, PDF, image and plain-language import are unavailable.

  • content.getPublic access

    Read a published help or documentation page by slug. Returns its title and Markdown text. Does not change the page.

  • content.listPublic access

    Find published help and documentation pages by slug and title. Does not include drafts.

  • iv.capabilitiesPublic access

    Read available tools, account requirements, supported formats, tax presets and example workflows. Service availability and a returned link do not confirm that an operation completed.

  • iv.feedbackPublic access

    Submit feedback, a bug report or a help request. No account is required. Include only details needed to investigate; leave out secrets and private conversation content.

WebMCP (browser agents)

Browser-based agents can discover tools via WebMCP. The manifest is at:

https://freeinvoicemaker.app/.well-known/webmcp.json

WebMCP-enabled pages include data-tool-* attributes on interactive elements, allowing agents to understand and interact with the UI directly.

DSL format

The invoices.createFromDsl tool accepts a compact text format for invoice drafts. Review the saved draft before exporting.

INVOICE INV-2026-0043
FROM Acme Design Co. | 123 Studio Lane
TO Globex Corp | ap@globex.com
DATE 2026-04-09
DUE 2026-05-09
CURRENCY USD
TAX 8.25
ITEMS
  Website redesign    1 × $8,500.00
  SEO audit           1 × $2,250.00

TAX uses a bare percentage such as 8.25. JSON creation can pair an exact lowercase reference ID with its matching tax_rate. Review each reference's scope and availability in iv.capabilities; required tax terms are yours to write. Email delivery and invoice locking are unavailable on this endpoint.

Start with the tested read-only MCP examples and use the live input schema before creating a draft.

Try it

GET/api/health