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. | |
| 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 | ||
| reference_number | No |