prepare_client_invoice
Prepare a client invoice from a saved ExpenseBot report without creating it. Reads canonical report rows, allocates a unique invoice number, verifies the client ledger identity and advance, and returns exact totals plus a short-lived preparationId. Call this first, show the preview to the user, then call create_client_invoice after explicit confirmation. It reserves the invoice number and preview for 30 minutes but creates no invoice, document, Income row, email, or payment.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| taxPct | No | Tax percentage applied after markup and custom line items; use 0 for no tax. | |
| reportId | Yes | Saved ExpenseBot report ID to invoice. | |
| taxLabel | No | Tax label such as HST, GST, or VAT. | |
| issueDate | Yes | Calendar-valid invoice date in YYYY-MM-DD format. | |
| markupPct | No | Markup applied only to rebilled expense rows. | |
| clientName | Yes | Full client or business name shown on the invoice. | |
| receiptIds | No | Optional exact report receipt IDs. Defaults to every current report expense. | |
| billToEmail | No | Optional client email printed on the invoice. This does not send email. | |
| paymentTerms | No | Invoice due terms. Defaults to the client's billing profile or net30. | |
| clientAddress | No | Optional billing address printed in the invoice's Bill To section. | |
| invoiceNumber | No | Optional custom invoice number. ExpenseBot allocates one when omitted. | |
| advanceApplied | No | Verified client advance to apply against this invoice. | |
| customLineItems | No | Optional fee/service lines. They are taxed but never marked up. | |
| mentionSupportingReceipts | No | When true, note on the invoice that supporting receipts are available. |