Skip to main content

Invoices API

Create, manage, and send invoices. Supports sales invoices, quotes, credit notes, and incoming invoices.

Invoice Types​

TypeGermanDescription
rechnungAusgangsrechnungSales invoice
angebotAngebotQuote / proposal
gutschriftGutschriftCredit note
eingangsrechnungEingangsrechnungPurchase invoice

List Invoices​

GET /api/invoices?type=rechnung&status=offen&page=1&limit=25
ParamTypeDescription
typestringFilter by invoice type
statusstringentwurf, offen, teilbezahlt, bezahlt, storniert
customerIduuidFilter by customer
from / todateDate range (ISO 8601)

Create Invoice​

POST /api/invoices
{
"type": "rechnung",
"customerId": "customer-uuid",
"items": [
{
"position": 1,
"description": "Web Development - March 2026",
"unit": "hours",
"quantity": 40,
"unitPrice": "95.00",
"taxRate": "20.00"
}
],
"notes": "Payment within 14 days.",
"paymentTermDays": 14
}

Send via Email​

POST /api/invoices/:id/send
{
"to": "[email protected]",
"subject": "Invoice RG-2026-0042",
"message": "Please find your invoice attached."
}

Download PDF​

GET /api/invoices/:id/pdf

Record Payment​

POST /api/invoices/:id/payments
{
"amount": "1900.00",
"date": "2026-03-22",
"method": "bank_transfer"
}

E-Invoice Formats​

GET /api/invoices/:id/ebinterface   # Austrian standard
GET /api/invoices/:id/zugferd # EU standard

Statuses​

StatusDescription
entwurfDraft
offenOpen — sent to customer
teilbezahltPartially paid
bezahltFully paid
storniertCancelled

Get Invoice​

GET /api/invoices/:id

Returns a single invoice with all items, customer, and payment data.

Update Invoice​

PUT /api/invoices/:id

Same body as Create Invoice. Draft invoices can be fully updated. Sent invoices (offen) allow updating notes, footer text, and custom fields only.

Delete Invoice​

DELETE /api/invoices/:id

Soft-deletes the invoice. Only invoices with status entwurf (draft) or storniert (cancelled) can be deleted. Returns 204 No Content.

Email Preview​

Returns the resolved email subject and body (from your email templates, with all variables substituted) and the customer's email address — use this to pre-fill the send dialog before sending.

GET /api/invoices/:id/email-preview

Response:

{
"to": "[email protected]",
"subject": "Your quote AN-2026-0042",
"body": "Dear Ms. Müller,\n\nPlease find your quote attached..."
}

Offer Detail Description (Markdown → PDF)​

Quotes (angebot) support an optional detailed description in Markdown that is rendered as separate page(s) appended after the quote in the PDF.

Set or update the detail description:

PUT /api/invoices/:id
Content-Type: application/json

{
"detailsMarkdown": "## Project Scope\\n\\n- Item one\\n- Item two"
}

Generate with AI:

POST /api/ai/offer-details
{
"customerName": "Acme GmbH",
"items": [
{ "description": "Backend Development", "quantity": 80, "unit": "Std" }
],
"headerText": "Web platform relaunch",
"instruction": "Focus on technical approach and timeline"
}

Response:

{
"ok": true,
"markdown": "## Project Overview\\n\\nThis proposal covers..."
}

Requires Pro or Business plan. The generated Markdown is returned for review — save it via PUT /api/invoices/:id with detailsMarkdown.

Item Ordering​

Items are stored and rendered in the order of the position field (ascending). When updating an invoice, reorder items by changing their position values. The API always saves items in the submitted array order and renumbers positions 1..N automatically — so to reorder, simply submit the items array in the desired order.