Rechnung erstellen
finalize_invoiceTurn a previewed draft into the real invoice. Only call it after the user has seen the preview and explicitly said yes. Without a facturo account it returns a link to the final PDF (no watermark, the user's own invoice_number from the draft); nothing is stored for the user, they download and keep the PDF. With a connected account it allocates the number to the Entwurf the preview made. review_hash comes from the last preview_invoice result; a stale hash is refused. Fails with the missing fields when something mandatory is missing. Calling it again for the same draft returns the invoice already created. While the account has no invoice yet but this chat holds anonymous ones not imported, it answers import_first instead: call import_invoices, or repeat with skip_import=true if the user declined.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"draft_id": "<draft_id>",
"review_hash": "<review_hash>"
},
"name": "finalize_invoice"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| draft_id | Yes | ||
| review_hash | Yes | review_hash of the preview the user confirmed | |
| skip_import | No | Create the invoice although anonymous invoices from this chat are not imported yet. Only after the user declined the import. |