Draft an invoice (no sending)
sef_draft_invoiceBuilds a local UBL 2.1 invoice draft from a profile and line items, returns totals plus an approval code, and does not submit it to SEF. Show the result to the user before sending.
Instructions
Builds a UBL 2.1 invoice locally from the profile and the given lines, stores it as a draft and returns totals plus an approvalCode. Nothing is sent to SEF. Always show the result to the user before sending.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lines | Yes | ||
| notes | No | Extra notes, added after profile and customer default notes | |
| number | Yes | Invoice number exactly as it should appear on the invoice | |
| dueDate | No | Due date; defaults to issueDate + paymentDueDays | |
| customer | Yes | Customer id or PIB from the profile | |
| issueDate | Yes | Issue date, YYYY-MM-DD | |
| periodEnd | No | ||
| sendToCir | No | ||
| attachments | No | PDF file paths relative to SEF_MCP_ATTACHMENTS_DIR (limit SEF_MCP_MAX_ATTACHMENTS, default 2) | |
| orderNumber | No | ||
| periodStart | No | ||
| deliveryDate | No | Datum prometa (mandatory on SEF since 3.14). Defaults to periodEnd, else issueDate — confirm with the user. | |
| contractNumber | No | ||
| paymentReference | No | Poziv na broj |