invoice_from_timesheet
Turn time entries (hours x rate, with optional rounding, grouping by task and expenses) into a validated invoice JSON with totals, ready for POST /v1/invoice.pdf. Use validate_invoice (free) instead if you already have an invoice. Pure calculation: no network request, nothing is sent or stored. Costs $0.02 USDC per call via x402 (payment goes in _meta["x402/payment"]); invalid input returns an error and is not charged.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| buyer | Yes | ||
| notes | No | ||
| terms | No | e.g. "Net 15"; sets due_date from issue_date (early-pay discounts are not applied to the invoice) | |
| seller | Yes | ||
| entries | Yes | ||
| currency | No | USD | |
| discount | No | ||
| due_date | No | YYYY-MM-DD; or give terms instead | |
| expenses | No | Reimbursable expenses, one line each | |
| group_by | No | entry = one line per entry; description = merge entries with the same description and rate | entry |
| rounding | No | ||
| tax_rate | No | ||
| issue_date | Yes | ||
| default_rate | No | Hourly rate for entries without their own rate | |
| invoice_number | Yes | ||
| payment_instructions | No |