Create draft invoice

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

MCP tool e_conomic_write → create_draft_invoice

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.

tools/call

JSON-RPC

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "e_conomic_write",
    "arguments": {
      "operation": "create_draft_invoice",
      "arguments": {
        "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

{
  "content": [
    {
      "type": "text",
      "text": "{ ... same JSON as structuredContent ... }"
    }
  ],
  "structuredContent": {
    "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
  },
  "isError": 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.