Create invoice document
well_create_invoice_documentRender an existing invoice as a print-ready PDF and attach it as the invoice's source document. The invoice shortcut of well_generate_document: it prints the invoice in its own chosen design, ink and locale. Use well_generate_document instead to choose another design or to print values that are not an invoice in Well.
The letterhead carries the issuing company's own mark when Well has one on file, and otherwise sets the issuer's name as text. Never promise a logo.
Use this tool when the user asks to generate, render, or attach a PDF for an invoice that already exists in the workspace. This does NOT email or send the invoice anywhere — it only creates and attaches the file. A request to email or send an invoice is not a request for its PDF: do not call this tool for it.
REQUIRED: invoice_id (the invoice must already exist)
Refused if the invoice is already linked to a REAL ingested document (an upload, a connector import, or a provider-issued PDF) — that source of truth is never overwritten.
Returns { success: true, invoice_id, document_id, reference_number, file } on success, or { success: false, error } on failure.
file carries the rendered PDF's name and size plus the links to fetch it.
Hand the user download_url when they ask for the PDF itself.
download_urlsaves the PDF andsigned_urlopens it in a browser. Both work with a plain HTTP GET and no auth header, and stop working atexpires_at.preview_urlis a PNG image of the first page, for showing the document; addpage=Nfor page N, up topage_count. Same token and expiry.sheet_urlis the document's HTML sheet, which the card draws with zoom and pan. Same token and expiry.When the user wants to do more with a PDF already generated (attach it to an email, upload it elsewhere, read or analyse it), fetch
download_urlwith a plain HTTP GET.If the links have expired, call this tool again to refresh the same document and its links.
app_urlopens the document in Well and never expires.The links grant access to the file on their own: share them only with the user.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| invoice_id | Yes | ||
| workspace_id | No | Target workspace. Omit when the token authorizes one workspace. Required when it authorizes several — a write lands in exactly one workspace and this call would not say which. | |
| conversation_id | No | The conversation id returned by the previous Well result, in its meta under well/conversation_id, in its structuredContent, or in its JSON text block. Pass it back on every call in the same conversation, including a call a card makes, so the chosen workspace and the earlier answers still apply. It decides the conversation on its own: nothing the host states about the session replaces it. Omit it only on the first call of a conversation. | |
| idempotency_key | No | Optional client-supplied key. A retried write with the same key returns the original result instead of re-applying the operation. | |
| workspace_scope | No | Restrict this call to the family: the token's primary workspace plus the company workspaces under it that you are a member of. Unrelated authorized workspaces drop out of the read; row reads merge across the family, while a per-workspace figure still reports exactly one workspace. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | No | ||
| error | No | ||
| success | Yes | ||
| invoice_id | No | ||
| document_id | No | ||
| invoice_status | No | ||
| conversation_id | No | The conversation this result belongs to. Pass it back as the conversation_id argument on every later Well call in the same conversation. | |
| newly_connected | No | Tools that connected to this workspace since the last result and that no session was told about yet, oldest first. Present only when at least one tool is new. The connected-line rule says when to tell an entry; when it does, one line per entry, in the person's language: "<name> is connected.". Never fold several entries into one sentence. Each entry comes back once, on one result only: never repeat its line later. | |
| reference_number | No | ||
| document_type_code | No | ||
| conversation_id_note | No | Present only when the server opened a fresh lane, stating that no choice recorded earlier was read. | |
| conversation_id_source | No | Where the conversation id came from: the host's own request meta, the caller's argument, or a fresh lane the server opened. |