Create draft invoice

Create a draft invoice for a customer with lines. The draft is not booked.

POST https://cotlet.dev/api/v1/e-conomic/customers/{customer_number}/draft-invoices

write

Creates a draft with the customer, date, currency, payment terms, layout and lines. The recipient name and VAT zone are copied from the customer. The draft stays editable and is not booked, so it reaches no one and runs without asking first. Lines take a product number or a free text with quantity and unit price. Returns the draft number and net, VAT and gross totals.

Parameters

Parameters: create_draft_invoice
NameTypeDescription
customer_number integer required integer Customer number from list_customers or create_customer.
date date required date Invoice date, YYYY-MM-DD.
currency string required string Currency code, e.g. DKK.
payment_terms_number integer required integer Payment terms number from the customer.
layout_number integer required integer Layout number for the invoice.
lines array required array Lines: product_number (optional), description, quantity, unit_price.

Request

cURL
curl -X POST https://cotlet.dev/api/v1/e-conomic/customers/14/draft-invoices \
  -H "Authorization: Bearer $COTLET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"date":"2026-10-31","currency":"DKK","payment_terms_number":2,"layout_number":1,"lines":[{"description":"Consulting, October","quantity":10,"unit_price":95},{"description":"Workshop day","quantity":1,"unit_price":250}]}'
Python
result = client.call("e-conomic", "create_draft_invoice", {"customer_number":14,"date":"2026-10-31","currency":"DKK","payment_terms_number":2,"layout_number":1,"lines":[{"description":"Consulting, October","quantity":10,"unit_price":95},{"description":"Workshop day","quantity":1,"unit_price":250}]})
Node.js
const result = await cotlet.call('e-conomic', 'create_draft_invoice', {"customer_number":14,"date":"2026-10-31","currency":"DKK","payment_terms_number":2,"layout_number":1,"lines":[{"description":"Consulting, October","quantity":10,"unit_price":95},{"description":"Workshop day","quantity":1,"unit_price":250}]});
CLI
cotlet call e-conomic create_draft_invoice --data '{"customer_number":14,"date":"2026-10-31","currency":"DKK","payment_terms_number":2,"layout_number":1,"lines":[{"description":"Consulting, October","quantity":10,"unit_price":95},{"description":"Workshop day","quantity":1,"unit_price":250}]}'

Example response

JSON

{
  "draft_invoice_number": 118,
  "customer_number": 14,
  "date": "2026-10-31",
  "currency": "DKK",
  "lines": 2,
  "total_net": 1200,
  "total_vat": 300,
  "total_gross": 1500,
  "booked": false
}

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.