Create an invoice
invoice_createCreate a client invoice from line items, with automatic numbering, discounts, tax rates, and totals.
Instructions
Create an invoice for a client from a list of items. Allocates the next invoice number (never reused) and returns the stored invoice with its subtotal, discount, one tax line per rate and the total.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| items | Yes | Line items. Amounts are held as integer minor units and every line is rounded first, then summed, so the printed lines can never disagree with the total. A line may carry its own currency | |
| notes | No | Free text printed under the totals | |
| client | Yes | Client name or id. Unknown names are added automatically | |
| currency | No | Invoice currency, 3-letter ISO code. Defaults to the one currency every item agrees on, else your business default. Every line on one invoice must agree with it; a mix is refused with the exact conversion argument to pass rather than billed as if it were one currency | |
| due_days | No | Days until due, defaults to your payment terms | |
| issue_date | No | YYYY-MM-DD, defaults to today | |
| discount_percent | No | Discount percent applied to every line before tax, 0-100 |