Create invoice upload url
create_invoice_upload_urlStep 1 of adding an invoice: creates a document row and returns a short-lived signed URL to PUT the PDF to. Upload the file yourself to that URL, then call book_invoice with the returned document_id. Returns { document_id, upload_url, storage_path, expires_in_seconds }. Pass document_id to attach or REPLACE the PDF of a document that already exists instead of creating a new one — that is how you fix an invoice that was booked without its file, and how you supply the PDF an already-pushed voucher is missing (then run sevdesk_attach_document). Pass source_url INSTEAD of uploading yourself and the server fetches the file in this one call — no upload_url comes back because there is nothing left to do. Use it for a signed download link from another system: those expire in minutes (a SynapseLingo invoice link lasts 600 seconds), and between two agent steps far more than that can pass, so a two-step upload loses the race and has to re-fetch. CONTRACTS (Mietvertrag, Darlehens-/Gesellschaftervertrag, Dauerrechnung): pass document_type:'contract' and optionally contract with the terms. A contract is filed as a Dauerbeleg for recurring bookings — it is never booked itself and never pushed to sevDesk, so skip book_invoice for it. list_contracts shows what is filed.
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": {
"file_name": "<file_name>"
},
"name": "create_invoice_upload_url"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| contract | No | Only with document_type 'contract' (new or existing document): the terms, stored in metadata.contract and merged into what is there. Fields: nummer (contract number), beginn / ende (YYYY-MM-DD; omit ende or null for unbefristet), betrag (gross amount per period), turnus (monatlich | vierteljaehrlich | halbjaehrlich | jaehrlich | einmalig), kuendigungsfrist (text, e.g. '3 Monate zum Quartalsende'), notiz, belege (array of sevDesk voucher ids booked under this contract). | |
| file_name | Yes | File name including extension, e.g. 'rechnung-2026-04.pdf' | |
| source_url | No | http(s) URL the server should fetch the file from, in this same call. The response then reports fetched_bytes and content_type instead of an upload_url. Max 25 MB. Private and loopback addresses are refused — this fetch runs inside the server's own network. | |
| document_id | No | Attach the PDF to this existing document instead of creating a new row. The row's file_path and file_name are repointed at the new upload; nothing else about it changes. | |
| vendor_name | No | Supplier name, if you already know it | |
| document_type | No | invoice (default) | receipt | contract | offer | order | other. 'contract' files a Vertrag (lease, loan, shareholder agreement) as Dauerbeleg; it is excluded from every sevDesk push. |