generate_invoice
Generate a DRAFT invoice from a customer's approved billable hours over a billing period. The draft is editable and can be deleted before it is issued.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| notes | No | Optional notes to include on the invoice. | |
| due_date | No | Optional explicit due date (ISO 8601). Overrides payment_terms-based calculation. | |
| grouping | No | How to group approved hours into line items: "project" (default) or "task". | |
| period_end | Yes | Billing period end date (ISO 8601, e.g. 2026-05-31). | |
| customer_id | Yes | Id of the customer to invoice. | |
| period_start | Yes | Billing period start date (ISO 8601, e.g. 2026-05-01). | |
| payment_terms | No | Payment terms string, e.g. "Net 30" (default). | |
| idempotency_key | No | Optional caller-supplied key; retrying with the same key returns the original result instead of acting twice. |