create_invoice | Create an invoice for a company, with line items. In this product, creating an invoice means issuing it: after this call, show the user a short summary (client, lines, totals) and, on their approval, call issue_invoice with confirm:true. Keep it as a draft only if the user explicitly wants to review or edit it in the app first. VAT is computed automatically by strict server-side fiscal rules (scenario + defaults) - never ask the user for a VAT rate. The fiscal scenario and client snapshot are frozen at creation; the snapshot carries the company's legal name (legal_name), which is what the invoice prints, even when it differs from the display name. | write |
issue_invoice | Issue a Draft invoice: the legal act of creating it (the product calls this 'Créer la facture'). The invoice becomes a definitive legal document (status Sent, displayed as 'Créée'): IRREVERSIBLE under French law, undone only with a credit note. ALWAYS show the user the invoice summary and get their explicit approval before calling with confirm:true; without confirm, returns a preview. Fiscal certification happens inside this call and is internal plumbing: once it returns, tell the user the invoice is created and nothing more. NEVER mention certification, fiscal status, immutability or processing to the user unless this tool returns an error. | write, destructive |
list_invoices | List the authenticated tenant's invoices, most recent first. Supports filtering by status, document type, and a free-text search on invoice number or client name, plus pagination. | read |
get_invoice | Fetch a single invoice by id, including its line items, client, and totals. Returns null-shaped error if the invoice is not visible to the caller. | read |
get_invoice_pdf | Return a temporary (1 hour) signed download URL for an invoice's PDF. Works for any document visible to the caller: imported invoices return their uploaded file; invoices issued in Kema Invoice (by the app or an agent) are rendered server-side with the workspace branding and, once certified, embed the Factur-X XML. Drafts render too (flagged is_draft: true) but are not legal documents yet. | read |
update_invoice | Update fields of a Draft invoice (dates, payment terms, notes, or reassign the company). Only Draft invoices can be modified - a Sent/certified invoice is immutable. | write |
delete_invoice | Soft-delete a Draft invoice. Irreversible from the user's view. Call with confirm:true to actually delete; without it, returns a preview of what would be deleted. | write, destructive |
cancel_invoice | Cancel a DRAFT invoice (status → Cancelled). Irreversible. Issued documents (Sent, Overdue, Paid) are fiscal records and cannot be cancelled outright: use create_credit_note, which issues a certified credit note (avoir) and cancels the original. Call with confirm:true to act; otherwise returns a preview. | write, destructive |
mark_invoice_paid | Mark a Sent or Overdue invoice as Paid. Optionally set the payment date (defaults to now). | write |
add_invoice_item | Add a line item to a Draft invoice. Totals are recalculated automatically. | write |
update_invoice_item | Update a line item on a Draft invoice. Totals are recalculated automatically. Item ids come from get_invoice or add_invoice_item. | write |
delete_invoice_item | Remove a line item from a Draft invoice. Totals are recalculated automatically. Item ids come from get_invoice or add_invoice_item. Call with confirm:true to delete; without it, returns a preview of the item. | write, destructive |
reorder_invoice_items | Set the display order of an invoice's line items. Pass the full desired order: every item id with its 0-based display_order. Item ids come from get_invoice or add_invoice_item. | write |
update_invoice_matter | Attach or detach the matter (dossier) on an invoice. Purely organizational - allowed even after the invoice is Sent, but not on a Cancelled invoice. Pass matter_id null to detach. | write |
check_certification_status | Maintenance tool: refresh an issued document's fiscal certification state from the certification provider and reconcile it into the database. Certification is internal plumbing that completes on its own after issue_invoice: NEVER call this proactively, and never bring certification up with the user. Use it only when the user explicitly asks about certification, or after issue_invoice returned a certification error. | write |
create_credit_note | Cancel a Sent or Paid invoice by issuing a credit note (avoir). The credit note is a legal fiscal document (fiscally certified when the original was certified) and is IMMUTABLE once created. IRREVERSIBLE. ALWAYS get the user's explicit approval before calling with confirm:true. Without confirm, returns a preview. | write, destructive |