create_document
Create customer invoices, vendor bills, employee expense vouchers, or credit notes, then add line items and post them to the books.
Instructions
Create a customer invoice, vendor bill, employee expense voucher, or credit note.
The owner side derives from the document type — invoice →
customer, bill → vendor, voucher → employee. Credit notes
exist on both sides, so they alone require party_type
("customer" or "vendor"). After creating, add line items
with add_document_entry, then post_document to put it on
the books.
Args: document_type: "invoice", "bill", "voucher", or "credit_note". owner_id: The owning party's ID (customer ID for invoices, vendor ID for bills, employee ID for vouchers). ID counters are per type. party_type: Required for credit notes only ("customer" or "vendor" — which side the credit belongs to). Derived from document_type otherwise. date_opened: ISO date. Defaults to today (echoed in the response). notes: Optional notes (max 4096 characters). currency: ISO code. Defaults to the owner's currency, then the book default. term: Billterm name (e.g., "Net 30"). Optional. id: Custom document number; auto-generated when omitted. job_id: Optional Job to group under (invoices and bills; must belong to the same owner). applies_to_id: Credit notes only — the invoice/bill this credit note reverses. The link is PROVENANCE, not a constraint: apply_credit_note can net the credit against any open document from the same owner (its response notes the divergence when the applied target differs from this link).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | ||
| term | No | ||
| notes | No | Optional notes. Capped at 4096 characters at the MCP boundary; oversize input rejects with a clear error. | |
| job_id | No | ||
| currency | No | ||
| owner_id | Yes | ||
| party_type | No | ||
| date_opened | No | ||
| applies_to_id | No | ||
| document_type | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |