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 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.
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:
download_url (saves the file), signed_url (opens it), and app_url (the
document in Well). Hand the user download_url when they ask for the PDF
itself. Both signed links stop working at expires_at; app_url does not.
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. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | No | ||
| error | No | ||
| success | Yes | ||
| invoice_id | No | ||
| document_id | 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. | |
| reference_number | 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. |