Create invoice

Save a draft invoice for a contact. Nothing is sent and no number is assigned yet.

POST https://cotlet.dev/api/v1/lexware-office/contacts/{contact_id}/invoices

write

Saves an invoice as a draft, the state Lexware Office keeps editable until finalised. The draft has no invoice number, reaches no customer and is deleted with one call in the app, so it does not ask for your OK. Returns net, tax and gross totals so you can check them before finalize_document.

Parameters

Parameters: create_invoice
NameTypeDescription
contact_id string required string Contact ID from list_contacts or create_contact.
invoice_date string required string Invoice date, YYYY-MM-DD.
lines array required array Line items. Each has name, quantity, unit_price_net (EUR) and tax_rate (percent, as offered in your Lexware Office tax settings). Free-text lines need only a name.
delivery_date string string Delivery or service date, YYYY-MM-DD.
payment_term_days integer integer Days until the invoice is due. Default: your Lexware Office payment terms.
intro_text string string Introduction text above the lines.

Request

cURL
curl -X POST https://cotlet.dev/api/v1/lexware-office/contacts/c_4f2a91/invoices \
  -H "Authorization: Bearer $COTLET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"invoice_date":"2026-10-14","payment_term_days":14,"lines":[{"name":"Consulting, October","quantity":10,"unit_price_net":95,"tax_rate":19}]}'
Python
result = client.call("lexware-office", "create_invoice", {"contact_id":"c_4f2a91","invoice_date":"2026-10-14","payment_term_days":14,"lines":[{"name":"Consulting, October","quantity":10,"unit_price_net":95,"tax_rate":19}]})
Node.js
const result = await cotlet.call('lexware-office', 'create_invoice', {"contact_id":"c_4f2a91","invoice_date":"2026-10-14","payment_term_days":14,"lines":[{"name":"Consulting, October","quantity":10,"unit_price_net":95,"tax_rate":19}]});
CLI
cotlet call lexware-office create_invoice --data '{"contact_id":"c_4f2a91","invoice_date":"2026-10-14","payment_term_days":14,"lines":[{"name":"Consulting, October","quantity":10,"unit_price_net":95,"tax_rate":19}]}'

Example response

JSON

{
  "document_id": "d_c44e19",
  "type": "invoice",
  "number": null,
  "status": "draft",
  "contact": {
    "contact_id": "c_4f2a91",
    "name": "Nordlicht Design GmbH"
  },
  "date": "2026-10-14",
  "due_date": "2026-10-28",
  "lines": [
    {
      "name": "Consulting, October",
      "quantity": 10,
      "unit_price_net": 95,
      "tax_rate": 19
    }
  ],
  "total_net": 950,
  "total_tax": 180.5,
  "total_gross": 1130.5,
  "currency": "EUR"
}

Sign in once. Your agent does the rest.

Sign up and add the apps you need. Free 7-day trial with 2,000 credits, no card needed.