Render an Austrian invoice as a watermarked preview. Works without a facturo account; with a connected account the preview is an Entwurf the user also sees at facturo.at, nothing is numbered or sent. The user sees the preview as a card in the chat after each call. A new draft needs client.name (or client_id with a connected account) and at least one item; later calls pass draft_id plus only the fields that change. Returns the draft_id, the totals, the review_hash that finalize_invoice needs, and 'missing': what the real invoice still needs. It works with only a client name and one position.
View input schema
{
"type": "object",
"properties": {
"draft_id": {
"type": "string",
"description": "Id of a draft from an earlier preview_invoice result. Pass it to change that draft instead of starting a new one: client and issuer merge field by field, every other field given replaces the old value, items replace the whole list."
},
"client": {
"type": "object",
"description": "The invoice recipient. The name is required for the first preview of a draft; the real invoice needs the address.",
"properties": {
"name": {
"type": "string",
"description": "Company or person the invoice is addressed to",
"maxLength": 255
},
"name_line2": {
"type": "string",
"description": "Second address line, e.g. contact person or department",
"maxLength": 255
},
"street": {
"type": "string",
"maxLength": 255
},
"zip": {
"type": "string",
"maxLength": 20
},
"city": {
"type": "string",
"maxLength": 100
},
"country": {
"type": "string",
"description": "ISO 3166-1 alpha-2, default AT",
"maxLength": 50
},
"uid": {
"type": "string",
"description": "Client's VAT id (UID), e.g. ATU12345678",
"maxLength": 50
},
"email": {
"type": "string",
"maxLength": 255
}
}
},
"client_id": {
"type": "integer",
"description": "Id of an existing client of the connected facturo account (from search_clients). Use it instead of 'client' whenever the client exists; needs a connected account."
},
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"description": {
"type": "string",
"description": "Short single-line name of the item, e.g. 'Innenputz' or 'Regiestunden'. Renders as one line on the PDF - newlines are rejected; details go into ephemeral_description.",
"maxLength": 500
},
"ephemeral_description": {
"type": "string",
"description": "Optional per-item details, printed small below the item name. Multi-line allowed. For hour/date breakdowns, material lists, work-scope detail, vehicle/object identifiers - anything specific to this line on this invoice. Detail for this one line only - never pack a whole position list into a single item's details. For a flat total with positions listed just for reference, create one item per position with unit_price '0' plus one priced Pauschale line.",
"maxLength": 2000
},
"quantity": {
"type": "string",
"description": "Decimal as string, e.g. '2' or '1.5'"
},
"unit_price": {
"type": "string",
"description": "Net unit price as decimal string"
},
"unit": {
"type": "string",
"description": "e.g. 'Std', 'Stk', 'm2'; may be empty",
"maxLength": 50
},
"product_id": {
"type": "integer",
"description": "Optional saved product id"
},
"vat_rate": {
"type": "number",
"description": "VAT rate in percent for THIS line, only on accounts with per-line rates (the tool says so if the account has none). Omit it for the document's vat_rate. A saved product with its own vat_rate gives its line that rate."
}
},
"required": [
"description",
"quantity",
"unit_price"
]
},
"minItems": 1,
"maxItems": 100
},
"invoice_number": {
"type": "string",
"description": "Only without a connected account: the user's own invoice number, the next one in their sequence (e.g. '2026-014'). Ask the user for it, never invent one. A connected account numbers automatically.",
"maxLength": 50
},
"invoice_type": {
"type": "string",
"enum": [
"normal",
"honorarnote"
],
"description": "'honorarnote' for freelancers/Freiberufler who bill a Honorar; default 'normal'"
},
"invoice_date": {
"type": "string",
"description": "YYYY-MM-DD, default today"
},
"due_date": {
"type": "string",
"description": "YYYY-MM-DD; default invoice_date + payment_days"
},
"payment_days": {
"type": "integer",
"description": "Zahlungsziel in days, default 14; ignored when due_date is given"
},
"service_period_start": {
"type": "string",
"description": "YYYY-MM-DD, Leistungszeitraum start; default invoice_date"
},
"service_period_end": {
"type": "string",
"description": "YYYY-MM-DD, Leistungszeitraum end"
},
"vat_exemption_type": {
"type": "string",
"enum": [
"",
"small_business",
"construction",
"eu_service",
"eu_goods",
"healthcare"
],
"description": "Omit unless the user named one: a connected preview then picks the account's treatment (Kleinunternehmer setting, the client's last invoice, the account's usual mode, else 20%) and reports it. '' forces regular VAT. 'small_business' = Kleinunternehmer (no VAT, §6 Abs 1 Z 27 UStG), 'construction' = Reverse Charge Bauleistungen (§19 Abs 1a), 'eu_service' / 'eu_goods' = innergemeinschaftlich, 'healthcare' = §6 Abs 1 Z 19."
},
"vat_rate": {
"type": "number",
"description": "VAT rate in percent (10 and 13 are the reduced Austrian rates). Omit to inherit: the client's last invoice's rate, else 20."
},
"prices_include_vat": {
"type": "boolean",
"description": "Unit prices are gross (Brutto) amounts. Omit to inherit from the client's last invoice, else false."
},
"kopftext": {
"type": "string",
"description": "Text above the items; default: the account's standard text",
"maxLength": 5000
},
"fusstext": {
"type": "string",
"description": "Text below the totals; default: the account's standard text. A 'bereits bezahlt' remark goes here as 'Der Rechnungsbetrag wurde bereits bezahlt.'",
"maxLength": 5000
},
"reference_lines": {
"type": "string",
"description": "Extra reference lines in the header, e.g. 'Projekt: Dach Huber'",
"maxLength": 500
},
"discount_type": {
"type": "string",
"enum": [
"none",
"percentage",
"fixed"
],
"description": "Gesamtrabatt on the whole document, deducted as its own line below the items (VAT is computed on the reduced amount). 'percentage' = discount_value is a percent of the net item total, 'fixed' = discount_value is an EUR amount (in the draft's price mode). Requires discount_value. Set it when the user grants a discount/Nachlass/Aktionscode on the whole invoice or offer; never bill a discount as a negative item. 'none' clears a discount set earlier. Not available on an Anzahlungsrechnung (the deposit share replaces it); a Storno inherits the cancelled invoice's discount automatically."
},
"discount_value": {
"type": "string",
"description": "Decimal as string: the percent ('25') or EUR amount ('100') per discount_type. Must be above 0, a percentage at most 100."
},
"discount_description": {
"type": "string",
"description": "Label printed on the discount line, e.g. 'Rabatt' (default), 'Rabatt Aktionscode START25', 'Treuebonus'. The percentage or amount is printed next to it automatically, so leave it out of the label.",
"maxLength": 255
},
"issuer": {
"type": "object",
"description": "The sender (the user's own business). Everything is optional for a preview; missing mandatory fields render as placeholders and are listed under 'missing'. With a connected account the profile there wins; only an account without a company profile yet takes these fields.",
"properties": {
"company_name": {
"type": "string",
"maxLength": 255
},
"street": {
"type": "string",
"maxLength": 255
},
"zip": {
"type": "string",
"maxLength": 20
},
"city": {
"type": "string",
"maxLength": 100
},
"uid": {
"type": "string",
"description": "Own VAT id (UID)",
"maxLength": 50
},
"email": {
"type": "string",
"maxLength": 254
},
"phone": {
"type": "string",
"maxLength": 50
},
"iban": {
"type": "string",
"maxLength": 50
},
"bic": {
"type": "string",
"maxLength": 20
},
"bank_account_holder": {
"type": "string",
"maxLength": 70
}
}
}
}
}